|      1 #!/usr/bin/env python3 | 
     1 #!/usr/bin/env python3 | 
|      2 from flask import Flask, render_template, redirect, request | 
     2 from flask import Flask, render_template, redirect, request | 
|      3 from ldcheck import load_config, load_colours, find_ldconfig_ldr_paths | 
     3 from ldcheck import load_config, load_colours, find_ldconfig_ldr_paths | 
|      4 from ldcheck import read_ldraw | 
     4 from parse import read_ldraw | 
|      5 from testsuite import load_tests, check_model, problem_text | 
     5 from testsuite import load_tests, check_model, problem_text | 
|      6  | 
     6  | 
|      7 app = Flask('LDCheck') | 
     7 app = Flask('LDCheck') | 
|      8  | 
     8  | 
|      9 @app.route('/', methods = ['GET', 'POST']) | 
     9 @app.route('/', methods = ['GET', 'POST']) | 
|     18             with ldconfig_ldr_path.open() as ldconfig_ldr: | 
    18             with ldconfig_ldr_path.open() as ldconfig_ldr: | 
|     19                 load_colours(ldconfig_ldr) | 
    19                 load_colours(ldconfig_ldr) | 
|     20         model = read_ldraw( | 
    20         model = read_ldraw( | 
|     21             file.stream, | 
    21             file.stream, | 
|     22             name = file.filename, | 
    22             name = file.filename, | 
|     23             config = config, | 
    23             ldraw_directories = config['libraries'], | 
|     24         ) | 
    24         ) | 
|     25         test_suite = load_tests() | 
    25         test_suite = load_tests() | 
|     26         report = check_model(model, test_suite) | 
    26         report = check_model(model, test_suite) | 
|     27  | 
    27  | 
|     28         # Amend human-readable messages into the report | 
    28         # Amend human-readable messages into the report |