From ecb3166dfed49d79f813b45ea948450d046372d9 Mon Sep 17 00:00:00 2001 From: Egor Svitin Date: Tue, 21 Feb 2023 10:04:51 +0300 Subject: [PATCH 1/2] update run --- Dockerfile | 1 + update.py | 15 ++++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 23d4cf5..672d2e6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,4 +13,5 @@ RUN pip install pymongo \ COPY ./ ./ RUN chmod 777 /app/configs/sources.json +RUN python /app/update.py diff --git a/update.py b/update.py index 5c68fb3..7f11639 100644 --- a/update.py +++ b/update.py @@ -35,16 +35,17 @@ class Updater: def do_action(self): print("Start Updater"); - if self.args.config: - print("Start Configure") - self.update_config() + print("Start Configure") + self.update_config() - if not self.is_source_exists(self.args.source): - print("This source not exists, list of sources: " + ', '.join(config.get_sources_list())) + if self.is_source_exists(self.args.source): + print("Start source update" + self.args.source) + self.parse_source(self.args.source) return - print("Start source update") - self.parse_source(self.args.source) + for source in self.args.source: + print("Start source update" + source) + self.parse_source(source) updater = Updater() From 12011220e5d45524a34610adc83a6793d65eded7 Mon Sep 17 00:00:00 2001 From: Egor Svitin Date: Tue, 21 Feb 2023 10:06:09 +0300 Subject: [PATCH 2/2] remove whilespace --- update.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update.py b/update.py index 7f11639..45bf343 100644 --- a/update.py +++ b/update.py @@ -43,7 +43,7 @@ class Updater: self.parse_source(self.args.source) return - for source in self.args.source: + for source in self.args.source: print("Start source update" + source) self.parse_source(source)