From b6376fb8f1379bebd3241f29e356eb0076adfcbd Mon Sep 17 00:00:00 2001 From: Robin ALEXANDER Date: Sat, 5 Feb 2022 22:19:42 +0100 Subject: Switch to Jinja2 from SimpleTemplate --- gui/odr-dabmux-gui.py | 5 +++-- gui/views/index.tpl | 22 +++++++++++----------- gui/views/rcparam.tpl | 18 +++++++++--------- 3 files changed, 23 insertions(+), 22 deletions(-) (limited to 'gui') diff --git a/gui/odr-dabmux-gui.py b/gui/odr-dabmux-gui.py index df6b81f..5a35007 100755 --- a/gui/odr-dabmux-gui.py +++ b/gui/odr-dabmux-gui.py @@ -29,7 +29,8 @@ from muxconfig import * from muxrc import * -from bottle import * +from bottle import route, run, request, static_file, jinja2_template as template +import jinja2 import json import argparse @@ -167,4 +168,4 @@ if __name__ == '__main__': paramStr = paramFile.read() paramObj = json.loads(paramStr) - run(host=cli_args.host, port=int(cli_args.port), debug=True, reloader=False) + run(host=cli_args.host, port=int(cli_args.port), debug=True, reloader=False) \ No newline at end of file diff --git a/gui/views/index.tpl b/gui/views/index.tpl index a554095..7d7f886 100644 --- a/gui/views/index.tpl +++ b/gui/views/index.tpl @@ -58,14 +58,14 @@ Label Short label - % for s in services: + {% for s in services %} {{s.name}} {{s.id}} {{s.label}} {{s.shortlabel}} - % end + {% endfor %}
@@ -77,14 +77,14 @@ Input file Bit rate (Kbps) - % for s in subchannels: + {% for s in subchannels %} {{s.name}} {{s.type}} {{s.inputfile}} {{s.bitrate}} - % end + {% endfor %}
@@ -98,7 +98,7 @@ Sub-channel Fig type - % for s in components: + {% for s in components %} {{s.name}} {{s.label}} @@ -107,22 +107,22 @@ {{s.subchannel}} {{s.figtype}} - % end + {% endfor %}


diff --git a/gui/views/rcparam.tpl b/gui/views/rcparam.tpl index c415d7a..369e8c9 100644 --- a/gui/views/rcparam.tpl +++ b/gui/views/rcparam.tpl @@ -14,21 +14,21 @@

- % if (len(list) == 0): + {% if not list %} - - % else: + + {% else %} - % end + {% endif %}

-- cgit v1.2.3