From cc14dd210c4522d18cbfa56e097e7105eee12b60 Mon Sep 17 00:00:00 2001 From: MrTyton Date: Wed, 23 Aug 2017 02:57:49 -0400 Subject: [PATCH] Fixed pass statements that were literally doing nothing. --- runner_notify.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/runner_notify.py b/runner_notify.py index b3347a1..a23ba76 100644 --- a/runner_notify.py +++ b/runner_notify.py @@ -15,16 +15,23 @@ from ConfigParser import ConfigParser def enable_notifications(options): if options.pushbullet: - pb = Pushbullet(options.pushbullet) - if options.pbdevice: + fail = False + try: + pb = Pushbullet(options.pushbullet) + except: + print "Problem wtih connecting to pushbullet. API Key likely invalid" + fail = True + if options.pbdevice and not fail: try: pb = pb.get_device(options.pbdevice) except: print "Cannot get this device." + fail = True pass - temp_note = Notification() - temp_note.send_notification = pb.push_note - yield temp_note + if not fail: + temp_note = Notification() + temp_note.send_notification = pb.push_note + yield temp_note if options.notify: notary = Notification()