Selaa lähdekoodia

Merge 825ec90c6f into 291f09dcd1

pull/59/merge
Co de Waal GitHub 8 vuotta sitten
vanhempi
commit
e2086eeef4
1 muutettua tiedostoa jossa 18 lisäystä ja 0 poistoa
  1. +18
    -0
      modules/addon/endpoints.py

+ 18
- 0
modules/addon/endpoints.py Näytä tiedosto

@@ -14,6 +14,7 @@ import shutil

blueprint = Blueprint('addon', __name__)

user_yaml = None

modules = {}

@@ -137,6 +138,15 @@ def plugins():
for key, value in cbpi.cache["plugins"].iteritems():
value["installed"] = os.path.isdir("./modules/plugins/%s/" % (key))

user_yaml=cbpi.get_config_parameter("user_yaml", None)
if user_yaml is None:
pass
else:
response = requests.get(user_yaml)
cbpi.cache["plugins"] = merge(yaml.load(response.text), cbpi.cache["plugins"])
for key, value in cbpi.cache["plugins"].iteritems():
value["installed"] = os.path.isdir("./modules/plugins/%s/" % (key))

return json.dumps(cbpi.cache["plugins"])


@@ -195,4 +205,12 @@ def initPlugins(app):
@cbpi.initalizer(order=2)
def init(cbpi):

global user_yaml
user_yaml = cbpi.get_config_parameter("user_yaml", None)
if user_yaml is None:
try:
cbpi.add_config_parameter("user_yaml", "", "text", "User yaml http address")
except:
pass

cbpi.app.register_blueprint(blueprint, url_prefix='/api/editor')

Loading…
Peruuta
Tallenna