Fixed program crash if OS doesn't support baloon notification

This commit is contained in:
Rinaldus 2017-11-16 16:25:23 +03:00
parent 66020b44a5
commit b04cb9a6ff
Signed by: Rinaldus
GPG Key ID: C34E249005178E87
1 changed files with 7 additions and 4 deletions

View File

@ -22,7 +22,7 @@ from datetime import datetime, date, time
#variables
programTitle = "Mail Notifier"
programVersion = "3.01"
programVersion = "3.01-dev"
settings = QSettings(os.path.expanduser("~")+"/.config/mail-notifier/settings.conf", QSettings.NativeFormat)
def GlobalSettingsExist():
if ((settings.contains("CheckInterval") and settings.value("CheckInterval") != "") and
@ -438,9 +438,12 @@ def mail_check():
# check was successfull, lastCheckCount is updating
window.lastCheckCount = mail_count
def notify(message):
if settings.value("Notify"):
subprocess.Popen(['notify-send', programTitle, message])
return
try:
if settings.value("Notify"):
subprocess.Popen(['notify-send', programTitle, message])
return
except:
print(message)