2
0
mirror of https://github.com/narkoz/hacker-scripts synced 2025-08-23 10:57:13 +00:00

fix logic in hangover.py

closes #28
This commit is contained in:
Nihad Abbasov 2015-11-24 16:21:39 +04:00
parent 056e9ec84b
commit c6373cc762

View File

@ -13,9 +13,9 @@ today = datetime.date.today()
if today.strftime('%A') in ('Saturday', 'Sunday'): if today.strftime('%A') in ('Saturday', 'Sunday'):
sys.exit() sys.exit()
# exit if no sessions with my username are found # exit if sessions with my username are found
output = subprocess.check_output('who') output = subprocess.check_output('who')
if 'my_username' not in output: if 'my_username' in output:
sys.exit() sys.exit()
# returns 'None' if the key doesn't exist # returns 'None' if the key doesn't exist
@ -37,7 +37,7 @@ client = TwilioRestClient(TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN)
client.messages.create( client.messages.create(
to=number_of_boss, to=number_of_boss,
from=my_number, from_=my_number,
body="Gonna work from home. " + random.choice(excuses) body="Gonna work from home. " + random.choice(excuses)
) )