Commit 38c32193 authored by Christophe Benz's avatar Christophe Benz
Browse files

Add logging in app initialization

parent ce779265
......@@ -4,12 +4,12 @@ import os
from pathlib import Path
from urllib.parse import quote_plus
import cachecontrol
import flask
import jinja2
import requests
import tableschema
import cachecontrol
import opendataschema
from . import config
......@@ -29,17 +29,19 @@ def generate_schema_from_url_func(session):
return schema_from_url
# And load schema catalogs which urls are found in config.json
# And load schema catalogs which URLs are found in homepage_config.json
schema_catalog_map = {}
if config.HOMEPAGE_CONFIG:"Initializing homepage sections...")
caching_session = cachecontrol.CacheControl(requests.Session())
schema_from_url = generate_schema_from_url_func(caching_session)
for section in config.HOMEPAGE_CONFIG['sections']:
code = section['code']'Initializing homepage section "{}"...'.format(code))
if isinstance(section['catalog'], str) and section['catalog'].startswith('http'):
code = section['code']
url = section['catalog']
schema_catalog_map[code] = opendataschema.SchemaCatalog(url, session=caching_session)"...done")
# Flask things
app = flask.Flask(__name__)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment