mirror of
https://github.com/revanced/revanced-api.git
synced 2025-05-02 15:44:33 +02:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
090111b398
commit
0538e69018
@ -108,9 +108,9 @@ class Github(Backend):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if team_view:
|
if team_view:
|
||||||
filter_contributor[
|
filter_contributor["keys"] = (
|
||||||
"keys"
|
f"{base_url.replace('api.', '')}/{filter_contributor['login']}.gpg"
|
||||||
] = f"{base_url.replace('api.', '')}/{filter_contributor['login']}.gpg"
|
)
|
||||||
|
|
||||||
return Contributor(**filter_contributor)
|
return Contributor(**filter_contributor)
|
||||||
|
|
||||||
@ -136,7 +136,9 @@ class Github(Backend):
|
|||||||
Returns:
|
Returns:
|
||||||
list[Release]: A list of Release objects.
|
list[Release]: A list of Release objects.
|
||||||
"""
|
"""
|
||||||
list_releases_endpoint: str = f"{self.repositories_rest_endpoint}/{repository.owner}/{repository.name}/releases?per_page={per_page}&page={page}"
|
list_releases_endpoint: str = (
|
||||||
|
f"{self.repositories_rest_endpoint}/{repository.owner}/{repository.name}/releases?per_page={per_page}&page={page}"
|
||||||
|
)
|
||||||
response: ClientResponse = await http_get(
|
response: ClientResponse = await http_get(
|
||||||
headers=self.headers, url=list_releases_endpoint
|
headers=self.headers, url=list_releases_endpoint
|
||||||
)
|
)
|
||||||
@ -162,7 +164,9 @@ class Github(Backend):
|
|||||||
Returns:
|
Returns:
|
||||||
Release: The Release object representing the retrieved release.
|
Release: The Release object representing the retrieved release.
|
||||||
"""
|
"""
|
||||||
release_by_tag_endpoint: str = f"{self.repositories_rest_endpoint}/{repository.owner}/{repository.name}/releases/tags/{tag_name}"
|
release_by_tag_endpoint: str = (
|
||||||
|
f"{self.repositories_rest_endpoint}/{repository.owner}/{repository.name}/releases/tags/{tag_name}"
|
||||||
|
)
|
||||||
response: ClientResponse = await http_get(
|
response: ClientResponse = await http_get(
|
||||||
headers=self.headers, url=release_by_tag_endpoint
|
headers=self.headers, url=release_by_tag_endpoint
|
||||||
)
|
)
|
||||||
@ -181,7 +185,9 @@ class Github(Backend):
|
|||||||
Returns:
|
Returns:
|
||||||
Release: The latest release for the given repository.
|
Release: The latest release for the given repository.
|
||||||
"""
|
"""
|
||||||
latest_release_endpoint: str = f"{self.repositories_rest_endpoint}/{repository.owner}/{repository.name}/releases/latest"
|
latest_release_endpoint: str = (
|
||||||
|
f"{self.repositories_rest_endpoint}/{repository.owner}/{repository.name}/releases/latest"
|
||||||
|
)
|
||||||
response: ClientResponse = await http_get(
|
response: ClientResponse = await http_get(
|
||||||
headers=self.headers, url=latest_release_endpoint
|
headers=self.headers, url=latest_release_endpoint
|
||||||
)
|
)
|
||||||
@ -200,7 +206,9 @@ class Github(Backend):
|
|||||||
Returns:
|
Returns:
|
||||||
Release: The latest pre-release for the given repository.
|
Release: The latest pre-release for the given repository.
|
||||||
"""
|
"""
|
||||||
list_releases_endpoint: str = f"{self.repositories_rest_endpoint}/{repository.owner}/{repository.name}/releases?per_page=10&page=1"
|
list_releases_endpoint: str = (
|
||||||
|
f"{self.repositories_rest_endpoint}/{repository.owner}/{repository.name}/releases?per_page=10&page=1"
|
||||||
|
)
|
||||||
response: ClientResponse = await http_get(
|
response: ClientResponse = await http_get(
|
||||||
headers=self.headers, url=list_releases_endpoint
|
headers=self.headers, url=list_releases_endpoint
|
||||||
)
|
)
|
||||||
@ -223,7 +231,9 @@ class Github(Backend):
|
|||||||
list[Contributor]: A list of contributors for the given repository.
|
list[Contributor]: A list of contributors for the given repository.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
contributors_endpoint: str = f"{self.repositories_rest_endpoint}/{repository.owner}/{repository.name}/contributors"
|
contributors_endpoint: str = (
|
||||||
|
f"{self.repositories_rest_endpoint}/{repository.owner}/{repository.name}/contributors"
|
||||||
|
)
|
||||||
response: ClientResponse = await http_get(
|
response: ClientResponse = await http_get(
|
||||||
headers=self.headers, url=contributors_endpoint
|
headers=self.headers, url=contributors_endpoint
|
||||||
)
|
)
|
||||||
|
@ -9,6 +9,7 @@ Routes:
|
|||||||
- GET /patches/<tag:str>: Retrieve a list of patches for a given release tag.
|
- GET /patches/<tag:str>: Retrieve a list of patches for a given release tag.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from sanic import Blueprint, Request
|
from sanic import Blueprint, Request
|
||||||
from sanic.response import JSONResponse, json
|
from sanic.response import JSONResponse, json
|
||||||
|
@ -21,14 +21,17 @@ class AnnouncementResponseModel(dict):
|
|||||||
id=announcement.id,
|
id=announcement.id,
|
||||||
author=announcement.author,
|
author=announcement.author,
|
||||||
title=announcement.title,
|
title=announcement.title,
|
||||||
content=ContentFields(
|
content=(
|
||||||
|
ContentFields(
|
||||||
message=announcement.message,
|
message=announcement.message,
|
||||||
attachment_urls=[
|
attachment_urls=[
|
||||||
attachment.attachment_url for attachment in announcement.attachments
|
attachment.attachment_url
|
||||||
|
for attachment in announcement.attachments
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
if announcement.message or announcement.attachments
|
if announcement.message or announcement.attachments
|
||||||
else None,
|
else None
|
||||||
|
),
|
||||||
channel=announcement.channel,
|
channel=announcement.channel,
|
||||||
created_at=str(announcement.created_at),
|
created_at=str(announcement.created_at),
|
||||||
level=announcement.level,
|
level=announcement.level,
|
||||||
|
6
app.py
6
app.py
@ -75,9 +75,9 @@ async def add_cache_control(_, response):
|
|||||||
|
|
||||||
@app.on_response
|
@app.on_response
|
||||||
async def add_csp(_, response):
|
async def add_csp(_, response):
|
||||||
response.headers[
|
response.headers["Content-Security-Policy"] = (
|
||||||
"Content-Security-Policy"
|
"default-src * 'unsafe-inline' 'unsafe-eval' data: blob:;"
|
||||||
] = "default-src * 'unsafe-inline' 'unsafe-eval' data: blob:;"
|
)
|
||||||
|
|
||||||
|
|
||||||
app.static(
|
app.static(
|
||||||
|
@ -2,8 +2,8 @@ aiodns==3.1.1 ; (sys_platform == "linux" or sys_platform == "darwin") and python
|
|||||||
aiofiles==23.2.1 ; python_version >= "3.11" and python_version < "3.13"
|
aiofiles==23.2.1 ; python_version >= "3.11" and python_version < "3.13"
|
||||||
aiohttp[speedups]==3.9.1 ; python_version >= "3.11" and python_version < "3.13"
|
aiohttp[speedups]==3.9.1 ; python_version >= "3.11" and python_version < "3.13"
|
||||||
aiosignal==1.3.1 ; python_version >= "3.11" and python_version < "3.13"
|
aiosignal==1.3.1 ; python_version >= "3.11" and python_version < "3.13"
|
||||||
argon2-cffi-bindings==21.2.0 ; python_version >= "3.11" and python_version < "3.13"
|
|
||||||
argon2-cffi==23.1.0 ; python_version >= "3.11" and python_version < "3.13"
|
argon2-cffi==23.1.0 ; python_version >= "3.11" and python_version < "3.13"
|
||||||
|
argon2-cffi-bindings==21.2.0 ; python_version >= "3.11" and python_version < "3.13"
|
||||||
asyncstdlib==3.12.0 ; python_version >= "3.11" and python_version < "3.13"
|
asyncstdlib==3.12.0 ; python_version >= "3.11" and python_version < "3.13"
|
||||||
attrs==23.2.0 ; python_version >= "3.11" and python_version < "3.13"
|
attrs==23.2.0 ; python_version >= "3.11" and python_version < "3.13"
|
||||||
beautifulsoup4==4.12.2 ; python_version >= "3.11" and python_version < "3.13"
|
beautifulsoup4==4.12.2 ; python_version >= "3.11" and python_version < "3.13"
|
||||||
@ -40,11 +40,11 @@ pyjwt==2.8.0 ; python_version >= "3.11" and python_version < "3.13"
|
|||||||
pyseto==1.7.7 ; python_version >= "3.11" and python_version < "3.13"
|
pyseto==1.7.7 ; python_version >= "3.11" and python_version < "3.13"
|
||||||
python-dateutil==2.8.2 ; python_version >= "3.11" and python_version < "3.13"
|
python-dateutil==2.8.2 ; python_version >= "3.11" and python_version < "3.13"
|
||||||
pyyaml==6.0.1 ; python_version >= "3.11" and python_version < "3.13"
|
pyyaml==6.0.1 ; python_version >= "3.11" and python_version < "3.13"
|
||||||
|
sanic==23.12.1 ; python_version >= "3.11" and python_version < "3.13"
|
||||||
sanic-beskar==2.3.2 ; python_version >= "3.11" and python_version < "3.13"
|
sanic-beskar==2.3.2 ; python_version >= "3.11" and python_version < "3.13"
|
||||||
sanic-ext==23.12.0 ; python_version >= "3.11" and python_version < "3.13"
|
sanic-ext==23.12.0 ; python_version >= "3.11" and python_version < "3.13"
|
||||||
sanic-limiter @ git+https://github.com/Omegastick/sanic-limiter@843e13144aa21d843ce212a7c1db31b72ce8a103 ; python_version >= "3.11" and python_version < "3.13"
|
sanic-limiter @ git+https://github.com/Omegastick/sanic-limiter@843e13144aa21d843ce212a7c1db31b72ce8a103 ; python_version >= "3.11" and python_version < "3.13"
|
||||||
sanic-routing==23.12.0 ; python_version >= "3.11" and python_version < "3.13"
|
sanic-routing==23.12.0 ; python_version >= "3.11" and python_version < "3.13"
|
||||||
sanic==23.12.1 ; python_version >= "3.11" and python_version < "3.13"
|
|
||||||
sanic[ext]==23.12.1 ; python_version >= "3.11" and python_version < "3.13"
|
sanic[ext]==23.12.1 ; python_version >= "3.11" and python_version < "3.13"
|
||||||
sentry-sdk[sanic]==1.39.2 ; python_version >= "3.11" and python_version < "3.13"
|
sentry-sdk[sanic]==1.39.2 ; python_version >= "3.11" and python_version < "3.13"
|
||||||
six==1.16.0 ; python_version >= "3.11" and python_version < "3.13"
|
six==1.16.0 ; python_version >= "3.11" and python_version < "3.13"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user