diff --git a/src/covid19/blueprints/ecdc/ecdc_service.py b/src/covid19/blueprints/ecdc/ecdc_service.py index beac35bd265d63e7b1f674697bb577f9bec792e1..364437e873191aa0bba6b4c445afbfddbacffafb 100644 --- a/src/covid19/blueprints/ecdc/ecdc_service.py +++ b/src/covid19/blueprints/ecdc/ecdc_service.py @@ -12,60 +12,60 @@ class EcdcService: app.logger.debug(" ECDC Service [init]") app.logger.debug("------------------------------------------------------------") self.__database = database - self.ecdc_service_download = EcdcServiceDownload(database) - self.ecdc_service_import = EcdcServiceImport(database) - self.ecdc_service_update = EcdcServiceUpdate(database) + self.service_download = EcdcServiceDownload(database) + self.service_import = EcdcServiceImport(database) + self.service_update = EcdcServiceUpdate(database) app.logger.debug("------------------------------------------------------------") app.logger.info(" ECDC Service [ready] ") def pretask_database_drop_create(self): flash("ecdc_service.download started") - self.ecdc_service_download.download() + self.service_download.download() return self def task_database_drop_create(self): - self.ecdc_service_import.import_datafile_to_db() - self.ecdc_service_update.update_db_short() + self.service_import.import_datafile_to_db() + self.service_update.update_db_short() return self def run_download_only(self): - self.ecdc_service_download.download() + self.service_download.download() return self def run_import_only(self): - self.ecdc_service_import.import_datafile_to_db() + self.service_import.import_datafile_to_db() return self # TODO: #112 implement EcdcService.run_update_dimension_tables_only # TODO: #111 refactor to new method scheme itroduced 07.02.2021 def run_update_dimension_tables_only(self): - self.ecdc_service_update.update_dimension_tables_only() + self.service_update.update_dimension_tables_only() return self # TODO: #113 implement EcdcService.run_update_fact_table_incremental_only # TODO: #111 refactor to new method scheme itroduced 07.02.2021 def run_update_fact_table_incremental_only(self): - self.ecdc_service_update.update_fact_table_incremental_only() + self.service_update.update_fact_table_incremental_only() return self # TODO: #114 implement EcdcService.run_update_fact_table_initial_only # TODO: #111 refactor to new method scheme itroduced 07.02.2021 def run_update_fact_table_initial_only(self): - self.ecdc_service_update.update_fact_table_initial_only() + self.service_update.update_fact_table_initial_only() return self # TODO: #115 implement EcdcService.run_update_star_schema_incremental # TODO: #111 refactor to new method scheme itroduced 07.02.2021 def run_update_star_schema_incremental(self): - self.ecdc_service_import.import_datafile_to_db() - self.ecdc_service_update.update_star_schema_incremental() + self.service_import.import_datafile_to_db() + self.service_update.update_star_schema_incremental() return self # TODO: #116 implement EcdcService.run_update_star_schema_initial # TODO: #111 refactor to new method scheme itroduced 07.02.2021 def run_update_star_schema_initial(self): - self.ecdc_service_import.import_datafile_to_db() - self.ecdc_service_update.update_star_schema_initial() + self.service_import.import_datafile_to_db() + self.service_update.update_star_schema_initial() return self def download_all_files(self): diff --git a/src/covid19/blueprints/rki_vaccination/rki_vaccination_service.py b/src/covid19/blueprints/rki_vaccination/rki_vaccination_service.py index 52a3fbb7730f42ac291be47ebf6166d19c4620e7..d0f28f4376c5d78201adf47532c2fa5765e29ed4 100644 --- a/src/covid19/blueprints/rki_vaccination/rki_vaccination_service.py +++ b/src/covid19/blueprints/rki_vaccination/rki_vaccination_service.py @@ -14,51 +14,51 @@ class RkiVaccinationService: app.logger.debug("------------------------------------------------------------") self.__database = database self.cfg = RkiVaccinationServiceConfig() - self.vaccination_service_download = RkiVaccinationServiceDownload(database) - self.vaccination_service_import = RkiVaccinationServiceImport(database) - self.vaccination_service_udpate = RkiVaccinationServiceUpdate(database) + self.service_download = RkiVaccinationServiceDownload(database) + self.service_import = RkiVaccinationServiceImport(database) + self.service_udpate = RkiVaccinationServiceUpdate(database) app.logger.debug("------------------------------------------------------------") app.logger.info(" Vaccination Service [ready]") def pretask_database_drop_create(self): flash("vaccination_service.run_download started") - self.vaccination_service_download.download_file() + self.service_download.download_file() return self def task_database_drop_create(self): - self.vaccination_service_import.import_file() - self.vaccination_service_udpate.update_star_schema_initial() + self.service_import.import_file() + self.service_udpate.update_star_schema_initial() return self def run_download_only(self): - self.vaccination_service_download.download_file() + self.service_download.download_file() return self def run_import_only(self): - self.vaccination_service_import.import_file() + self.service_import.import_file() return self def run_update_dimension_tables_only(self): - self.vaccination_service_udpate.update_dimension_tables_only() + self.service_udpate.update_dimension_tables_only() return self def run_update_fact_table_incremental_only(self): - self.vaccination_service_udpate.update_fact_table_incremental_only() + self.service_udpate.update_fact_table_incremental_only() return self def run_update_fact_table_initial_only(self): - self.vaccination_service_udpate.update_fact_table_initial_only() + self.service_udpate.update_fact_table_initial_only() return self def run_update_star_schema_incremental(self): - self.vaccination_service_udpate.update_star_schema_incremental() + self.service_udpate.update_star_schema_incremental() return self def run_update_star_schema_initial(self): self.run_import_only() - self.vaccination_service_udpate.update_star_schema_initial() + self.service_udpate.update_star_schema_initial() return self def download_all_files(self): - self.vaccination_service_download.download_file() + self.service_download.download_file() return self \ No newline at end of file diff --git a/src/covid19/blueprints/who/who_service.py b/src/covid19/blueprints/who/who_service.py index 821607367ebabcd25f60df095fc7c591c7c0e5bf..a43381d8ad9f21337f4ff9cbca2b735585f1ad4f 100644 --- a/src/covid19/blueprints/who/who_service.py +++ b/src/covid19/blueprints/who/who_service.py @@ -12,21 +12,21 @@ class WhoService: app.logger.debug(" WHO Service [init]") app.logger.debug("------------------------------------------------------------") self.__database = database - self.who_service_download = WhoServiceDownload(database) - self.who_service_import = WhoServiceImport(database) - self.who_service_update = WhoServiceUpdate(database) + self.service_download = WhoServiceDownload(database) + self.service_import = WhoServiceImport(database) + self.service_update = WhoServiceUpdate(database) app.logger.debug("------------------------------------------------------------") app.logger.info(" WHO Service [ready]") def pretask_database_drop_create(self): flash("who_service.run_download started") - self.who_service_download.download_file() + self.service_download.download_file() return self def task_database_drop_create(self): - self.who_service_import.import_file() - self.who_service_update.update_dimension_tables_only() - self.who_service_update.update_fact_table_incremental_only() + self.service_import.import_file() + self.service_update.update_dimension_tables_only() + self.service_update.update_fact_table_incremental_only() return self #def run_download_only(self): @@ -40,7 +40,7 @@ class WhoService: def run_download_only(self): app.logger.info(" run_download_only [begin]") app.logger.info("------------------------------------------------------------") - self.who_service_download.download_file() + self.service_download.download_file() app.logger.info("") app.logger.info(" run_download_only [done]") app.logger.info("------------------------------------------------------------") @@ -49,7 +49,7 @@ class WhoService: def run_import_only(self): app.logger.info(" run_import_only [begin]") app.logger.info("------------------------------------------------------------") - self.who_service_import.import_file() + self.service_import.import_file() app.logger.info("") app.logger.info(" run_import_only [done]") app.logger.info("------------------------------------------------------------") @@ -58,7 +58,7 @@ class WhoService: def run_update_dimension_tables_only(self): app.logger.info(" run_update_only [begin]") app.logger.info("------------------------------------------------------------") - self.who_service_update.update_dimension_tables_only() + self.service_update.update_dimension_tables_only() app.logger.info("") app.logger.info(" run_update_only [done]") app.logger.info("------------------------------------------------------------") @@ -67,7 +67,7 @@ class WhoService: def run_update_fact_table_incremental_only(self): app.logger.info(" run_update_only [begin]") app.logger.info("------------------------------------------------------------") - self.who_service_update.update_fact_table_incremental_only() + self.service_update.update_fact_table_incremental_only() app.logger.info("") app.logger.info(" run_update_only [done]") app.logger.info("------------------------------------------------------------") @@ -76,7 +76,7 @@ class WhoService: def run_update_fact_table_initial_only(self): app.logger.info(" run_update_initial [begin]") app.logger.info("------------------------------------------------------------") - self.who_service_update.update_fact_table_initial_only() + self.service_update.update_fact_table_initial_only() app.logger.info("") app.logger.info(" run_update_initial [done]") app.logger.info("------------------------------------------------------------") @@ -85,8 +85,8 @@ class WhoService: def run_update_star_schema_incremental(self): app.logger.info(" run_update_short [begin]") app.logger.info("------------------------------------------------------------") - self.who_service_import.import_file() - self.who_service_update.update_star_schema_incremental() + self.service_import.import_file() + self.service_update.update_star_schema_incremental() app.logger.info("") app.logger.info(" run_update_short [done]") app.logger.info("------------------------------------------------------------") @@ -95,14 +95,14 @@ class WhoService: def run_update_star_schema_initial(self): app.logger.info(" run_update_initial_full [begin]") app.logger.info("------------------------------------------------------------") - self.who_service_import.import_file() - self.who_service_update.update_star_schema_initial() + self.service_import.import_file() + self.service_update.update_star_schema_initial() app.logger.info("") app.logger.info(" run_update_initial_full [done]") app.logger.info("------------------------------------------------------------") return self def download_all_files(self): - self.who_service_download.download_file() + self.service_download.download_file() return self diff --git a/src/covid19/blueprints/who/who_views.py b/src/covid19/blueprints/who/who_views.py index a3e7f4c757f3b8b0d0b37a616fff54b72a0ca989..2bd8b905f3a9fbb35b60660bea4dd2805e313740 100644 --- a/src/covid19/blueprints/who/who_views.py +++ b/src/covid19/blueprints/who/who_views.py @@ -179,7 +179,7 @@ def url_task_who_update_fact_table_initial_only(): def url_task_who_update_star_schema_initial(): app.logger.info("url_who_task_update_full [start]") who_service.run_download_only() - flash("who_service.who_service_download.download_file ok") + flash("who_service.service_download.download_file ok") task_who_update_star_schema_initial.apply_async() flash("task_who_update_star_schema_initial started") flash(message="long running background task started", category="warning") @@ -191,7 +191,7 @@ def url_task_who_update_star_schema_initial(): def url_task_who_update_star_schema_incremental(): app.logger.info("url_task_who_update_star_schema_incremental [start]") who_service.run_download_only() - flash("who_service.who_service_download.download_file ok") + flash("who_service.service_download.download_file ok") task_who_update_star_schema_incremental.apply_async() flash("task_who_run_update_full started") flash(message="long running background task started", category="warning")