diff --git a/autopatches/autopatch.py b/autopatches/autopatch.py index c462738..cfc3742 100755 --- a/autopatches/autopatch.py +++ b/autopatches/autopatch.py @@ -24,12 +24,8 @@ my_env = os.environ.copy() my_env["GIT_TERMINAL_PROMPT"] = "0" os.makedirs(".apps_cache", exist_ok=True) -login = ( - (TOOLS_DIR / ".github_login").open("r", encoding="utf-8").read().strip() -) -token = ( - (TOOLS_DIR / ".github_token").open("r", encoding="utf-8").read().strip() -) +login = (TOOLS_DIR / ".github_login").open("r", encoding="utf-8").read().strip() +token = (TOOLS_DIR / ".github_token").open("r", encoding="utf-8").read().strip() github_api = "https://api.github.com" @@ -196,11 +192,24 @@ def create_pull_request(repo, patch, base_branch, s): def main(): parser = argparse.ArgumentParser() - parser.add_argument("the_patch", type=str, nargs="?", help="The name of the patch to apply") - parser.add_argument("--cache", "-b", action="store_true", help="Init local git clone for all apps") - parser.add_argument("--apply", "-a", action="store_true", help="Apply patch on all local clones") - parser.add_argument("--diff", "-d", action="store_true", help="Inspect diff for all apps") - parser.add_argument("--push", "-p", action="store_true", help="Push and create pull requests on all apps with non-empty diff") + parser.add_argument( + "the_patch", type=str, nargs="?", help="The name of the patch to apply" + ) + parser.add_argument( + "--cache", "-b", action="store_true", help="Init local git clone for all apps" + ) + parser.add_argument( + "--apply", "-a", action="store_true", help="Apply patch on all local clones" + ) + parser.add_argument( + "--diff", "-d", action="store_true", help="Inspect diff for all apps" + ) + parser.add_argument( + "--push", + "-p", + action="store_true", + help="Push and create pull requests on all apps with non-empty diff", + ) args = parser.parse_args() if not (args.cache or args.apply or args.diff or args.push): @@ -222,4 +231,5 @@ def main(): parser.error("--push requires the patch name to be passed") push(args.the_patch) + main() diff --git a/readme_generator/make_readme.py b/readme_generator/make_readme.py index 764d744..f664b8d 100755 --- a/readme_generator/make_readme.py +++ b/readme_generator/make_readme.py @@ -194,8 +194,12 @@ def generate_READMEs(app_path: Path, apps_repo_path: Path): def main(): - parser = argparse.ArgumentParser(description="Automatically (re)generate README for apps") - parser.add_argument("app_path", type=Path, help="Path to the app to generate/update READMEs for") + parser = argparse.ArgumentParser( + description="Automatically (re)generate README for apps" + ) + parser.add_argument( + "app_path", type=Path, help="Path to the app to generate/update READMEs for" + ) get_apps_repo.add_args(parser) args = parser.parse_args()