From 8730970956125ecb20db18f2bd6241d34afefd48 Mon Sep 17 00:00:00 2001 From: Trent Palmer Date: Wed, 8 Sep 2021 13:14:34 -0700 Subject: [PATCH] add get_corrected_min_ver() rank_hugo_themes.py --- rank_hugo_themes.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/rank_hugo_themes.py b/rank_hugo_themes.py index 34e7bce..3c2ba50 100755 --- a/rank_hugo_themes.py +++ b/rank_hugo_themes.py @@ -526,8 +526,9 @@ def parse_themes_toml_for_each_hugo_themes(): else: if theme.theme_license is not None: theme.theme_license = None if 'min_version' in theme_toml: - if theme.min_ver != theme_toml['min_version']: - theme.min_ver = theme_toml['min_version'] + corrected_mv = get_corrected_min_ver(theme_toml['min_version']) + if theme.min_ver != corrected_mv: + theme.min_ver = corrected_mv else: if theme.min_ver is not None: theme.min_ver = None if 'description' in theme_toml: @@ -552,6 +553,13 @@ def parse_themes_toml_for_each_hugo_themes(): session.commit() +def get_corrected_min_ver(x): + if 'o' in str(x): + return x.replace('o', '0') + else: + return x + + def generate_report(): session = sessionmaker(bind=engine)() hugo_themes = [