You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cms/index.py

159 lines
4.5 KiB
Python

2 years ago
__doc__ = """
arguments :
--config path of the configuration otherwise it will look for the default in the working directory
"""
from flask import Flask,render_template,send_from_directory,request
import flask
import transport
from transport import providers
import cms
import sys
import os
import json
import copy
from jinja2 import Environment, BaseLoader
_app = Flask(__name__)
@_app.route('/favicon.ico')
def favicon():
print ()
if uri not in _config['plugins'] :
_data = {}
_code = 404
else:
pointer = _config['plugins'][uri]
_data = pointer ()
_code = 200
return _data,_code
@_app.route('/version')
def _version ():
global _config
return _config['system']['version']
2 years ago
_path = SYS_ARGS['config'] if 'config' in SYS_ARGS else 'config.json'