collect.py: cleanup code
authorPetr Štetiar <ynezz@true.cz>
Thu, 6 Aug 2020 08:25:53 +0000 (10:25 +0200)
committerPetr Štetiar <ynezz@true.cz>
Thu, 6 Aug 2020 08:33:01 +0000 (10:33 +0200)
Remove commented out code.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
misc/collect.py

index 29688e567491abef769f9f402cdf5e21dd76b024..05caa37475bf31bae8ffe966dd87ce531be7af44 100755 (executable)
@@ -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()