create arrays if not created in plugin
This commit is contained in:
parent
2027b73ba6
commit
28292b35b0
1 changed files with 4 additions and 0 deletions
|
@ -72,6 +72,8 @@ class Plugin(object):
|
||||||
for interval, function in self.module.crontable:
|
for interval, function in self.module.crontable:
|
||||||
self.jobs.append(Job(interval, eval("self.module."+function)))
|
self.jobs.append(Job(interval, eval("self.module."+function)))
|
||||||
print self.module.crontable
|
print self.module.crontable
|
||||||
|
else:
|
||||||
|
self.module.crontable = []
|
||||||
def do(self, function_name, data):
|
def do(self, function_name, data):
|
||||||
if function_name in dir(self.module):
|
if function_name in dir(self.module):
|
||||||
try:
|
try:
|
||||||
|
@ -89,6 +91,8 @@ class Plugin(object):
|
||||||
output.append(self.module.outputs.pop(0))
|
output.append(self.module.outputs.pop(0))
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
else:
|
||||||
|
self.module.outputs = []
|
||||||
return output
|
return output
|
||||||
|
|
||||||
class Job(object):
|
class Job(object):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue