refactors logging and config
This commit is contained in:
11
app/views.py
11
app/views.py
@@ -6,16 +6,9 @@ from app.forms import ScrapingForm
|
||||
from app.util import get_size
|
||||
from app.config import load_config
|
||||
from app.api import scraper as scraper
|
||||
from app.logging_config import get_logger
|
||||
|
||||
from app.analysis import load_data, load_analysis_modules
|
||||
|
||||
|
||||
print(f"A imported log_file_name: {log_file_name}")
|
||||
|
||||
config = load_config()
|
||||
logger = get_logger()
|
||||
|
||||
views_bp = Blueprint("views", __name__)
|
||||
|
||||
def register_views(app):
|
||||
@@ -42,8 +35,8 @@ def register_views(app):
|
||||
if not scraper:
|
||||
print("Scraper not initialized")
|
||||
|
||||
data_dir = os.path.abspath(config['DATA']['DATA_DIR'])
|
||||
log_dir = os.path.abspath(config['LOGGING']['LOG_DIR'])
|
||||
data_dir = os.path.abspath(current_app.config['DATA']['DATA_DIR'])
|
||||
log_dir = os.path.abspath(current_app.config['LOGGING']['LOG_DIR'])
|
||||
|
||||
data_files = glob.glob(os.path.join(data_dir, "*.csv"))
|
||||
log_files = glob.glob(os.path.join(log_dir, "*.log"))
|
||||
|
||||
Reference in New Issue
Block a user