aboutsummaryrefslogtreecommitdiffstats
path: root/csit.infra.dash/app/cdash/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'csit.infra.dash/app/cdash/__init__.py')
-rw-r--r--csit.infra.dash/app/cdash/__init__.py29
1 files changed, 24 insertions, 5 deletions
diff --git a/csit.infra.dash/app/cdash/__init__.py b/csit.infra.dash/app/cdash/__init__.py
index c21e2c28d5..77722c78bd 100644
--- a/csit.infra.dash/app/cdash/__init__.py
+++ b/csit.infra.dash/app/cdash/__init__.py
@@ -15,11 +15,13 @@
"""
import logging
+import pandas as pd
from flask import Flask
from flask_assets import Environment, Bundle
from .utils.constants import Constants as C
+from .data.data import Data
def init_app():
@@ -55,24 +57,41 @@ def init_app():
assets.register("sass_all", sass_bundle)
sass_bundle.build()
- # Set the time period for Trending
if C.TIME_PERIOD is None or C.TIME_PERIOD > C.MAX_TIME_PERIOD:
time_period = C.MAX_TIME_PERIOD
else:
time_period = C.TIME_PERIOD
+ data = Data(
+ data_spec_file=C.DATA_SPEC_FILE,
+ ).read_all_data(days=time_period)
+
# Import Dash applications.
from .news.news import init_news
- app = init_news(app)
+ app = init_news(
+ app,
+ data_stats=data["statistics"],
+ data_trending=data["trending"]
+ )
from .stats.stats import init_stats
- app = init_stats(app, time_period=time_period)
+ app = init_stats(
+ app,
+ data_stats=data["statistics"],
+ data_trending=data["trending"]
+ )
from .trending.trending import init_trending
- app = init_trending(app, time_period=time_period)
+ app = init_trending(
+ app,
+ data_trending=data["trending"]
+ )
from .report.report import init_report
- app = init_report(app, releases=C.RELEASES)
+ app = init_report(
+ app,
+ data_iterative=data["iterative"]
+ )
return app