Get this JSON generator over the line
This commit is contained in:
parent
e881f8007e
commit
26e839ea7b
10
app-json.py
10
app-json.py
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user