Run formatter over this

This commit is contained in:
decentral1se 2021-04-28 10:35:01 +02:00
parent be3fd59c8c
commit 78b9b8589e
Signed by untrusted user who does not match committer: decentral1se
GPG Key ID: 92DAD76BD9567B8A

View File

@ -33,7 +33,7 @@ REPOS_TO_SKIP = (
"pyabra",
"stack-ssh-deploy",
"radicle-seed-node",
"coturn"
"coturn",
)
log = getLogger(__name__)
@ -80,7 +80,6 @@ def get_repos_json():
exit(1)
def get_published_apps_json():
"""Retrieve already published apps json."""
url = "https://apps.coopcloud.tech"
@ -130,7 +129,7 @@ def generate_apps_json(repos_json):
log.info(f"Skipping {app}")
continue
repo_details = next(filter(lambda x: x['name'] == app, repos_json), {})
repo_details = next(filter(lambda x: x["name"] == app, repos_json), {})
app_path = f"{CLONES_PATH}/{app}"
chdir(app_path)
@ -153,7 +152,7 @@ def generate_apps_json(repos_json):
# not.
"features": metadata,
"versions": get_app_versions(app_path, cached_apps_json),
"icon": repo_details.get("avatar_url", "")
"icon": repo_details.get("avatar_url", ""),
}
return apps_json
@ -217,8 +216,7 @@ def get_app_versions(app_path, cached_apps_json):
existing_tags = []
for tag in tags:
_run_cmd(f"git checkout {tag}",
stderr=DEVNULL)
_run_cmd(f"git checkout {tag}", stderr=DEVNULL)
services_cmd = f"{YQ_PATH} e '.services | keys | .[]' compose*.yml"
services = _run_cmd(services_cmd, shell=True).split()
@ -229,7 +227,10 @@ def get_app_versions(app_path, cached_apps_json):
if service in ("null", "---"):
continue
if tag in existing_tags and service in cached_apps_json[app_name]["versions"][tag]:
if (
tag in existing_tags
and service in cached_apps_json[app_name]["versions"][tag]
):
log.info(f"Skipping {tag} because we've already processed it")
existing_versions = cached_apps_json[app_name]["versions"][tag][service]
service_versions[service] = existing_versions