# HG changeset patch # User Teemu Piippo # Date 1559684030 -10800 # Node ID 15c95d3fcfd820e7a5a31b7c9a4bc24e41fc7c63 # Parent b8fac2477fc8f6725133e5876a8a1a2b190ea316 show the filename of the processed file in the report diff -r b8fac2477fc8 -r 15c95d3fcfd8 templates/webfront.html --- a/templates/webfront.html Tue Jun 04 23:58:30 2019 +0300 +++ b/templates/webfront.html Wed Jun 05 00:33:50 2019 +0300 @@ -16,25 +16,26 @@
{% if report %} - +

{{name}}

+ {% if report['problems'] %} + + {% else %} + No problems whatsoever. + {% endif %} {% endif %} -{% if report and not report['problems'] %} -No problems whatsoever. -{% endif %} -
diff -r b8fac2477fc8 -r 15c95d3fcfd8 webfront.py --- a/webfront.py Tue Jun 04 23:58:30 2019 +0300 +++ b/webfront.py Wed Jun 05 00:33:50 2019 +0300 @@ -13,13 +13,14 @@ if 'file' not in request.files or not request.files['file'].filename: return redirect(request.url) file = request.files['file'] + filename = file.filename config = load_config('ldcheck.cfg') for ldconfig_ldr_path in find_ldconfig_ldr_paths(config): with ldconfig_ldr_path.open() as ldconfig_ldr: load_colours(ldconfig_ldr) model = read_ldraw( file.stream, - name = file.filename, + name = filename, ldraw_directories = config['libraries'], ) test_suite = load_tests() @@ -32,8 +33,10 @@ problem['ldraw-code'] = object.textual_representation() else: report = None + filename = None return render_template('webfront.html', report = report, + name = filename ) @app.route('/static/')