Browse Source

fix neuron loading from GUI

Nicolas Marcq 8 years ago
parent
commit
4c8503ef7c
3 changed files with 9 additions and 5 deletions
  1. 1 1
      core/ConfigurationManager/ConfigurationManager.py
  2. 3 2
      neurons/Neurone.py
  3. 5 2
      test.py

+ 1 - 1
core/ConfigurationManager/ConfigurationManager.py

@@ -132,7 +132,7 @@ class ConfigurationManager:
         # get args
         args = find(texts_to_speech, tts_name)
         logging.debug("Args for %s TTS: %s" % (tts_name, args))
-        print args
+        # print args
         return args
 
     @classmethod

+ 3 - 2
neurons/Neurone.py

@@ -2,6 +2,7 @@ import importlib
 from jinja2 import Template
 import random
 import os.path
+import logging
 
 from core import ConfigurationManager
 
@@ -93,8 +94,8 @@ class Neurone:
         self.tts_instance.say(words=message, **(self.tts_args if self.tts_args is not None else {}))
 
     def _get_tts_instance(self):
-        print "Import TTS module named %s " % self.tts
-        mod = __import__('tts', fromlist=[self.tts])
+        logging.info("Import TTS module named %s " % self.tts)
+        mod = __import__('tts', fromlist=[str(self.tts)])
         try:
             klass = getattr(mod, self.tts)
         except ImportError, e:

+ 5 - 2
test.py

@@ -10,6 +10,9 @@ import logging
 from core import ShellGui
 
 
-oa = OrderAnalyser("test heure")
+# oa = OrderAnalyser("test heure")
+#
+# oa.start()
 
-oa.start()
+
+Say(message="bonjour")