diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2014-08-22 09:32:35 +0800 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2014-08-22 09:32:35 +0800 |
| commit | 0d4bb63b3727e44c973d167be0d82c4c062648f6 (patch) | |
| tree | 2cbdddfc90fef1c345582b576dd5c45da84f46d7 /client/populate.py | |
| parent | 71ac7e8d50a3bc9ee814f334b938cda336377d4f (diff) | |
| download | jasper-client-0d4bb63b3727e44c973d167be0d82c4c062648f6.tar.gz jasper-client-0d4bb63b3727e44c973d167be0d82c4c062648f6.zip | |
Minor style fixes: removed unused imports, commented-out code, etc.
Diffstat (limited to 'client/populate.py')
| -rw-r--r-- | client/populate.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/client/populate.py b/client/populate.py index dd5ca48..054366e 100644 --- a/client/populate.py +++ b/client/populate.py @@ -4,6 +4,7 @@ import yaml from pytz import timezone import feedparser + def run(): profile = {} @@ -49,7 +50,7 @@ def run(): def verifyLocation(place): feed = feedparser.parse('http://rss.wunderground.com/auto/rss_full/' + place) numEntries = len(feed['entries']) - if numEntries==0: + if numEntries == 0: return False else: print("Location saved as " + feed['feed']['description'][33:]) @@ -58,7 +59,7 @@ def run(): print( "\nLocation should be a 5-digit US zipcode (e.g., 08544). If you are outside the US, insert the name of your nearest big town/city. For weather requests.") location = raw_input("Location: ") - while location and (verifyLocation(location)==False): + while location and (verifyLocation(location) == False): print("Weather not found. Please try another location.") location = raw_input("Location: ") if location: @@ -83,25 +84,23 @@ def run(): response = raw_input("Please choose email (E) or text message (T): ") profile['prefers_email'] = (response == 'E') - stt_engines = { - "sphinx" : None, - "google" : "GOOGLE_SPEECH" + stt_engines = { + "sphinx": None, + "google": "GOOGLE_SPEECH" } response = raw_input( - "\nIf you would like to choose a specific STT engine, please specify which." + - "\nAvailable implementations: %s. (Press Enter to default to PocketSphinx): " % stt_engines.keys()) + "\nIf you would like to choose a specific STT engine, please specify which." + + "\nAvailable implementations: %s. (Press Enter to default to PocketSphinx): " % stt_engines.keys()) if (response in stt_engines): profile["stt_engine"] = response api_key_name = stt_engines[response] if api_key_name: key = raw_input("\nPlease enter your API key: ") - profile["keys"] = { api_key_name : key } + profile["keys"] = {api_key_name: key} else: print("Unrecognized STT engine. Available implementations: %s" % stt_engines.keys()) profile["stt_engine"] = "sphinx" - - # write to profile print("Writing to profile...") |
