add get_corrected_min_ver() rank_hugo_themes.py

This commit is contained in:
Trent Palmer 2021-09-08 13:14:34 -07:00
parent 47563d3cef
commit 8730970956
1 changed files with 10 additions and 2 deletions

View File

@ -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 = [