Skip to content

Commit

Permalink
Change script setting to custom mycroft.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
jhenriquez committed Feb 3, 2017
1 parent 8e62cd3 commit 970fc4d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,26 +163,26 @@ def handle_updtime_intent(self, message):
self.speak_dialog("uptime", data)

def handle_custom_intent(self, message):
if not self.diagnostic_script:
if not self.config.get("script"):
self.speak_dialog("no.script")
return

if not exists(self.diagnostic_script):
if not exists(self.config.get("script")):
data = {
"script": self.diagnostic_script
"script": self.config.get("script")
}
self.speak_dialog("missing.script", data)
return

if not is_exe(self.diagnostic_script):
if not is_exe(self.config.get("script")):
data = {
"script": self.diagnostic_script
"script": self.config.get("script")
}
self.speak_dialog("not.executable.script", data)
return

self.speak_dialog("processing.script")
result = subprocess.check_output([self.diagnostic_script])
result = subprocess.check_output([self.config.get("script")])
self.speak(result.strip())

def stop(self):
Expand Down

0 comments on commit 970fc4d

Please sign in to comment.