From 19b407ec1c6479565c8727c1ac6532612989c867 Mon Sep 17 00:00:00 2001 From: TallGorilla <24dasemu@gmail.com> Date: Tue, 12 Oct 2021 21:37:59 +0200 Subject: [PATCH 1/5] Fixed two problems. First of all i fixed #25 by adding a fast internet connection check so it doesnt throw exceptions every time if no internet connection. Also fixed a bug that i involuntary created in #34. Now its possible to change voices with `change voice to male/female` command. --- Jarvis2_4windows.py | 12 +++++++++--- __pycache__/actions.cpython-37.pyc | Bin 3543 -> 3545 bytes __pycache__/commands.cpython-37.pyc | Bin 3420 -> 3420 bytes actions.py | 4 ++-- config.ini | 2 +- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Jarvis2_4windows.py b/Jarvis2_4windows.py index 5dfef30..bf2919d 100644 --- a/Jarvis2_4windows.py +++ b/Jarvis2_4windows.py @@ -1,5 +1,6 @@ import configparser import os +import requests import speech_recognition as sr @@ -132,11 +133,16 @@ def take_command(): main(search_engine, take_command, debug) -if os.path.isfile('./config.ini'): # Checks if config.ini exists. +# Checks if config.ini exists and you have internet access. +status_code = requests.get("https://github.com", timeout=5).status_code +if os.path.isfile('./config.ini') and status_code == 200: config = configparser.ConfigParser() # if exists loads library. config.read('config.ini') # and also the file. run() # Then it launches the main program else: # if it doesn't exist it drops an error message and exits. - print('You need a config.ini file.') - print('Check the documentation in the Github Repository.') + if os.path.isfile('./config.ini') is False: + print('You need a config.ini file.') + print('Check the documentation in the Github Repository.') + if status_code != 200: + print("I couldnt stablish an internet connection.") diff --git a/__pycache__/actions.cpython-37.pyc b/__pycache__/actions.cpython-37.pyc index e6259f827bc3951290bcade76e7787b6d1beeec1..4ca50de037e510875ec920ddc63cc6260f90f358 100644 GIT binary patch delta 874 zcmZXSJ#Q015Qe=z-}&S2;v|+6j0u>0KA`+b&YjwAAPQ+(3cOlq~ z1ybmvrHF)(l8zWV@5cq&~*Rj7o zJU>j_m;9M1%nj{Hl`sNE!P#DtaS)e?5t!oV_4-JTzJ87r_@VykQb8)pabdJ*5Hf&^ z@;53psP@8`B_;kPQ+WT;$dLZD+!toR!cAy*7=&G+d433(1#CnP1^OO%GMg#mvM%%| zy9~O*3h86kaN4aF^<9`lok9IzkAcWIZGX#aZh1RwxHw8oXPf#>)&Lr^^%#GUDv_$P z^E{Oz)@3PyS&5!r;;+(cWS)Oc7n2LPk}UB*>9xicl%Q?6Dj|%gZO>tWh80s;Jc6U>4enX>d=D1* zS99^vs5@9h>1Z<}TmLy)MWr&MYz;fwuxfYj$nClw(2lnXx6YPEFVU55V006K^8l6f zHveEP_k|VBq(dQ)@8SY(PfFC2oo*Ng&sHFbOB0AZVhW+GmoTa#Y6!F<67tHS8iO#K u|6Y&sCaiTe{>`WqJ|j^{0HdxN8LVIy)fw!jf}j_14*m`P3C`OsG|@eLc(d<2Z@%x%{3`t{+1G44laSwC zkJ2}tK6DP~E2UG4z8ReMz`9r7>hnJHLlI6FP&q$8{NWL?(aw9~T;(KbD z%3!Dj^m{$(yD*PBo%+Ep1Ci20&|!%<>(wy57_ZJ;4rPw<;Yl`Kbg z9vcQRt5O1U5{}AWr(2}Pzokq10{+nXpLDBz8U<(?&PWLTVc+YpKq#L3k7qcCA`=nY zhC0TJhz4Q_fm0oK$X{e`k*4(XQLkcZjz2Y9#Tte<`@N&a8lLX~y5etB3-@5s6r4r* zu77bE8vaMwiy4jrN*Yy8k!8bJwv zoRDx*gJBp3kD8E@D`CYKGN2I1N0CF-3?h$+tX42uMl=z4v`}T6VKi-Fc8{M3tYFew zkM4LQE{ShN+)#m0H@X?PgjJ$RVAo?aj^825jVryryR*%%61fVnA%hr-LHH+o@h<|x Bxx4@X diff --git a/__pycache__/commands.cpython-37.pyc b/__pycache__/commands.cpython-37.pyc index 1f8d27a72efc67221f480a747b199760cfdf9f8d..21e1cea441b64c59d8abffc31880952af1e02071 100644 GIT binary patch delta 20 acmca3bw`TZiI Date: Tue, 12 Oct 2021 21:39:33 +0200 Subject: [PATCH 2/5] erratum fixed couldnt --> couldn't --- Jarvis2_4windows.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jarvis2_4windows.py b/Jarvis2_4windows.py index bf2919d..590eb1d 100644 --- a/Jarvis2_4windows.py +++ b/Jarvis2_4windows.py @@ -145,4 +145,4 @@ def take_command(): print('You need a config.ini file.') print('Check the documentation in the Github Repository.') if status_code != 200: - print("I couldnt stablish an internet connection.") + print("I couldn't stablish an internet connection.") From 0a2e7edf855604448699264c9dc8ba3e519f04f4 Mon Sep 17 00:00:00 2001 From: TallGorilla <24dasemu@gmail.com> Date: Tue, 12 Oct 2021 21:42:50 +0200 Subject: [PATCH 3/5] Update Jarvis2_4windows.py --- Jarvis2_4windows.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jarvis2_4windows.py b/Jarvis2_4windows.py index 590eb1d..4ad441d 100644 --- a/Jarvis2_4windows.py +++ b/Jarvis2_4windows.py @@ -1,7 +1,7 @@ import configparser import os -import requests +import requests import speech_recognition as sr from actions import ( From 352c1342d5a14dffc251b2d9ada0636e2aa65903 Mon Sep 17 00:00:00 2001 From: TallGorilla <24dasemu@gmail.com> Date: Sat, 23 Oct 2021 10:59:33 +0200 Subject: [PATCH 4/5] x --- __pycache__/actions.cpython-37.pyc | Bin 3545 -> 3778 bytes __pycache__/gui.cpython-37.pyc | Bin 1075 -> 1158 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/__pycache__/actions.cpython-37.pyc b/__pycache__/actions.cpython-37.pyc index 4ca50de037e510875ec920ddc63cc6260f90f358..9325392b8320a76225d4d76c40a4848db0af5759 100644 GIT binary patch delta 1122 zcmZuv%}*0S6rb6)+wHdHqqNWuC^R5YihPI&YJyRsiSZ*O9?&L+Y&v6INw;-&Q9u%6 z;ErT2ns8|U08boEIB+#F@#r3mClCG!o_uc$HK4nh-@JLBzxQUoWsdvWZbhRyf$!ia zH-=*SZAm({KXR8E`!93bEXKNaNioXeECG8P_to23cY_u?ct^dH^?(%Pq~6sa#W;`G z6D--Fl<+u9r3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Y6W0CgRQ=T;E3Z4 zQ4E@7B=@L?k-!UoiD)1^5pZvgX(+-)Mc_%a#Iy>!2KPP>czA_)W$w{Bk9hS8(T1o` zn&5B2Zu8olV8rXZ0iF(T@)qc>2wg;vx91o#1&ar~v%I#}c$asV@J0lab-K>+0QGx6 z0V6uQ%2zF6Vp((sL^<) zby=8dToxzE=}bc1F5VT$qp*@%vKV!)1wa zxHiDBxHNId$iiC!@D)1Z3Y50&zHf+5O>oG@A~Us|CB^8(Hpci<7N-EyM*R!32X%Y^ z!kJFWVwBmpT?kv@wDvt*fBEWxM*~-v=rj64KHV~QQMcVuwmn;$kkx+ipX7n#XZ=n- z`zs8Rf0AU`MfaxLn{4&ret*MMbea?}WwHsew5?NhGli~LX$dyuI5oa3OHErV?==^+ z#S=Bn*!k!z;ip2Iz|F2~+rPqH*IQYIgX@sALt*^Gm;1+*4Bom@q=iWR-PgwlG&;*i zI?|k!3zB%jq4e-I%+vh_>^R&oZ%Nhfh5O5#a`ja1A%`niu&!*pc6I F=Rcn4@^%0K From d27189f6902ed4fd828f23046e10bed5b8f3a53c Mon Sep 17 00:00:00 2001 From: TallGorilla <24dasemu@gmail.com> Date: Sat, 23 Oct 2021 11:08:02 +0200 Subject: [PATCH 5/5] Update Jarvis2_4windows.py --- Jarvis2_4windows.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jarvis2_4windows.py b/Jarvis2_4windows.py index ff737c9..c8babaf 100644 --- a/Jarvis2_4windows.py +++ b/Jarvis2_4windows.py @@ -26,7 +26,7 @@ command_stop_music, command_unpause_music, command_whatsup, - command_wikipedia + command_wikipedia, ) popular_websites = {