forked from cimei/ApoioSisgp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.py
33 lines (28 loc) · 800 Bytes
/
app.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
from project import app
from flask import render_template
import webbrowser
from threading import Timer
import locale
import os
# filtros cusomizado para o jinja
#
@app.template_filter('verifica_serv_bd')
def verifica_serv_bd(chave):
return os.getenv(chave)
@app.template_filter('converte_para_real')
def converte_para_real(valor):
if valor == None or valor == '':
return 0
else:
return locale.currency(valor, symbol=False, grouping = True )
@app.template_filter('decimal_com_virgula')
def decimal_com_virgula(valor):
if valor == None or valor == '':
return 0
else:
return locale.format_string('%.1f',valor,grouping=True)
@app.route('/')
def index():
return render_template('home.html')
if __name__ == '__main__':
app.run(port = 5000)