tidyed code some more, added reading ENV for other scripts, PEP8 some more
This commit is contained in:
parent
4d36e85f82
commit
0039227576
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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.")
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue