From 19222824569794650e0aad58829fd4e0e5566af9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Petr=20=C5=A0tetiar?= Date: Thu, 6 Aug 2020 10:25:53 +0200 Subject: [PATCH] collect.py: cleanup code MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Remove commented out code. Signed-off-by: Petr Å tetiar --- misc/collect.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/misc/collect.py b/misc/collect.py index 29688e5..05caa37 100755 --- a/misc/collect.py +++ b/misc/collect.py @@ -34,8 +34,6 @@ parser_merge.add_argument( default="", help="Link to get the image from. May contain {target}, {version} and {commit}", ) -# parser_merge.add_argument("--change-prefix", -# help="Change the openwrt- file name prefix.") parser_scrape = subparsers.add_parser( "scrape", @@ -74,9 +72,6 @@ def merge_profiles(profiles, download_url): if target is None: target = profile["target"] - # if args.change_prefix: - # change_prefix(images, "openwrt-", args.change_prefix) - for entry in profile["titles"]: title = get_title(entry) @@ -129,7 +124,6 @@ def update_config(config_path, versions): content = re.sub("versions:[\\s]*{[^}]*}", f"versions: {versions}", content) with open(config_path, "w+") as file: - # save updated config file.write(content) @@ -150,7 +144,6 @@ def scrape(url, selector_path): with urllib.request.urlopen(f"{target}/?json") as file: array = json.loads(file.read().decode("utf-8")) for profile in filter(lambda x: x.endswith("/profiles.json"), array): - # print(profile) with urllib.request.urlopen(f"{target}/{profile}") as file: profiles[f"{target}/{profile}"] = file.read() return profiles @@ -231,13 +224,6 @@ def scrape_wget(url, selector_path): update_config(config_path, versions) -""" -def change_prefix(images, old_prefix, new_prefix): - for image in images: - if image["name"].startswith(old_prefix): - image["name"] = new_prefix + image["name"][len(old_prefix):] -""" - """ Find and merge json files for a single release. """ @@ -248,7 +234,6 @@ def merge(input_paths): profiles = {} def add_path(path): - # paths.append(path) with open(path, "r") as file: profiles[path] = file.read() -- 2.30.2