Get this JSON generator over the line

This commit is contained in:
decentral1se 2021-04-01 21:40:38 +02:00
parent e881f8007e
commit 26e839ea7b
Signed by untrusted user who does not match committer: decentral1se
GPG Key ID: 92DAD76BD9567B8A
1 changed files with 5 additions and 5 deletions

View File

@ -55,7 +55,7 @@ def gen_apps_json():
"category": "apps", "category": "apps",
"repository": f"https://git.autonomic.zone/coop-cloud/{app}.git", "repository": f"https://git.autonomic.zone/coop-cloud/{app}.git",
"features": get_app_features(app_path), "features": get_app_features(app_path),
"versions": get_app_versions(), "versions": get_app_versions(app_path),
} }
return apps_json return apps_json
@ -68,13 +68,13 @@ def get_app_features(app_path):
contents = handle.read() contents = handle.read()
for match in findall(r"\*\*.*\s\*", contents): for match in findall(r"\*\*.*\s\*", contents):
title = search(r"\*\*.*\*\*", match).group().replace("*", "").lower() title = search(r"(?<=\*\*).*(?=\*\*)", match).group().lower()
if title == "image": if title == "image":
value = { value = {
"image": search(r"(?<=`).*(?=`)", match).group(), "image": search(r"(?<=`).*(?=`)", match).group(),
"url": search(r"(?<=\().*(?=\))", match).group(), "url": search(r"(?<=\().*(?=\))", match).group(),
"rating": "", "rating": match.split(",")[1].strip(),
"source": "", "source": match.split(",")[-1].replace("*", "").strip(),
} }
else: else:
value = match.split(":")[-1].replace("*", "").strip() value = match.split(":")[-1].replace("*", "").strip()
@ -87,7 +87,7 @@ def get_app_versions(app_path):
versions = {} versions = {}
chdir(app_path) chdir(app_path)
tags = check_output(f"git tag --list").strip() tags = check_output(f"git tag --list", shell=True).strip()
for tag in tags: for tag in tags:
# TODO # TODO
# checkout that tag in the local git branch # checkout that tag in the local git branch