commit
7322539d82
|
@ -302,5 +302,6 @@ class RecognizerLoop(pyee.EventEmitter):
|
|||
while self.state.running:
|
||||
try:
|
||||
time.sleep(1)
|
||||
except KeyboardInterrupt:
|
||||
except KeyboardInterrupt as e:
|
||||
logger.error(e)
|
||||
self.stop()
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
import time
|
||||
|
||||
import os
|
||||
from pocketsphinx.pocketsphinx import *
|
||||
from pocketsphinx.pocketsphinx import Decoder
|
||||
|
||||
__author__ = 'seanfitz, jdorleans'
|
||||
|
||||
|
|
|
@ -109,6 +109,7 @@ def main():
|
|||
try:
|
||||
loop.run()
|
||||
except KeyboardInterrupt, e:
|
||||
logger.exception(e)
|
||||
event_thread.exit()
|
||||
sys.exit()
|
||||
|
||||
|
|
|
@ -62,6 +62,7 @@ def main():
|
|||
Message("recognizer_loop:utterance",
|
||||
metadata={'utterances': [line.strip()]}))
|
||||
except KeyboardInterrupt, e:
|
||||
logger.exception(e)
|
||||
event_thread.exit()
|
||||
sys.exit()
|
||||
|
||||
|
|
|
@ -15,9 +15,8 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with Mycroft Core. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
import tornado.ioloop
|
||||
import tornado.web
|
||||
import tornado.ioloop as ioloop
|
||||
import tornado.web as web
|
||||
|
||||
from mycroft.messagebus.service.ws import WebsocketEventHandler
|
||||
from mycroft.configuration.config import ConfigurationManager
|
||||
|
@ -40,11 +39,11 @@ def main():
|
|||
(service_config.get('route'), WebsocketEventHandler)
|
||||
]
|
||||
|
||||
application = tornado.web.Application(routes, **settings)
|
||||
application = web.Application(routes, **settings)
|
||||
|
||||
application.listen(service_config.get("port"), service_config.get("host"))
|
||||
ioloop = tornado.ioloop.IOLoop.instance()
|
||||
ioloop.start()
|
||||
loop = ioloop.IOLoop.instance()
|
||||
loop.start()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
@ -54,6 +54,7 @@ class WebsocketEventHandler(tornado.websocket.WebSocketHandler):
|
|||
self.emitter.emit(
|
||||
deserialized_message.message_type, deserialized_message)
|
||||
except Exception, e:
|
||||
logger.exception(e)
|
||||
traceback.print_exc(file=sys.stdout)
|
||||
pass
|
||||
|
||||
|
|
|
@ -19,9 +19,12 @@
|
|||
from adapt.engine import IntentDeterminationEngine
|
||||
from mycroft.messagebus.message import Message
|
||||
from mycroft.skills.core import open_intent_envelope, MycroftSkill
|
||||
from mycroft.util.log import getLogger
|
||||
|
||||
__author__ = 'seanfitz'
|
||||
|
||||
logger = getLogger(__name__)
|
||||
|
||||
|
||||
class IntentSkill(MycroftSkill):
|
||||
def __init__(self):
|
||||
|
@ -45,6 +48,7 @@ class IntentSkill(MycroftSkill):
|
|||
# TODO - Should Adapt handle this?
|
||||
best_intent['utterance'] = utterance
|
||||
except StopIteration, e:
|
||||
logger.exception(e)
|
||||
continue
|
||||
|
||||
if best_intent and best_intent.get('confidence', 0.0) > 0.0:
|
||||
|
|
|
@ -71,8 +71,8 @@ class OWM25(owm.OWM):
|
|||
def _assert_is_string(name, value):
|
||||
try:
|
||||
# Python 2.x
|
||||
assert(isinstance(value, basestring),
|
||||
"'%s' must be a str" % (name,))
|
||||
assert isinstance(value, basestring), \
|
||||
("'%s' must be a str" % (name,))
|
||||
except NameError:
|
||||
# Python 3.x
|
||||
assert isinstance(value, str), "'%s' must be a str" % (name,)
|
||||
|
|
|
@ -131,6 +131,7 @@ class WolframAlphaSkill(MycroftSkill):
|
|||
self.speak_dialog('not.paired')
|
||||
return
|
||||
except Exception as e:
|
||||
logger.exception(e)
|
||||
self.speak("Sorry, I don't understand your request.")
|
||||
return
|
||||
|
||||
|
|
|
@ -20,11 +20,13 @@ import os
|
|||
import subprocess
|
||||
from setuptools import find_packages
|
||||
import shutil
|
||||
from mycroft.util.log import getLogger
|
||||
|
||||
|
||||
__author__ = 'seanfitz'
|
||||
|
||||
BASEDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
|
||||
logger = getLogger(__name__)
|
||||
|
||||
|
||||
def place_manifest(manifest_file):
|
||||
|
@ -36,12 +38,14 @@ def get_version():
|
|||
try:
|
||||
import mycroft.__version__
|
||||
version = mycroft.__version__.version
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
try:
|
||||
version = "dev-" + subprocess.check_output(
|
||||
["git", "rev-parse", "--short", "HEAD"]).strip()
|
||||
except subprocess.CalledProcessError, e2:
|
||||
version = "development"
|
||||
logger.debug(e)
|
||||
logger.exception(e2)
|
||||
|
||||
return version
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import json
|
||||
import unittest
|
||||
from pyee import EventEmitter
|
||||
from mycroft.messagebus.message import Message
|
||||
from mycroft.skills.core import load_skills
|
||||
|
|
Loading…
Reference in New Issue