Actor Action added

This commit is contained in:
Manuel83
2017-07-12 15:18:14 +02:00
parent fd5ac5ce77
commit 929db1df81
3 changed files with 54 additions and 45 deletions
+7
View File
@@ -60,6 +60,13 @@ class ActorView(BaseView):
t = self.api.socketio.start_background_task(target=self.toggleTimeJob, id=id, t=t)
return ('', 204)
@route('<int:id>/action/<method>', methods=["POST"])
def action(self, id, method):
cbpi.cache.get("actors").get(id).instance.__getattribute__(method)()
return ('', 204)
@cbpi.initalizer(order=1000)
def init(cbpi):
ActorView.register(cbpi.app, route_base='/api/actor')
+4 -2
View File
@@ -166,7 +166,9 @@ def update_addon(name):
def loadCorePlugins():
for filename in os.listdir("./modules/base_plugins"):
if filename.endswith(".py") or filename.endswith(".pyc"):
if os.path.isdir("./modules/base_plugins/"+filename) is False:
continue
try:
modules[filename] = import_module("modules.base_plugins.%s" % (filename))
@@ -178,7 +180,7 @@ def loadCorePlugins():
def loadPlugins():
for filename in os.listdir("./modules/plugins"):
if filename.endswith(".py") or filename.endswith(".pyc"):
if os.path.isdir("./modules/plugins/" + filename) is False:
continue
try:
modules[filename] = import_module("modules.plugins.%s" % (filename))
File diff suppressed because one or more lines are too long