From c6373cc7625e879039c37b37a2d23f1cd2405f58 Mon Sep 17 00:00:00 2001 From: Nihad Abbasov Date: Tue, 24 Nov 2015 16:21:39 +0400 Subject: [PATCH] fix logic in hangover.py closes #28 --- python/hangover.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/hangover.py b/python/hangover.py index 77958f3..bf923d8 100755 --- a/python/hangover.py +++ b/python/hangover.py @@ -13,9 +13,9 @@ today = datetime.date.today() if today.strftime('%A') in ('Saturday', 'Sunday'): sys.exit() -# exit if no sessions with my username are found +# exit if sessions with my username are found output = subprocess.check_output('who') -if 'my_username' not in output: +if 'my_username' in output: sys.exit() # returns 'None' if the key doesn't exist @@ -37,7 +37,7 @@ client = TwilioRestClient(TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN) client.messages.create( to=number_of_boss, - from=my_number, + from_=my_number, body="Gonna work from home. " + random.choice(excuses) )