Merge branch 'master' into feature/deb-packaging
commit
a5a5e5f6f4
|
@ -22,7 +22,7 @@ The following guidelines for contribution should be followed if you want to subm
|
||||||
5. Make use of the `.editorconfig`-file if provided with the repository.
|
5. Make use of the `.editorconfig`-file if provided with the repository.
|
||||||
6. Make commits of logical units and describe them properly. Use your issue identifier at the very begin of each commit. For instance:
|
6. Make commits of logical units and describe them properly. Use your issue identifier at the very begin of each commit. For instance:
|
||||||
`git commit -m "Issues-123 - Fixing 'A' sound on Spelling Skill"`
|
`git commit -m "Issues-123 - Fixing 'A' sound on Spelling Skill"`
|
||||||
7. Before committing, format your code following the PEP8 rules and organize your imports removing unused libs.
|
7. Before committing, format your code following the PEP8 rules and organize your imports removing unused libs. To check whether you are following these rules, install pep8 and run `pep8 mycroft test` while in the `mycroft-core` folder. This will check for formatting issues in the `mycroft` and `test` folders.
|
||||||
8. Once you have committed everything and are done with your branch, you have to rebase your code with master. Do the following steps:
|
8. Once you have committed everything and are done with your branch, you have to rebase your code with master. Do the following steps:
|
||||||
1. Make sure you do not have any changes left on your branch
|
1. Make sure you do not have any changes left on your branch
|
||||||
2. Checkout on master branch and make sure it is up-to-date
|
2. Checkout on master branch and make sure it is up-to-date
|
||||||
|
@ -39,10 +39,10 @@ git rebase master
|
||||||
git push -f
|
git push -f
|
||||||
```
|
```
|
||||||
9. If possible, create unit tests for your changes
|
9. If possible, create unit tests for your changes
|
||||||
* [Unit Tests for most contributions](https://github.com/MycroftAI/mycroft/tree/master/test)
|
* [Unit Tests for most contributions](https://github.com/MycroftAI/mycroft-core/tree/master/test)
|
||||||
* [Intent Tests for new skills](https://github.com/MycroftAI/mycroft/tree/master/mycroft/skills/weather)
|
* [Intent Tests for new skills](https://docs.mycroft.ai/development/creating-a-skill#testing-your-skill)
|
||||||
* We utilize TRAVIS-CI, which will test each pull request. To test locally you can run: `./start.sh unittest`
|
* We utilize TRAVIS-CI, which will test each pull request. To test locally you can run: `./start.sh unittest`
|
||||||
10. Once everything is OK, you can finally create a Pull Request (PR) on Github in order to be reviewed and merged (to provide GH wiki page link)
|
10. Once everything is OK, you can finally [create a Pull Request (PR) on Github](https://help.github.com/articles/using-pull-requests/) in order to be reviewed and merged.
|
||||||
|
|
||||||
**Note**: Even if you have write access to the master branch, do not work directly on master!
|
**Note**: Even if you have write access to the master branch, do not work directly on master!
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ class CerberusWolframAlphaClient(object):
|
||||||
response = requests.get(url, headers=headers)
|
response = requests.get(url, headers=headers)
|
||||||
if response.status_code == 401:
|
if response.status_code == 401:
|
||||||
raise CerberusAccessDenied()
|
raise CerberusAccessDenied()
|
||||||
# logger.debug(response.content)
|
logger.debug(response.content)
|
||||||
return wolframalpha.Result(StringIO(response.content))
|
return wolframalpha.Result(StringIO(response.content))
|
||||||
|
|
||||||
|
|
||||||
|
@ -179,9 +179,9 @@ class WolframAlphaSkill(MycroftSkill):
|
||||||
self.speak("Sorry, I don't understand your request.")
|
self.speak("Sorry, I don't understand your request.")
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def __find_value(pods, pod_title):
|
def __find_value(pods, pod_id):
|
||||||
for pod in pods:
|
for pod in pods:
|
||||||
if pod.title == pod_title:
|
if pod.id == pod_id:
|
||||||
return pod.text
|
return pod.text
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ pyee==1.0.1
|
||||||
SpeechRecognition==3.1.3
|
SpeechRecognition==3.1.3
|
||||||
tornado==4.2.1
|
tornado==4.2.1
|
||||||
websocket-client==0.32.0
|
websocket-client==0.32.0
|
||||||
adapt-parser==0.2.2
|
adapt-parser==0.2.3
|
||||||
pyowm==2.2.1
|
pyowm==2.2.1
|
||||||
wolframalpha==1.4
|
wolframalpha==1.4
|
||||||
futures==3.0.3
|
futures==3.0.3
|
||||||
|
|
|
@ -15,13 +15,13 @@ logger = getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class WolframAlphaTest(unittest.TestCase):
|
class WolframAlphaTest(unittest.TestCase):
|
||||||
def format_result(self, pod_title, text):
|
def format_result(self, pod_id, text):
|
||||||
return "<queryresult>\
|
return "<queryresult>\
|
||||||
<pod title='" + pod_title + "'><subpod>\
|
<pod id='" + pod_id + "' title = '" + pod_id + "'><subpod>\
|
||||||
<plaintext>" + text + "</plaintext></subpod></pod></queryresult>"
|
<plaintext>" + text + "</plaintext></subpod></pod></queryresult>"
|
||||||
|
|
||||||
def create_result(self, pod_title, value):
|
def create_result(self, pod_id, value):
|
||||||
result = self.format_result(pod_title, value)
|
result = self.format_result(pod_id, value)
|
||||||
return wolframalpha.Result(StringIO(result))
|
return wolframalpha.Result(StringIO(result))
|
||||||
|
|
||||||
def test_result_pod(self):
|
def test_result_pod(self):
|
||||||
|
|
Loading…
Reference in New Issue