aboutsummaryrefslogtreecommitdiff
path: root/app/__init__.py
blob: be89656735a92245005eb9713343fef4593f25e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python3
#******************************************************************************
# Copyright (C) 2018 Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
# This file is part of the textoutpc project, which is MIT-licensed.
#******************************************************************************
""" textoutpc demonstration application definition. """

import os.path as _path

from flask import Flask as _Flask
from flask_assets import (Environment as _AssetsEnvironment,
	Bundle as _AssetsBundle)

from ._main import main as _main

__all__ = ["app"]

# Make the app and register blueprints.

_gd = lambda x: _path.relpath(_path.join(_path.dirname(__file__), x))
app = _Flask('textout',
	template_folder = _gd('templates'),
	static_folder = _gd('static'), static_url_path = '/static')
app.register_blueprint(_main)

# Add the assets.

_assets = _AssetsEnvironment(app)

_assets.register('js', _AssetsBundle('js/elements.js',
	filters = 'jsmin', output = 'index.js'))
_assets.register('css', _AssetsBundle('css/elements.scss', 'css/page.scss',
	filters = ('scss', 'cssmin'), output = 'index.css'))

# End of file.