X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Ftools%2Fdash%2Fapp%2Fpal%2F__init__.py;h=9f80c5fcaa3a35a54704dae8b1a37957ea7704bd;hp=c55ac9639800418e493f1b7254bb8eae18a3e70e;hb=625b8361b37635f6be970f0706d6f49c6f57e8db;hpb=51da461dcdb1ed20abe73b616ceb971569c9b884 diff --git a/resources/tools/dash/app/pal/__init__.py b/resources/tools/dash/app/pal/__init__.py index c55ac96398..9f80c5fcaa 100644 --- a/resources/tools/dash/app/pal/__init__.py +++ b/resources/tools/dash/app/pal/__init__.py @@ -20,12 +20,12 @@ from flask import Flask from flask_assets import Environment -# Maximal value of TIME_PERIOD in days. +# Maximal value of TIME_PERIOD for Trending in days. # Do not change without a good reason. MAX_TIME_PERIOD = 180 -# It defines the time period in days from now back to the past from which data -# is read to dataframes. +# It defines the time period for Trending in days from now back to the past from +# which data is read to dataframes. # TIME_PERIOD = None means all data (max MAX_TIME_PERIOD days) is read. # TIME_PERIOD = MAX_TIME_PERIOD is the default value TIME_PERIOD = MAX_TIME_PERIOD # [days] @@ -57,12 +57,16 @@ def init_app(): assets = Environment() assets.init_app(app) + # Set the time period for Trending if TIME_PERIOD is None or TIME_PERIOD > MAX_TIME_PERIOD: time_period = MAX_TIME_PERIOD else: time_period = TIME_PERIOD # Import Dash applications. + from .news.news import init_news + app = init_news(app) + from .stats.stats import init_stats app = init_stats(app, time_period=time_period)