First Refactoring

- Major API Changes in Core Module
- Will be changed further. Still work in progress
This commit is contained in:
Manuel83
2017-09-21 00:03:33 +02:00
parent bf3fbddbe2
commit 42ed9f02af
50 changed files with 3031 additions and 3216 deletions
+31
View File
@@ -0,0 +1,31 @@
import json
from flask_classy import FlaskView, route
from modules.core.core import cbpi
class ActionView(FlaskView):
@route('/<action>', methods=['POST'])
def action(self, action):
"""
Call global action button
---
tags:
- action
responses:
200:
description: action invoked
"""
print self.cbpi.cache["actions"]
self.cbpi.cache["actions"][action]["function"](self.cbpi)
return ('',204)
@cbpi.addon.core.initializer()
def init(cbpi):
"""
Initializer for the message module
:param app: the flask app
:return: None
"""
ActionView.cbpi = cbpi
ActionView.register(cbpi._app, route_base='/api/action')