Skip to content

Commit

Permalink
Making it so you can have no credentials file in your directory, in w…
Browse files Browse the repository at this point in the history
…hich case it will prompt you
  • Loading branch information
Mike Krieger committed Jul 31, 2009
1 parent 9e15132 commit ec9ff6a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion prowlgooglevoice.py
@@ -1,3 +1,5 @@
from getpass import getpass
from os import path
from googlevoicenotify import GoogleVoiceNotify
from time import sleep

Expand All @@ -16,7 +18,11 @@ def on_notification(self, event, name, message):
if __name__ == '__main__':
prowl_listener = ProwlListener()
print_listener = PrintListener()
name, passwd = file("credentials", "r").read().split()
if path.exists("credentials"):
name, passwd = file("credentials", "r").read().split()
else:
name = raw_input('Google username: ')
passwd = getpass('Password: ')
sleep_time = 60
gv = GoogleVoiceNotify(name, passwd, listeners=(prowl_listener, print_listener))
while True:
Expand Down

0 comments on commit ec9ff6a

Please sign in to comment.