-
Notifications
You must be signed in to change notification settings - Fork 1
/
fl.py
47 lines (36 loc) · 1.03 KB
/
fl.py
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
36
37
38
39
40
41
42
43
44
45
46
47
## @file
## @brief Flask templates
from metaL import *
## @defgroup fl FL
## @brief Flask templates
## @ingroup web
## @{
class flModule(webModule):
def init_reqs(self):
super().init_reqs()
(self.reqs // 'flask').sync()
def static_logo(self):
return "{{ url_for('static', filename='logo.png') }}"
def init_py(self):
super().init_py()
self.init_index()
self.py.top //\
pyImport('flask') //\
f'app = flask.Flask("{self}")'
self.py.mid //\
self.index
self.py.bot //\
'app.run(host=config.HOST,port=config.PORT,debug=True)'
self.py.sync()
def init_index(self):
self.index = Section('index')
self.index //\
"@app.route('/')" //\
(S('def index():') //
'return flask.render_template("index.html")'
)
def init_vscode_ext(self):
super().init_vscode_ext()
self.vscode.ext.ext // '"wholroyd.jinja",'
self.vscode.ext.sync()
## @}