|
@@ -1,9 +1,15 @@
|
|
|
|
+# coding: utf8
|
|
|
|
+
|
|
import logging
|
|
import logging
|
|
|
|
|
|
|
|
+import sys
|
|
|
|
+
|
|
|
|
+import signal
|
|
from dialog import Dialog
|
|
from dialog import Dialog
|
|
import locale
|
|
import locale
|
|
|
|
|
|
from core import OrderListener
|
|
from core import OrderListener
|
|
|
|
+from core.Utils import Utils
|
|
from core.ConfigurationManager import SettingLoader
|
|
from core.ConfigurationManager import SettingLoader
|
|
from neurons import Say
|
|
from neurons import Say
|
|
|
|
|
|
@@ -11,6 +17,14 @@ logging.basicConfig()
|
|
logger = logging.getLogger("jarvis")
|
|
logger = logging.getLogger("jarvis")
|
|
|
|
|
|
|
|
|
|
|
|
+def signal_handler(signal, frame):
|
|
|
|
+ print "\n"
|
|
|
|
+ Utils.print_info("Ctrl+C pressed. Killing Jarvis")
|
|
|
|
+ sys.exit(0)
|
|
|
|
+
|
|
|
|
+signal.signal(signal.SIGINT, signal_handler)
|
|
|
|
+
|
|
|
|
+
|
|
class ShellGui:
|
|
class ShellGui:
|
|
def __init__(self):
|
|
def __init__(self):
|
|
# get settings
|
|
# get settings
|
|
@@ -91,14 +105,17 @@ class ShellGui:
|
|
# then go back to this menu with the same sentence
|
|
# then go back to this menu with the same sentence
|
|
self.show_tts_test_menu(sentence_to_test=sentence_to_test)
|
|
self.show_tts_test_menu(sentence_to_test=sentence_to_test)
|
|
|
|
|
|
- def _run_tts_test(self, tag, sentence_to_test):
|
|
|
|
|
|
+ def _run_tts_test(self, tts_name, sentence_to_test):
|
|
"""
|
|
"""
|
|
Call the TTS
|
|
Call the TTS
|
|
- :param tag:
|
|
|
|
|
|
+ :param tts_name: Name of the TTS module to launch
|
|
:param sentence_to_test:
|
|
:param sentence_to_test:
|
|
:return:
|
|
:return:
|
|
"""
|
|
"""
|
|
- Say(message=sentence_to_test, tts=tag)
|
|
|
|
|
|
+ print type(sentence_to_test)
|
|
|
|
+ sentence_to_test = sentence_to_test.encode('utf-8')
|
|
|
|
+ print type(sentence_to_test)
|
|
|
|
+ Say(message=sentence_to_test, tts=tts_name)
|
|
|
|
|
|
@staticmethod
|
|
@staticmethod
|
|
def _get_choices_tuple_from_list(list_to_convert):
|
|
def _get_choices_tuple_from_list(list_to_convert):
|