Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #60 from MycroftAI/bugfix/issues-18
Browse files Browse the repository at this point in the history
Bugfix/issues 18
  • Loading branch information
aatchison committed May 27, 2016
2 parents 774882e + fd1f32e commit 7322539
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 12 deletions.
3 changes: 2 additions & 1 deletion mycroft/client/speech/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,5 +302,6 @@ def run(self):
while self.state.running:
try:
time.sleep(1)
except KeyboardInterrupt:
except KeyboardInterrupt as e:
logger.error(e)
self.stop()
2 changes: 1 addition & 1 deletion mycroft/client/speech/local_recognizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import time

import os
from pocketsphinx.pocketsphinx import *
from pocketsphinx.pocketsphinx import Decoder

__author__ = 'seanfitz, jdorleans'

Expand Down
1 change: 1 addition & 0 deletions mycroft/client/speech/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def main():
try:
loop.run()
except KeyboardInterrupt, e:
logger.exception(e)
event_thread.exit()
sys.exit()

Expand Down
1 change: 1 addition & 0 deletions mycroft/client/text/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
11 changes: 5 additions & 6 deletions mycroft/messagebus/service/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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__":
Expand Down
1 change: 1 addition & 0 deletions mycroft/messagebus/service/ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def on_message(self, message):
self.emitter.emit(
deserialized_message.message_type, deserialized_message)
except Exception, e:
logger.exception(e)
traceback.print_exc(file=sys.stdout)
pass

Expand Down
4 changes: 4 additions & 0 deletions mycroft/skills/intent/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -45,6 +48,7 @@ def handle_utterance(self, message):
# 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:
Expand Down
4 changes: 2 additions & 2 deletions mycroft/skills/weather/owm_repackaged/owm25.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ def __init__(self, parsers, API_key=None, cache=nullcache.NullCache(),
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,)
Expand Down
1 change: 1 addition & 0 deletions mycroft/skills/wolfram_alpha/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def handle_fallback(self, message):
self.speak_dialog('not.paired')
return
except Exception as e:
logger.exception(e)
self.speak("Sorry, I don't understand your request.")
return

Expand Down
6 changes: 5 additions & 1 deletion mycroft/util/setup_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@
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):
Expand All @@ -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

Expand Down
1 change: 0 additions & 1 deletion test/skills/skill_tester.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 7322539

Please sign in to comment.