commit
						0308386fdb
					
				| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1 +1 @@
 | 
			
		|||
0.1.2
 | 
			
		||||
0.1.3
 | 
			
		||||
| 
						 | 
				
			
			@ -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"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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)))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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.
										
									
								
							| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								start.sh
								
								
								
								
							
							
						
						
									
										2
									
								
								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 ;;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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)
 | 
			
		||||
| 
						 | 
				
			
			@ -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")
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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)
 | 
			
		||||
		Loading…
	
		Reference in New Issue