From: Petr Štetiar Date: Thu, 6 Aug 2020 08:25:53 +0000 (+0200) Subject: collect.py: cleanup code X-Git-Tag: v3.0.0~36 X-Git-Url: http://git.openwrt.org/feed/routing.git;lede-17.01?a=commitdiff_plain;h=19222824569794650e0aad58829fd4e0e5566af9;p=web%2Ffirmware-selector-openwrt-org.git collect.py: cleanup code Remove commented out code. Signed-off-by: Petr Štetiar --- 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()