restore legacy, include shorcut scripts
This commit is contained in:
20
dmold/dmweb/__init__.py
Normal file
20
dmold/dmweb/__init__.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from flask import Flask
|
||||
|
||||
from . import dm, dmcal
|
||||
|
||||
|
||||
def create_app():
|
||||
app = Flask("deskmeter")
|
||||
|
||||
app.debug = True
|
||||
app.register_blueprint(dm.dmbp)
|
||||
|
||||
# Register custom Jinja2 filters
|
||||
@app.template_filter('hash')
|
||||
def hash_filter(s):
|
||||
"""Return hash of string for consistent color generation"""
|
||||
if s is None:
|
||||
return 0
|
||||
return hash(str(s))
|
||||
|
||||
return app
|
||||
Reference in New Issue
Block a user