diff --git a/python/fucking_coffee.py b/python/fucking_coffee.py index c19572f..68827d8 100755 --- a/python/fucking_coffee.py +++ b/python/fucking_coffee.py @@ -6,8 +6,7 @@ import telnetlib import time # exit if no sessions with my username are found -output = subprocess.check_output('who') -if 'my_username' not in output: +if os.environ.get('USER') in subprocess.check_output('who'): sys.exit() coffee_machine_ip = '10.10.42.42' @@ -24,4 +23,4 @@ time.sleep(64) # love the smell! con.write("sys pour\n") -con.close() +con.close() diff --git a/python/hangover.py b/python/hangover.py index b28bfc6..fef8c54 100755 --- a/python/hangover.py +++ b/python/hangover.py @@ -7,9 +7,7 @@ from time import strftime import subprocess # exit if sessions with my username are found -output = subprocess.check_output('who') - -if os.environ.get('USER') in output: +if os.environ.get('USER') in subprocess.check_output('who'): sys.exit() # returns 'None' if the key doesn't exist diff --git a/python/kumar_asshole.py b/python/kumar_asshole.py index 36f5f67..96ebe55 100755 --- a/python/kumar_asshole.py +++ b/python/kumar_asshole.py @@ -19,4 +19,5 @@ pattern = re.compile("\bsorry\b | \bhelp\b | \bwrong\b ", flags=re.I) for msg in msgs: if pattern.match(msg.body): msg.label("Database fixes") - msg.reply("No problem. I've fixed it. \n\n Please be careful next time.") + msg.reply("No problem. I've fixed it. \n\n" + "Please be careful next time.") diff --git a/python/smack_my_bitch_up.py b/python/smack_my_bitch_up.py index 02c7e05..e4e90da 100755 --- a/python/smack_my_bitch_up.py +++ b/python/smack_my_bitch_up.py @@ -8,22 +8,21 @@ import sys from time import strftime # exit if no sessions with my username are found -output = subprocess.check_output('who') -if 'my_username' not in output: +if os.environ.get('USER') in subprocess.check_output('who'): sys.exit() # returns 'None' if the key doesn't exist TWILIO_ACCOUNT_SID = os.environ.get('TWILIO_ACCOUNT_SID') -TWILIO_AUTH_TOKEN = os.environ.get('TWILIO_AUTH_TOKEN') +TWILIO_AUTH_TOKEN = os.environ.get('TWILIO_AUTH_TOKEN') # Phone numbers -my_number = '+xxx' +my_number = '+xxx' her_number = '+xxx' reasons = [ - 'Working hard', - 'Gotta ship this feature', - 'Someone fucked the system again' + 'Working hard', + 'Gotta ship this feature', + 'Someone fucked the system again' ] client = TwilioRestClient(TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN)