diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-09-24 19:42:01 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-09-24 20:47:08 +0200 |
commit | 5ad01f6415710521173e7a612b32c982847eada4 (patch) | |
tree | 4d4c8ca0a7ce0ff0f81702ee7bfad0b57c899929 /gui/run.py | |
parent | 5bb71419937a4d8919ef33df088f73e6c705b028 (diff) | |
download | dabmod-5ad01f6415710521173e7a612b32c982847eada4.tar.gz dabmod-5ad01f6415710521173e7a612b32c982847eada4.tar.bz2 dabmod-5ad01f6415710521173e7a612b32c982847eada4.zip |
gui: use json for all API answers
Diffstat (limited to 'gui/run.py')
-rwxr-xr-x | gui/run.py | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -32,6 +32,8 @@ import dpd env = Environment(loader=FileSystemLoader('templates')) +base_js = ["js/odr.js"] + class Root: def __init__(self, config_file): self.config_file = config_file @@ -47,31 +49,29 @@ class Root: @cherrypy.expose def about(self): tmpl = env.get_template("about.html") - js = [] - return tmpl.render(tab='about', js=js, is_login=False) + return tmpl.render(tab='about', js=base_js, is_login=False) @cherrypy.expose def home(self): tmpl = env.get_template("home.html") - js = [] - return tmpl.render(tab='home', js=js, is_login=False) + return tmpl.render(tab='home', js=base_js, is_login=False) @cherrypy.expose def rcvalues(self): tmpl = env.get_template("rcvalues.html") - js = ["js/odr-rcvalues.js"] + js = base_js + ["js/odr-rcvalues.js"] return tmpl.render(tab='rcvalues', js=js, is_login=False) @cherrypy.expose def modulator(self): tmpl = env.get_template("modulator.html") - js = ["js/odr-modulator.js"] + js = base_js + ["js/odr-modulator.js"] return tmpl.render(tab='modulator', js=js, is_login=False) @cherrypy.expose def predistortion(self): tmpl = env.get_template("predistortion.html") - js = ["js/odr-predistortion.js"] + js = base_js + ["js/odr-predistortion.js"] return tmpl.render(tab='predistortion', js=js, is_login=False) if __name__ == '__main__': @@ -93,10 +93,10 @@ if __name__ == '__main__': errorlog = os.path.realpath(os.path.join(config.config['global']['logs_directory'], 'error.log')) cherrypy.config.update({ + 'engine.autoreload.on': True, 'server.socket_host': config.config['global']['host'], 'server.socket_port': int(config.config['global']['port']), 'request.show_tracebacks' : True, - 'environment': 'production', 'tools.sessions.on': False, 'tools.encode.on': True, 'tools.encode.encoding': "utf-8", |