mirror of
https://github.com/revanced/revanced-static-api.git
synced 2025-04-29 22:24:37 +02:00
chore: Format code
This commit is contained in:
parent
ac35644962
commit
318fa8b47d
@ -34,7 +34,6 @@ class Api:
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
@abstractmethod
|
||||
def get_members(self, organization):
|
||||
'''Gets the team for an organization.
|
||||
@ -116,7 +115,8 @@ class GitHubApi(Api):
|
||||
releases: list = requests.get(
|
||||
f"https://api.github.com/repos/{repository}/releases"
|
||||
).json()
|
||||
return list(map(transform_release, releases)) # List might not be needed.
|
||||
# List might not be needed.
|
||||
return list(map(transform_release, releases))
|
||||
else:
|
||||
latest_release: dict = requests.get(
|
||||
f"https://api.github.com/repos/{repository}/releases/latest?prerelease={prerelease}"
|
||||
@ -143,4 +143,4 @@ class GitHubApi(Api):
|
||||
members = requests.get(
|
||||
f'https://api.github.com/orgs/{organization}/members').json()
|
||||
# List might not be needed.
|
||||
return list(map(transform_team_member, members))
|
||||
return list(map(transform_team_member, members))
|
||||
|
@ -44,7 +44,8 @@ class ReleaseApi(Api):
|
||||
|
||||
create_if_not_exists(release_path)
|
||||
|
||||
write_json(release_json, join(release_path, f"{tag}.json"), overwrite=False)
|
||||
write_json(release_json, join(
|
||||
release_path, f"{tag}.json"), overwrite=False)
|
||||
write_json(
|
||||
release_json, join(release_path, "latest.json")
|
||||
) # Overwrite the latest release
|
||||
@ -89,6 +90,7 @@ class SocialApi(Api):
|
||||
|
||||
write_json(new_social, social_path)
|
||||
|
||||
|
||||
class TeamApi(Api):
|
||||
def __init__(self, api):
|
||||
super().__init__("team", api)
|
||||
@ -102,6 +104,7 @@ class TeamApi(Api):
|
||||
|
||||
write_json(team, team_path)
|
||||
|
||||
|
||||
class DonationApi(Api):
|
||||
def __init__(self, api):
|
||||
super().__init__("donation", api)
|
||||
@ -113,6 +116,7 @@ class DonationApi(Api):
|
||||
|
||||
write_json(donation, donation_path)
|
||||
|
||||
|
||||
class ApiProvider:
|
||||
_apis: list[Api]
|
||||
|
||||
@ -129,8 +133,8 @@ class ApiProvider:
|
||||
|
||||
class DefaultApiProvider(ApiProvider):
|
||||
def __init__(self):
|
||||
self._api = api.GitHubApi() # Use GitHub as default api
|
||||
|
||||
self._api = api.GitHubApi() # Use GitHub as default api
|
||||
|
||||
super().__init__([
|
||||
ReleaseApi(self._api),
|
||||
ContributorApi(self._api),
|
||||
|
Loading…
x
Reference in New Issue
Block a user