From 78b9b8589e59fb618fd94135f27885b22cd4dba9 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Wed, 28 Apr 2021 10:35:01 +0200 Subject: [PATCH] Run formatter over this --- bin/app-json.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/bin/app-json.py b/bin/app-json.py index a0b3012..2d45daa 100755 --- a/bin/app-json.py +++ b/bin/app-json.py @@ -33,7 +33,7 @@ REPOS_TO_SKIP = ( "pyabra", "stack-ssh-deploy", "radicle-seed-node", - "coturn" + "coturn", ) log = getLogger(__name__) @@ -70,7 +70,7 @@ def get_repos_json(): try: while response: log.info(f"Trying to fetch page {page}") - response = get(url + f"?page={page}",timeout=10).json() + response = get(url + f"?page={page}", timeout=10).json() repos.extend(response) page += 1 @@ -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