fix variable scope
This commit is contained in:
parent
b5764124ca
commit
551114e9f6
|
@ -16,8 +16,8 @@ class RunScriptSkill(MycroftSkill):
|
||||||
self.read_scripts_dir()
|
self.read_scripts_dir()
|
||||||
|
|
||||||
def read_scripts_dir(self):
|
def read_scripts_dir(self):
|
||||||
if os.path.isdir(self.script_dir):
|
if self.script_dir and os.path.isdir(self.script_dir):
|
||||||
self.scripts = os.listdir(script_dir)
|
self.scripts = os.listdir(self.script_dir)
|
||||||
else:
|
else:
|
||||||
self.log.critical("The script_dir directory does not exist or can't be read")
|
self.log.critical("The script_dir directory does not exist or can't be read")
|
||||||
self.scripts = []
|
self.scripts = []
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"name": "script_dir",
|
"name": "script_dir",
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"label": "Directory containing scripts",
|
"label": "Directory containing scripts",
|
||||||
"value": "/home/pi/scripts"
|
"value": "/home/mycroft/scripts"
|
||||||
}]
|
}]
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue