コード例 #1
0
ファイル: app.py プロジェクト: kikemascote/cfdi-vault
def stylesheets(filename):
    return static_file(filename, root='static/css')
コード例 #2
0
def picamera_takeshot(name = 0, x = 2592, y = 1980):
    if name != 0:
        photoname = application.capture(name, x, y)
        return static_file(photoname + '.jpg', root='img/', mimetype='image/png')
    else:
        return "Le nom doit etre specifie"
コード例 #3
0
def img(name = ''):
    if name != '':
        return static_file(name, root='img/', mimetype='image/png')
コード例 #4
0
ファイル: app.py プロジェクト: EtienneGaboriau/Prod_log_S4
def js_route():
    return static_file('script.js', root='./public/js')
コード例 #5
0
def server_static(filepath):
    return static_file(filepath, root='public')
コード例 #6
0
def catch_all(path):
    # Return static files.
    if path in STATIC_FILES:
        mimetype = MIME_TYPES.get(Path(path).suffix, 'auto')
        return static_file(path, STATIC_DIR, mimetype=mimetype)

    # Parse path.
    run_dir, test_dir = parse_path(path)

    if run_dir and not test_dir:
        # Show run page.
        run = database.load_run(database.run_report_file(run_dir))
        if not run:
            return template('error',
                            message=f'Run "{run_dir}" does not exist.')

        nav = [{
            'title': 'Home',
            'link': '/'
        }, {
            'title': 'Run: ' + run_dir,
            'link': '/' + run_dir
        }]
        stats = run_stats(run)
        return template('run',
                        nav=nav,
                        tag_titles=TAG_TITLES,
                        stats=stats,
                        run_dir=run_dir,
                        run=run,
                        run_tags=database.run_tags,
                        format_date=format_date,
                        format_duration=format_duration)

    elif run_dir and test_dir:
        # Show test page.
        test = database.load_test(database.test_report_file(run_dir, test_dir))
        if not test:
            return template(
                'error',
                message=f'Test "{test_dir}" does not exist for run "{run_dir}".'
            )

        action = request.query.get('action', None)
        if action == 'compare':
            # Compare images.
            image = Path(request.query['image']).as_posix()
            result_image = Path('/result') / run_dir / test_dir / image
            error_image = Path(str(result_image) + config.ERROR_IMAGE_SUFFIX)
            ref_dir = Path(test['ref_dir']).relative_to(database.ref_dir)
            ref_image = Path('/ref') / ref_dir / image
            jeri_data = create_jeri_data(result_image, ref_image, error_image)
            return template('compare',
                            image=str(image),
                            jeri_data=json.dumps(jeri_data))
        else:
            nav = [{
                'title': 'Home',
                'link': '/'
            }, {
                'title': 'Run: ' + run_dir,
                'link': '/' + run_dir
            }, {
                'title': 'Test: ' + test_dir,
                'link': '/' + run_dir + '/' + test_dir
            }]
            stats = test_stats(test)
            ref_dir = str(
                Path(test['ref_dir']).relative_to(database.ref_dir).as_posix())
            return template('test',
                            nav=nav,
                            stats=stats,
                            run_dir=run_dir,
                            test_dir=test_dir,
                            ref_dir=ref_dir,
                            test=test,
                            format_duration=format_duration)
    else:
        return template('error', message='Invalid URL.')

    return str([run_dir, test_dir])
コード例 #7
0
ファイル: myapp.py プロジェクト: ammeyjohn/work-task-board
def static(filename):
    return static_file(filename, root='static/')
コード例 #8
0
ファイル: server.py プロジェクト: znatty22/scratchpad
def serve_js(filename):
	return static_file(filename,root=ROOT_DIR + '/libs/js')	
コード例 #9
0
ファイル: server.py プロジェクト: znatty22/scratchpad
def serve_static(filename):
	return static_file(filename,root=ROOT_DIR)
コード例 #10
0
ファイル: server.py プロジェクト: znatty22/scratchpad
def home():
	return static_file('index.html',root=ROOT_DIR)
コード例 #11
0
ファイル: server.py プロジェクト: znatty22/scratchpad
def main_content():
	return static_file('main.html',root=ROOT_DIR)	
コード例 #12
0
def static(path):
    return static_file(path, root='static')
コード例 #13
0
def server_static(filepath):
    return static_file(filepath, root='./view') 
コード例 #14
0
ファイル: app.py プロジェクト: e-fector/cfdi-vault
def images(filename):
    return static_file(filename, root='static/img')
コード例 #15
0
ファイル: dispatcher.py プロジェクト: Benoss/EazyReport
def static(filepath):
    return static_file(filepath, root="./static/")
コード例 #16
0
ファイル: server.py プロジェクト: znatty22/scratchpad
def serve_less(filename):
	return static_file(filename,root=ROOT_DIR + '/less')
コード例 #17
0
ファイル: app.py プロジェクト: e-fector/cfdi-vault
def stylesheets(filename):
    return static_file(filename, root='static/css')
コード例 #18
0
ファイル: server.py プロジェクト: znatty22/scratchpad
def serve_font(filename):
	return static_file(filename,root=ROOT_DIR + '/fonts')
コード例 #19
0
ファイル: main.py プロジェクト: Bouhbouh/InstallationsPL
def file_stac(filepath):
	return static_file(filepath,root="./static")
コード例 #20
0
ファイル: server.py プロジェクト: znatty22/scratchpad
def serve_img(filename):
	return static_file(filename,root=ROOT_DIR + '/img')
コード例 #21
0
ファイル: app.py プロジェクト: EtienneGaboriau/Prod_log_S4
def home():
    return static_file('index.html', root='./public', mimetype="text/html")
コード例 #22
0
ファイル: serveur.py プロジェクト: Wahey/projetPython
def serve_static(filename):
    return static_file(filename, root="static")
コード例 #23
0
def server_static(filename):
    return static_file(filename, root='public')
コード例 #24
0
def server_static(filename):
    return static_file(filename, root='./public_html')
コード例 #25
0
def server_static(filename):
    return static_file(filename, root='./public_html')
コード例 #26
0
def server_static(filepath):
    return static_file(filepath, root='./public')
コード例 #27
0
def webapp(path = 0):
    if path == 0:
        path = 'index.html'
    return static_file(path, root='webapp/')
コード例 #28
0
def static_server(filename):
    return static_file(filename,root='static')
コード例 #29
0
ファイル: app.py プロジェクト: kikemascote/cfdi-vault
def javascripts(filename):
    return static_file(filename, root='static/js')
コード例 #30
0
def test():
    return static_file('test.html',root='static')
コード例 #31
0
ファイル: app.py プロジェクト: kikemascote/cfdi-vault
def images(filename):
    return static_file(filename, root='static/img')
コード例 #32
0
def result_image(path):
    return static_file(path, database.ref_dir)
コード例 #33
0
ファイル: dispatcher.py プロジェクト: Benoss/EazyReport
def cache_file(filepath):
    return static_file(filepath, root="./cache/")
コード例 #34
0
ファイル: app.py プロジェクト: e-fector/cfdi-vault
def javascripts(filename):
    return static_file(filename, root='static/js')