From 2c58075c6b18db24dc5397addc41e52a3a46e4eb Mon Sep 17 00:00:00 2001 From: Sarah Date: Sat, 16 Apr 2022 09:33:27 +0100 Subject: [PATCH] combine lines --- update_wiki.py | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/update_wiki.py b/update_wiki.py index 090cda8..c68f439 100644 --- a/update_wiki.py +++ b/update_wiki.py @@ -51,39 +51,25 @@ def update_wiki(token_id, token_secret, update_csv, update_films_by_year, update bar.finish() - with IncrementalBar('Generating pages', max=update_page_count, check_tty=False) as bar: - if update_films_by_year: - films_by_year_page = FilmsByYear.build_page(films_by_year) - bar.next() - if update_films_by_country: - films_by_country_page = FilmsByCountry.build_page(films_by_country) - bar.next() - if update_film_references: - films_by_reference_page = FilmsByReference.build_page(films_by_reference) - bar.next() - if update_hidden_themes: - hidden_themes_page = HiddenThemes.build_page(hidden_themes) - bar.next() - if update_keyword_scores: - keyword_scores_page = KeywordScores.build_page(keyword_scores) - bar.next() - - bar.finish() - with IncrementalBar('Updating pages', max=update_page_count, check_tty=False) as bar: if update_films_by_year: + films_by_year_page = FilmsByYear.build_page(films_by_year) Bookstack.update_page(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, FilmsByYear.PAGE_ID, markdown=films_by_year_page) bar.next() if update_films_by_country: + films_by_country_page = FilmsByCountry.build_page(films_by_country) Bookstack.update_page(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, FilmsByCountry.PAGE_ID, markdown=films_by_country_page) bar.next() if update_film_references: + films_by_reference_page = FilmsByReference.build_page(films_by_reference) Bookstack.update_page(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, FilmsByReference.PAGE_ID, markdown=films_by_reference_page) bar.next() if update_hidden_themes: + hidden_themes_page = HiddenThemes.build_page(hidden_themes) Bookstack.update_page(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, HiddenThemes.PAGE_ID, markdown=hidden_themes_page) bar.next() if update_keyword_scores: + keyword_scores_page = KeywordScores.build_page(keyword_scores) Bookstack.update_page(VCinemaUtils.JACKNET_WIKI_URL, token_id, token_secret, KeywordScores.PAGE_ID, markdown=keyword_scores_page) bar.next()