git push origin master

Merge remote-tracking branch 'upstream/master'
pull/147/head
Jason Hines 2016-06-17 18:34:46 -04:00
commit 0308386fdb
12 changed files with 69 additions and 28 deletions

View File

@ -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

View File

@ -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()

View File

@ -1 +1 @@
0.1.2
0.1.3

View File

@ -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"

View File

@ -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)))

View File

@ -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):

Binary file not shown.

View File

@ -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

View File

@ -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 ;;

View File

@ -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)

View File

@ -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")

19
test/test_runner.py Normal file
View File

@ -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)