1
0
Fork 0

🎨 Format Python code with Black (#2582)

Co-authored-by: Salamandar <6552989+Salamandar@users.noreply.github.com>
This commit is contained in:
github-actions[bot] 2024-09-12 14:48:36 +02:00 committed by GitHub
parent f1c90b93b5
commit ebb1b75bc3
2 changed files with 27 additions and 13 deletions

View file

@ -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()

View file

@ -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()