1
0
Fork 0

Drop legacy catalog v2 API

This commit is contained in:
Alexandre Aubin 2024-05-07 16:53:11 +02:00 committed by OniriCorpe
parent b2c29d5f81
commit 6ea680294a

View file

@ -84,26 +84,6 @@ def build_base_catalog(nproc: int):
return result_dict return result_dict
def write_catalog_v2(base_catalog, target_dir: Path) -> None:
result_dict_with_manifest_v1 = copy.deepcopy(base_catalog)
result_dict_with_manifest_v1 = {
name: infos
for name, infos in result_dict_with_manifest_v1.items()
if float(str(infos["manifest"].get("packaging_format", "")).strip() or "0") < 2
}
full_catalog = {
"apps": result_dict_with_manifest_v1,
"categories": categories_list(),
"antifeatures": antifeatures_list(),
}
target_file = target_dir / "apps.json"
target_file.parent.mkdir(parents=True, exist_ok=True)
target_file.open("w", encoding="utf-8").write(
json.dumps(full_catalog, sort_keys=True)
)
def write_catalog_v3(base_catalog, target_dir: Path) -> None: def write_catalog_v3(base_catalog, target_dir: Path) -> None:
result_dict_with_manifest_v2 = copy.deepcopy(base_catalog) result_dict_with_manifest_v2 = copy.deepcopy(base_catalog)
for app in result_dict_with_manifest_v2.values(): for app in result_dict_with_manifest_v2.values():
@ -287,7 +267,6 @@ def main() -> None:
catalog = build_base_catalog(args.jobs) catalog = build_base_catalog(args.jobs)
print(f"Writing the catalogs to {args.target_dir}...") print(f"Writing the catalogs to {args.target_dir}...")
write_catalog_v2(catalog, args.target_dir / "v2")
write_catalog_v3(catalog, args.target_dir / "v3") write_catalog_v3(catalog, args.target_dir / "v3")
write_catalog_doc(catalog, args.target_dir / "doc_catalog") write_catalog_doc(catalog, args.target_dir / "doc_catalog")
print("Done!") print("Done!")