diff --git a/mycroft-base-MANIFEST.in b/mycroft-base-MANIFEST.in index ee521c92dc..8cb2c2fdc9 100644 --- a/mycroft-base-MANIFEST.in +++ b/mycroft-base-MANIFEST.in @@ -1,6 +1,7 @@ recursive-include mycroft/client/speech/model * include requirements.txt -include mycroft/configuration/defaults/*.ini +include mycroft/configuration/*.ini recursive-include mycroft/skills/*/dialog * recursive-include mycroft/skills/*/vocab * include mycroft/skills/alarm/alarm.mp3 +include mycroft/tts/mycroft_voice_4.0.flitevox diff --git a/mycroft/client/enclosure/enclosure.py b/mycroft/client/enclosure/enclosure.py index 765b4c87e5..de27359c76 100644 --- a/mycroft/client/enclosure/enclosure.py +++ b/mycroft/client/enclosure/enclosure.py @@ -30,6 +30,7 @@ from mycroft.messagebus.client.ws import WebsocketClient from mycroft.messagebus.message import Message from mycroft.util import kill from mycroft.util.log import getLogger +from mycroft.skills.volume import VolumeSkill __author__ = 'aatchison + jdorleans' @@ -74,6 +75,12 @@ class EnclosureReader(Thread): self.client.emit(Message("mycroft.stop")) kill(['mimic']) # TODO - Refactoring in favor of Mycroft Stop + if "volume.up" in data: + self.client.emit(Message("IncreaseVolumeIntent")) + + if "volume.down" in data: + self.client.emit(Message("DecreaseVolumeIntent")) + def stop(self): self.alive = False self.join() diff --git a/mycroft/client/enclosure/version.txt b/mycroft/client/enclosure/version.txt index 8294c18436..7693c96bff 100644 --- a/mycroft/client/enclosure/version.txt +++ b/mycroft/client/enclosure/version.txt @@ -1 +1 @@ -0.1.2 \ No newline at end of file +0.1.3 \ No newline at end of file diff --git a/mycroft/configuration/mycroft.ini b/mycroft/configuration/mycroft.ini index 798df330ff..9979ce1260 100644 --- a/mycroft/configuration/mycroft.ini +++ b/mycroft/configuration/mycroft.ini @@ -50,7 +50,7 @@ session_ttl_seconds = 180 [tts] module = "mimic" -mimic.voice = "rms" +mimic.voice = "mycroft/tts/mycroft_voice_4.0.flitevox" espeak.lang = "english-us" espeak.voice = "m1" diff --git a/mycroft/skills/ip_skill/__init__.py b/mycroft/skills/ip_skill/__init__.py index b3c682eb8d..6ffb08f08b 100644 --- a/mycroft/skills/ip_skill/__init__.py +++ b/mycroft/skills/ip_skill/__init__.py @@ -17,11 +17,15 @@ from os.path import dirname, join +import re from netifaces import interfaces, ifaddresses, AF_INET from adapt.intent import IntentBuilder from mycroft.skills.core import MycroftSkill +from mycroft.util.log import getLogger + +logger = getLogger(__name__) __author__ = 'ryanleesipes' @@ -42,8 +46,13 @@ class IPSkill(MycroftSkill): addresses = [ i['addr'] for i in ifaddresses(ifaceName).setdefault( - AF_INET, [{'addr': 'No IP addr'}])] - if ifaceName != "lo": + AF_INET, [{'addr': None}])] + if None in addresses: + addresses.remove(None) + if addresses and ifaceName != "lo": + addresses = [re.sub(r"\.", r" dot ", address) + for address in addresses] + logger.debug(addresses[0]) self.speak('%s: %s' % ( "interface: " + ifaceName + ", I.P. Address ", ', '.join(addresses))) diff --git a/mycroft/skills/wolfram_alpha/__init__.py b/mycroft/skills/wolfram_alpha/__init__.py index 750bca31fa..08b1bbdfe2 100644 --- a/mycroft/skills/wolfram_alpha/__init__.py +++ b/mycroft/skills/wolfram_alpha/__init__.py @@ -171,7 +171,9 @@ class WolframAlphaSkill(MycroftSkill): if "|" in result: # Assuming "|" indicates a list of items verb = ":" - result = self.__process_wolfram_string(result) + result = self.process_wolfram_string(result) + input_interpretation = \ + self.process_wolfram_string(input_interpretation) response = "%s %s %s" % (input_interpretation, verb, result) self.speak(response) @@ -186,12 +188,18 @@ class WolframAlphaSkill(MycroftSkill): return None @staticmethod - def __process_wolfram_string(text): + def process_wolfram_string(text): # Remove extra whitespace text = re.sub(r" \s+", r" ", text) # Convert | symbols to commas text = re.sub(r" \| ", r", ", text) + + # Convert newlines to commas + text = re.sub(r"\n", r", ", text) + + # Convert !s to factorial + text = re.sub(r"!", r",factorial", text) return text def stop(self): diff --git a/mycroft/tts/mycroft_voice_4.0.flitevox b/mycroft/tts/mycroft_voice_4.0.flitevox new file mode 100644 index 0000000000..2b591528d2 Binary files /dev/null and b/mycroft/tts/mycroft_voice_4.0.flitevox differ diff --git a/requirements.txt b/requirements.txt index a100ef6ca7..ae65d87681 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,7 +14,7 @@ pyee==1.0.1 SpeechRecognition==3.1.3 tornado==4.2.1 websocket-client==0.32.0 -adapt-parser==0.2.3 +adapt-parser==0.2.5 pyowm==2.2.1 wolframalpha==1.4 futures==3.0.3 diff --git a/start.sh b/start.sh index 88541d7527..5ca95af3d1 100755 --- a/start.sh +++ b/start.sh @@ -10,7 +10,7 @@ case $1 in "cli") SCRIPT=${TOP}/mycroft/client/text/cli.py ;; "audiotest") SCRIPT=${TOP}/mycroft/util/audio_test.py ;; "collector") SCRIPT=${TOP}/mycroft_data_collection/cli.py ;; - "unittest") SCRIPT=${TOP}/test/__init__.py ;; + "unittest") SCRIPT=${TOP}/test/test_runner.py ;; "sdkdoc") SCRIPT=${TOP}/doc/generate_sdk_docs.py ;; "enclosure") SCRIPT=${TOP}/mycroft/client/enclosure/enclosure.py ;; "pairing") SCRIPT=${TOP}/mycroft/pairing/client.py ;; diff --git a/test/__init__.py b/test/__init__.py index f6d84293dd..e69de29bb2 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -1,19 +0,0 @@ -import sys -import unittest - -from os.path import dirname -from xmlrunner import XMLTestRunner - -from mycroft.configuration import ConfigurationManager - -__author__ = 'seanfitz, jdorleans' - -fail_on_error = "--fail-on-error" in sys.argv -ConfigurationManager.load_local(['mycroft.ini']) - -tests = unittest.TestLoader().discover(dirname(__file__), "*.py") -runner = XMLTestRunner("./build/report/tests") -result = runner.run(tests) - -if fail_on_error and len(result.failures + result.errors) > 0: - sys.exit(1) diff --git a/test/skills/wolfram_alpha/__init__.py b/test/skills/wolfram_alpha/__init__.py index 2f04bd85d2..97d60495d0 100644 --- a/test/skills/wolfram_alpha/__init__.py +++ b/test/skills/wolfram_alpha/__init__.py @@ -48,3 +48,19 @@ class WolframAlphaTest(unittest.TestCase): def test_invalid_pod(self): res = self.create_result("InvalidTitle", "Test") self.assertEquals(WolframAlphaSkill().get_result(res), None) + + def test_whitespace_process(self): + self.assertEquals(WolframAlphaSkill().process_wolfram_string + ("Test string"), "Test string") + + def test_pipe_process(self): + self.assertEquals(WolframAlphaSkill().process_wolfram_string + ("Test | string"), "Test, string") + + def test_newline_process(self): + self.assertEquals(WolframAlphaSkill().process_wolfram_string + ("Test\nstring"), "Test, string") + + def test_factorial_process(self): + self.assertEquals(WolframAlphaSkill().process_wolfram_string + ("Test!"), "Test,factorial") diff --git a/test/test_runner.py b/test/test_runner.py new file mode 100644 index 0000000000..61dab19d78 --- /dev/null +++ b/test/test_runner.py @@ -0,0 +1,19 @@ +import sys +import unittest + +from os.path import dirname +from xmlrunner import XMLTestRunner + +from mycroft.configuration import ConfigurationManager + +__author__ = 'seanfitz, jdorleans' +if __name__ == "__main__": + fail_on_error = "--fail-on-error" in sys.argv + ConfigurationManager.load_local(['mycroft.ini']) + + tests = unittest.TestLoader().discover(dirname(__file__), "*.py") + runner = XMLTestRunner("./build/report/tests") + result = runner.run(tests) + + if fail_on_error and len(result.failures + result.errors) > 0: + sys.exit(1)