summaryrefslogtreecommitdiff
path: root/jasper.py
diff options
context:
space:
mode:
Diffstat (limited to 'jasper.py')
-rwxr-xr-xjasper.py21
1 files changed, 8 insertions, 13 deletions
diff --git a/jasper.py b/jasper.py
index 7e84cd2..a04216d 100755
--- a/jasper.py
+++ b/jasper.py
@@ -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 "==========================================================="