added cal project
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
from flask import Flask
|
||||
from dmweb import dm, dmcal
|
||||
|
||||
from . import dm, dmcal
|
||||
|
||||
|
||||
def create_app():
|
||||
|
||||
app = Flask("deskmeter")
|
||||
app = Flask("deskmeter")
|
||||
|
||||
app.debug = True
|
||||
app.register_blueprint(dm.dmbp)
|
||||
|
||||
return app
|
||||
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ def index(task=None):
|
||||
end = datetime.today().replace(hour=23, minute=59, second=59, tzinfo=timezone)
|
||||
|
||||
rows = get_period_totals(start, end, task)
|
||||
print(rows)
|
||||
|
||||
return render_template("main.html", rows=rows)
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@ import calendar
|
||||
from datetime import datetime
|
||||
from pprint import pprint
|
||||
|
||||
# import pytz
|
||||
from dmweb.dm import dmbp
|
||||
from flask import Blueprint, render_template
|
||||
|
||||
# import pytz
|
||||
from .dm import dmbp
|
||||
from .get_period_times import (
|
||||
get_period_totals,
|
||||
read_and_extract,
|
||||
@@ -77,6 +77,8 @@ class DMHTMLCalendar(calendar.HTMLCalendar):
|
||||
|
||||
rows = get_period_totals(start, end, self.task)
|
||||
|
||||
print(rows)
|
||||
|
||||
returnstr = "<table class='totaltable'>"
|
||||
for row in rows:
|
||||
returnstr += "<tr><td>{}</td><td>{}</td></tr>".format(
|
||||
|
||||
@@ -178,8 +178,6 @@ def get_period_totals(start, end, task=None):
|
||||
|
||||
aux_results = list(switches.aggregate(pipeline_before_after))
|
||||
|
||||
print(aux_results)
|
||||
|
||||
bfirst = aux_results[0]["before_first"]
|
||||
|
||||
if bfirst:
|
||||
|
||||
4
dmapp/dmweb/run.py
Normal file
4
dmapp/dmweb/run.py
Normal file
@@ -0,0 +1,4 @@
|
||||
from dmweb import create_app
|
||||
|
||||
app = create_app()
|
||||
app.run(host="0.0.0.0", debug=True, threaded=True, port=10000)
|
||||
Reference in New Issue
Block a user