Merge pull request #2148 from YunoHost/actions/black
Format Python code with Black
This commit is contained in:
commit
c5fcaf10bd
1 changed files with 4 additions and 3 deletions
|
@ -18,10 +18,12 @@ app = Sanic(__name__)
|
||||||
def github_webhook_secret() -> str:
|
def github_webhook_secret() -> str:
|
||||||
return Path("github_webhook_secret").resolve().open(encoding="utf-8").read().strip()
|
return Path("github_webhook_secret").resolve().open(encoding="utf-8").read().strip()
|
||||||
|
|
||||||
|
|
||||||
@cache
|
@cache
|
||||||
def github_login() -> str:
|
def github_login() -> str:
|
||||||
return Path("login").resolve().open(encoding="utf-8").read().strip()
|
return Path("login").resolve().open(encoding="utf-8").read().strip()
|
||||||
|
|
||||||
|
|
||||||
@cache
|
@cache
|
||||||
def github_token() -> str:
|
def github_token() -> str:
|
||||||
return Path("token").resolve().open(encoding="utf-8").read().strip()
|
return Path("token").resolve().open(encoding="utf-8").read().strip()
|
||||||
|
@ -67,7 +69,7 @@ async def on_push(request: Request) -> HTTPResponse:
|
||||||
f"https://{github_login()}:{github_token()}@github.com/{repository}",
|
f"https://{github_login()}:{github_token()}@github.com/{repository}",
|
||||||
to_path=folder,
|
to_path=folder,
|
||||||
single_branch=True,
|
single_branch=True,
|
||||||
branch=branch
|
branch=branch,
|
||||||
)
|
)
|
||||||
|
|
||||||
generate_READMEs(folder)
|
generate_READMEs(folder)
|
||||||
|
@ -80,8 +82,7 @@ async def on_push(request: Request) -> HTTPResponse:
|
||||||
return response.text("nothing to do")
|
return response.text("nothing to do")
|
||||||
|
|
||||||
repo.index.commit(
|
repo.index.commit(
|
||||||
"Auto-update READMEs",
|
"Auto-update READMEs", author=Actor("yunohost-bot", "yunohost@yunohost.org")
|
||||||
author=Actor("yunohost-bot", "yunohost@yunohost.org")
|
|
||||||
)
|
)
|
||||||
repo.remote().push(quiet=False)
|
repo.remote().push(quiet=False)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue