diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2014-09-11 14:05:57 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2014-09-11 10:41:15 -0400 |
| commit | 52a30cae6fb11ceedfaa9cb252432a2801a2de6f (patch) | |
| tree | 58282c52c0e40cff92d6da943683dfc29e96dac2 /jasper.py | |
| parent | 330d23aaf13734e757e1b108be0a6a8720cde316 (diff) | |
| download | jasper-client-52a30cae6fb11ceedfaa9cb252432a2801a2de6f.tar.gz jasper-client-52a30cae6fb11ceedfaa9cb252432a2801a2de6f.zip | |
Moved all imports to the top and changed `--local` detection
Diffstat (limited to 'jasper.py')
| -rwxr-xr-x | jasper.py | 21 |
1 files changed, 8 insertions, 13 deletions
@@ -7,6 +7,14 @@ import traceback import shutil import yaml +from client import vocabcompiler, stt +from client import speaker as speak +from client.conversation import Conversation +if len(sys.argv) > 1 and "--local" in sys.argv[1:]: + from client.local_mic import Mic +else: + from client.mic import Mic + # Set $JASPER_HOME jasper_home = os.getenv("JASPER_HOME") if not jasper_home or not os.path.exists(jasper_home): @@ -34,8 +42,6 @@ else: path = "/usr/local/lib/" os.environ["PATH"] = path -from client import vocabcompiler -from client import speaker as speak speaker = speak.newSpeaker() def testConnection(): @@ -79,17 +85,6 @@ old_client = os.path.abspath(os.path.join(os.pardir, "old_client")) if os.path.exists(old_client): shutil.rmtree(old_client) -from client import stt -from client.conversation import Conversation - -def isLocal(): - return len(sys.argv) > 1 and sys.argv[1] == "--local" - -if isLocal(): - from client.local_mic import Mic -else: - from client.mic import Mic - if __name__ == "__main__": print "===========================================================" |
