Fix merge issues regarding web front

Thu, 26 Aug 2021 19:54:15 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Thu, 26 Aug 2021 19:54:15 +0300
changeset 151
e4401bf4a387
parent 150
fcc07f6907a8
child 152
5e347a96869a

Fix merge issues regarding web front

webfront.py file | annotate | diff | comparison | revisions
--- a/webfront.py	Thu Aug 26 19:49:55 2021 +0300
+++ b/webfront.py	Thu Aug 26 19:54:15 2021 +0300
@@ -1,14 +1,22 @@
 #!/usr/bin/env python3
+import argparse, sys
 from flask import Flask, render_template, redirect, request
 from ldcheck import appname, version, version_string
+from ldcheck import load_rcfile, postprocess_library_paths
 from parse import read_ldraw
 from testsuite import load_tests, check_model, problem_text, all_problem_types
 
+parser = argparse.ArgumentParser()
+parser.add_argument('-l', '--library', action = 'append')
+parser.add_argument('--color', action = 'store_true')
+args = parser.parse_args(load_rcfile() + sys.argv[1:])
+libraries = postprocess_library_paths(args.library)
+
 app = Flask(appname)
 
 from ldcheck import LDrawContext
 try:
-    context = LDrawContext()
+    context = LDrawContext(libraries = libraries)
 except RuntimeError as error:
     from sys import stderr, exit
     print('error:', str(error), file = stderr)

mercurial