diff --git a/covid19python.py b/covid19python.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/covid19python/__init__.py b/covid19python/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3638a0a5de37083b27c38e7e5a0124c394d3e56f --- /dev/null +++ b/covid19python/__init__.py @@ -0,0 +1,27 @@ +from logging.config import dictConfig +from database import db, app, my_logging_config, run_run_with_debug +from org.woehlke.covid19.who.who_service import WhoService +from org.woehlke.covid19.europe.europe_service import EuropeService +from org.woehlke.covid19.vaccination.vaccination_service import VaccinationService +from org.woehlke.covid19.admin.admin_service import AdminService + +drop_and_create_data_again = True + +who_service = None +europe_service = None +vaccination_service = None +admin_service = None + +################################################################################################################# +# +# MAIN +# +################################################################################################################# +if __name__ == '__main__': + dictConfig(my_logging_config) + db.create_all() + who_service = WhoService(db) + europe_service = EuropeService(db) + vaccination_service = VaccinationService(db) + admin_service = AdminService(db) + app.run(debug=run_run_with_debug) diff --git a/static/favicon.ico b/covid19python/static/favicon.ico similarity index 100% rename from static/favicon.ico rename to covid19python/static/favicon.ico diff --git a/templates/admin/admin_info.html b/covid19python/templates/admin/admin_info.html similarity index 100% rename from templates/admin/admin_info.html rename to covid19python/templates/admin/admin_info.html diff --git a/templates/admin/admin_tasks.html b/covid19python/templates/admin/admin_tasks.html similarity index 100% rename from templates/admin/admin_tasks.html rename to covid19python/templates/admin/admin_tasks.html diff --git a/templates/europe/europe_continent_all.html b/covid19python/templates/europe/europe_continent_all.html similarity index 100% rename from templates/europe/europe_continent_all.html rename to covid19python/templates/europe/europe_continent_all.html diff --git a/templates/europe/europe_continent_germany.html b/covid19python/templates/europe/europe_continent_germany.html similarity index 100% rename from templates/europe/europe_continent_germany.html rename to covid19python/templates/europe/europe_continent_germany.html diff --git a/templates/europe/europe_continent_one.html b/covid19python/templates/europe/europe_continent_one.html similarity index 100% rename from templates/europe/europe_continent_one.html rename to covid19python/templates/europe/europe_continent_one.html diff --git a/templates/europe/europe_country_all.html b/covid19python/templates/europe/europe_country_all.html similarity index 100% rename from templates/europe/europe_country_all.html rename to covid19python/templates/europe/europe_country_all.html diff --git a/templates/europe/europe_country_germany.html b/covid19python/templates/europe/europe_country_germany.html similarity index 100% rename from templates/europe/europe_country_germany.html rename to covid19python/templates/europe/europe_country_germany.html diff --git a/templates/europe/europe_country_one.html b/covid19python/templates/europe/europe_country_one.html similarity index 100% rename from templates/europe/europe_country_one.html rename to covid19python/templates/europe/europe_country_one.html diff --git a/templates/europe/europe_data.html b/covid19python/templates/europe/europe_data.html similarity index 100% rename from templates/europe/europe_data.html rename to covid19python/templates/europe/europe_data.html diff --git a/templates/europe/europe_date_reported_all.html b/covid19python/templates/europe/europe_date_reported_all.html similarity index 100% rename from templates/europe/europe_date_reported_all.html rename to covid19python/templates/europe/europe_date_reported_all.html diff --git a/templates/europe/europe_date_reported_one.html b/covid19python/templates/europe/europe_date_reported_one.html similarity index 100% rename from templates/europe/europe_date_reported_one.html rename to covid19python/templates/europe/europe_date_reported_one.html diff --git a/templates/europe/europe_date_reported_one_cases_weekly.html b/covid19python/templates/europe/europe_date_reported_one_cases_weekly.html similarity index 100% rename from templates/europe/europe_date_reported_one_cases_weekly.html rename to covid19python/templates/europe/europe_date_reported_one_cases_weekly.html diff --git a/templates/europe/europe_date_reported_one_deaths_weekly.html b/covid19python/templates/europe/europe_date_reported_one_deaths_weekly.html similarity index 100% rename from templates/europe/europe_date_reported_one_deaths_weekly.html rename to covid19python/templates/europe/europe_date_reported_one_deaths_weekly.html diff --git a/templates/europe/europe_date_reported_one_notification_rate.html b/covid19python/templates/europe/europe_date_reported_one_notification_rate.html similarity index 100% rename from templates/europe/europe_date_reported_one_notification_rate.html rename to covid19python/templates/europe/europe_date_reported_one_notification_rate.html diff --git a/templates/europe/europe_imported.html b/covid19python/templates/europe/europe_imported.html similarity index 100% rename from templates/europe/europe_imported.html rename to covid19python/templates/europe/europe_imported.html diff --git a/templates/europe/europe_info.html b/covid19python/templates/europe/europe_info.html similarity index 100% rename from templates/europe/europe_info.html rename to covid19python/templates/europe/europe_info.html diff --git a/templates/europe/europe_tasks.html b/covid19python/templates/europe/europe_tasks.html similarity index 100% rename from templates/europe/europe_tasks.html rename to covid19python/templates/europe/europe_tasks.html diff --git a/templates/europe/fragment_europe_continent_table.html b/covid19python/templates/europe/fragment_europe_continent_table.html similarity index 100% rename from templates/europe/fragment_europe_continent_table.html rename to covid19python/templates/europe/fragment_europe_continent_table.html diff --git a/templates/europe/fragment_europe_country_table.html b/covid19python/templates/europe/fragment_europe_country_table.html similarity index 100% rename from templates/europe/fragment_europe_country_table.html rename to covid19python/templates/europe/fragment_europe_country_table.html diff --git a/templates/europe/fragment_europe_data_imported_table.html b/covid19python/templates/europe/fragment_europe_data_imported_table.html similarity index 100% rename from templates/europe/fragment_europe_data_imported_table.html rename to covid19python/templates/europe/fragment_europe_data_imported_table.html diff --git a/templates/europe/fragment_europe_data_table.html b/covid19python/templates/europe/fragment_europe_data_table.html similarity index 100% rename from templates/europe/fragment_europe_data_table.html rename to covid19python/templates/europe/fragment_europe_data_table.html diff --git a/templates/europe/fragment_europe_date_reported_table.html b/covid19python/templates/europe/fragment_europe_date_reported_table.html similarity index 100% rename from templates/europe/fragment_europe_date_reported_table.html rename to covid19python/templates/europe/fragment_europe_date_reported_table.html diff --git a/templates/fragment_flashed_messages.html b/covid19python/templates/fragment_flashed_messages.html similarity index 100% rename from templates/fragment_flashed_messages.html rename to covid19python/templates/fragment_flashed_messages.html diff --git a/templates/fragment_navbar.html b/covid19python/templates/fragment_navbar.html similarity index 100% rename from templates/fragment_navbar.html rename to covid19python/templates/fragment_navbar.html diff --git a/templates/fragment_navtabs.html b/covid19python/templates/fragment_navtabs.html similarity index 100% rename from templates/fragment_navtabs.html rename to covid19python/templates/fragment_navtabs.html diff --git a/templates/fragment_navtabs_admin.html b/covid19python/templates/fragment_navtabs_admin.html similarity index 100% rename from templates/fragment_navtabs_admin.html rename to covid19python/templates/fragment_navtabs_admin.html diff --git a/templates/fragment_navtabs_europe.html b/covid19python/templates/fragment_navtabs_europe.html similarity index 100% rename from templates/fragment_navtabs_europe.html rename to covid19python/templates/fragment_navtabs_europe.html diff --git a/templates/fragment_navtabs_nrw.html b/covid19python/templates/fragment_navtabs_nrw.html similarity index 100% rename from templates/fragment_navtabs_nrw.html rename to covid19python/templates/fragment_navtabs_nrw.html diff --git a/templates/fragment_navtabs_rki.html b/covid19python/templates/fragment_navtabs_rki.html similarity index 100% rename from templates/fragment_navtabs_rki.html rename to covid19python/templates/fragment_navtabs_rki.html diff --git a/templates/fragment_navtabs_vaccination.html b/covid19python/templates/fragment_navtabs_vaccination.html similarity index 100% rename from templates/fragment_navtabs_vaccination.html rename to covid19python/templates/fragment_navtabs_vaccination.html diff --git a/templates/fragment_navtabs_who.html b/covid19python/templates/fragment_navtabs_who.html similarity index 100% rename from templates/fragment_navtabs_who.html rename to covid19python/templates/fragment_navtabs_who.html diff --git a/templates/fragment_pagination.html b/covid19python/templates/fragment_pagination.html similarity index 100% rename from templates/fragment_pagination.html rename to covid19python/templates/fragment_pagination.html diff --git a/templates/nrw/nrw_imported.html b/covid19python/templates/nrw/nrw_imported.html similarity index 100% rename from templates/nrw/nrw_imported.html rename to covid19python/templates/nrw/nrw_imported.html diff --git a/templates/nrw/nrw_info.html b/covid19python/templates/nrw/nrw_info.html similarity index 100% rename from templates/nrw/nrw_info.html rename to covid19python/templates/nrw/nrw_info.html diff --git a/templates/nrw/nrw_stadt.html b/covid19python/templates/nrw/nrw_stadt.html similarity index 100% rename from templates/nrw/nrw_stadt.html rename to covid19python/templates/nrw/nrw_stadt.html diff --git a/templates/nrw/nrw_tasks.html b/covid19python/templates/nrw/nrw_tasks.html similarity index 100% rename from templates/nrw/nrw_tasks.html rename to covid19python/templates/nrw/nrw_tasks.html diff --git a/templates/page_home.html b/covid19python/templates/page_home.html similarity index 100% rename from templates/page_home.html rename to covid19python/templates/page_home.html diff --git a/templates/page_layout.html b/covid19python/templates/page_layout.html similarity index 100% rename from templates/page_layout.html rename to covid19python/templates/page_layout.html diff --git a/templates/rki/rki_imported.html b/covid19python/templates/rki/rki_imported.html similarity index 100% rename from templates/rki/rki_imported.html rename to covid19python/templates/rki/rki_imported.html diff --git a/templates/rki/rki_info.html b/covid19python/templates/rki/rki_info.html similarity index 100% rename from templates/rki/rki_info.html rename to covid19python/templates/rki/rki_info.html diff --git a/templates/rki/rki_tasks.html b/covid19python/templates/rki/rki_tasks.html similarity index 100% rename from templates/rki/rki_tasks.html rename to covid19python/templates/rki/rki_tasks.html diff --git a/templates/vaccination/vaccination_imported.html b/covid19python/templates/vaccination/vaccination_imported.html similarity index 100% rename from templates/vaccination/vaccination_imported.html rename to covid19python/templates/vaccination/vaccination_imported.html diff --git a/templates/vaccination/vaccination_info.html b/covid19python/templates/vaccination/vaccination_info.html similarity index 100% rename from templates/vaccination/vaccination_info.html rename to covid19python/templates/vaccination/vaccination_info.html diff --git a/templates/vaccination/vaccination_tasks.html b/covid19python/templates/vaccination/vaccination_tasks.html similarity index 100% rename from templates/vaccination/vaccination_tasks.html rename to covid19python/templates/vaccination/vaccination_tasks.html diff --git a/templates/who/fragment_who_country_table.html b/covid19python/templates/who/fragment_who_country_table.html similarity index 100% rename from templates/who/fragment_who_country_table.html rename to covid19python/templates/who/fragment_who_country_table.html diff --git a/templates/who/fragment_who_global_data_table.html b/covid19python/templates/who/fragment_who_global_data_table.html similarity index 100% rename from templates/who/fragment_who_global_data_table.html rename to covid19python/templates/who/fragment_who_global_data_table.html diff --git a/templates/who/who_country_all.html b/covid19python/templates/who/who_country_all.html similarity index 100% rename from templates/who/who_country_all.html rename to covid19python/templates/who/who_country_all.html diff --git a/templates/who/who_country_germany.html b/covid19python/templates/who/who_country_germany.html similarity index 100% rename from templates/who/who_country_germany.html rename to covid19python/templates/who/who_country_germany.html diff --git a/templates/who/who_country_one.html b/covid19python/templates/who/who_country_one.html similarity index 100% rename from templates/who/who_country_one.html rename to covid19python/templates/who/who_country_one.html diff --git a/templates/who/who_date_reported_all.html b/covid19python/templates/who/who_date_reported_all.html similarity index 100% rename from templates/who/who_date_reported_all.html rename to covid19python/templates/who/who_date_reported_all.html diff --git a/templates/who/who_date_reported_one.html b/covid19python/templates/who/who_date_reported_one.html similarity index 100% rename from templates/who/who_date_reported_one.html rename to covid19python/templates/who/who_date_reported_one.html diff --git a/templates/who/who_imported.html b/covid19python/templates/who/who_imported.html similarity index 100% rename from templates/who/who_imported.html rename to covid19python/templates/who/who_imported.html diff --git a/templates/who/who_info.html b/covid19python/templates/who/who_info.html similarity index 100% rename from templates/who/who_info.html rename to covid19python/templates/who/who_info.html diff --git a/templates/who/who_region_all.html b/covid19python/templates/who/who_region_all.html similarity index 100% rename from templates/who/who_region_all.html rename to covid19python/templates/who/who_region_all.html diff --git a/templates/who/who_region_one.html b/covid19python/templates/who/who_region_one.html similarity index 100% rename from templates/who/who_region_one.html rename to covid19python/templates/who/who_region_one.html diff --git a/templates/who/who_tasks.html b/covid19python/templates/who/who_tasks.html similarity index 100% rename from templates/who/who_tasks.html rename to covid19python/templates/who/who_tasks.html diff --git a/app.py b/covid19python/views.py similarity index 95% rename from app.py rename to covid19python/views.py index f1079649026a8b1070ee2d96b6ba699779af211b..8258396b7513e14020153f860f693c083cc959e7 100644 --- a/app.py +++ b/covid19python/views.py @@ -1,23 +1,25 @@ +from covid19python import app from logging.config import dictConfig from flask import render_template, redirect, url_for, flash from sqlalchemy.exc import OperationalError -from database import db, app, my_logging_config, run_run_with_debug +from database import db, my_logging_config, run_run_with_debug from org.woehlke.covid19.who.who_model import WhoGlobalDataImportTable from org.woehlke.covid19.who.who_model import WhoRegion, WhoCountry, WhoDateReported, WhoGlobalData -from org.woehlke.covid19.who.who_service import WhoService from org.woehlke.covid19.europe.europe_model import EuropeDataImportTable, EuropeDateReported, EuropeContinent from org.woehlke.covid19.europe.europe_model import EuropeCountry, EuropeData +from org.woehlke.covid19.who.who_service import WhoService from org.woehlke.covid19.europe.europe_service import EuropeService from org.woehlke.covid19.vaccination.vaccination_service import VaccinationService -from org.woehlke.covid19.vaccination.vaccination_model import VaccinationDataImportTable from org.woehlke.covid19.admin.admin_service import AdminService -from app_mq import who_run_update_task, who_update_short_task, who_update_initial_task -from app_mq import alive_message_task -from app_mq import europe_update_initial_task -from app_mq import vaccination_update_initial_task -from app_mq import admin_database_drop_create_task +from org.woehlke.covid19.vaccination.vaccination_model import VaccinationDataImportTable + +from covid19python import who_service, europe_service, vaccination_service, admin_service -drop_and_create_data_again = True +from covid19python_mq import who_run_update_task, who_update_short_task, who_update_initial_task +from covid19python_mq import alive_message_task +from covid19python_mq import europe_update_initial_task +from covid19python_mq import vaccination_update_initial_task +from covid19python_mq import admin_database_drop_create_task class ApplicationPage: @@ -578,18 +580,3 @@ def url_admin_database_drop(): admin_database_drop_create_task.apply_async() app.logger.info("url_admin_database_drop [done]") return redirect(url_for('url_admin_tasks')) - - -################################################################################################################# -# -# MAIN -# -################################################################################################################# -if __name__ == '__main__': - dictConfig(my_logging_config) - db.create_all() - who_service = WhoService(db) - europe_service = EuropeService(db) - vaccination_service = VaccinationService(db) - admin_service = AdminService(db) - app.run(debug=run_run_with_debug) diff --git a/app_mq.py b/covid19python_mq.py similarity index 100% rename from app_mq.py rename to covid19python_mq.py diff --git a/run.sh b/run.sh new file mode 100644 index 0000000000000000000000000000000000000000..342669cef261fba3b342f06a055cc16e018d5792 --- /dev/null +++ b/run.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +export FLASK_ENV=development +export FLASK_APP=yourapplication +pip install -e . +flask run diff --git a/setup.cfg b/setup.cfg index 82847682df4431b2484f4314bef720bcd9f27a66..8d5dd6c2a72af4daeb28a6ab36759f2d4e32af3a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,7 +3,9 @@ name = covid19python version = 0.0.11 [options] -packages = covid19python +packages = + covid19python + covid19python_mq install_requires = requests importlib; python_version >= "3.7"