From d8c60198b7988415d452c76ae6841a206b14cbfb Mon Sep 17 00:00:00 2001 From: Nandan Desai Date: Mon, 20 Apr 2020 00:53:06 +0530 Subject: [PATCH] temporary fix for #2 --- build.sh | 2 +- torghost.py | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/build.sh b/build.sh index 3dbc0dc..274104c 100755 --- a/build.sh +++ b/build.sh @@ -5,4 +5,4 @@ echo "Installing dependencies " sudo pip2 install -r requirements.txt pyinstaller --onefile torghost.py sudo cp -r dist/torghost /usr/bin/ -echo "TorGhost has been built and installed successfully!" +echo "Done." diff --git a/torghost.py b/torghost.py index 7cfea13..ea8a3eb 100755 --- a/torghost.py +++ b/torghost.py @@ -114,10 +114,15 @@ def check_root(): sys.exit(0) -notify2.init("TorGhost") -n = notify2.Notification(None) -n.set_urgency(notify2.URGENCY_NORMAL) -n.set_timeout(10000) +try: + notify2.init("TorGhost") + n = notify2.Notification(None) + n.set_urgency(notify2.URGENCY_NORMAL) + n.set_timeout(10000) +except: + # To-Do: log the error + # print t() + bcolors.RED + " Error displaying the notifications. [can be ignored]" + bcolors.ENDC + pass def notify(text): @@ -126,7 +131,7 @@ def notify(text): n.show() except: # ignore if any notification related errors - return + pass signal.signal(signal.SIGINT, sigint_handler)