mirror of
https://github.com/revanced/revanced-static-api.git
synced 2025-04-29 22:24:37 +02:00
refactor: remove unnecessary use of pass
This commit is contained in:
parent
ba9a868394
commit
cb1076eda4
@ -10,7 +10,6 @@ class Api():
|
|||||||
def __init__(self, name: str, api: api.Api = api.GitHubApi()) -> None:
|
def __init__(self, name: str, api: api.Api = api.GitHubApi()) -> None:
|
||||||
self.name = name
|
self.name = name
|
||||||
self._api = api
|
self._api = api
|
||||||
pass
|
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def generate(self, config, path):
|
def generate(self, config, path):
|
||||||
@ -55,7 +54,6 @@ class ReleaseApi(Api):
|
|||||||
index.append(tag) # Add the current tag to the index
|
index.append(tag) # Add the current tag to the index
|
||||||
|
|
||||||
write_json(index, index_path)
|
write_json(index, index_path)
|
||||||
pass
|
|
||||||
|
|
||||||
class ContributorApi(Api):
|
class ContributorApi(Api):
|
||||||
def __init__(self, api) -> None:
|
def __init__(self, api) -> None:
|
||||||
@ -75,12 +73,10 @@ class ContributorApi(Api):
|
|||||||
contributors_path = join(path, f'{repository_name}.json')
|
contributors_path = join(path, f'{repository_name}.json')
|
||||||
|
|
||||||
write_json(contributors, contributors_path)
|
write_json(contributors, contributors_path)
|
||||||
pass
|
|
||||||
|
|
||||||
class SocialApi(Api):
|
class SocialApi(Api):
|
||||||
def __init__(self, api) -> None:
|
def __init__(self, api) -> None:
|
||||||
super().__init__("social", api)
|
super().__init__("social", api)
|
||||||
pass
|
|
||||||
|
|
||||||
def generate(self, config, path):
|
def generate(self, config, path):
|
||||||
new_social = config
|
new_social = config
|
||||||
@ -89,14 +85,12 @@ class SocialApi(Api):
|
|||||||
social = read_json(social_path, new_social)
|
social = read_json(social_path, new_social)
|
||||||
|
|
||||||
write_json(social, social_path)
|
write_json(social, social_path)
|
||||||
pass
|
|
||||||
|
|
||||||
class ApiProvider():
|
class ApiProvider():
|
||||||
_apis: list[Api]
|
_apis: list[Api]
|
||||||
|
|
||||||
def __init__(self, apis: list[Api]) -> None:
|
def __init__(self, apis: list[Api]) -> None:
|
||||||
self._apis = apis
|
self._apis = apis
|
||||||
pass
|
|
||||||
|
|
||||||
def get(self, name: str) -> Api:
|
def get(self, name: str) -> Api:
|
||||||
for api in self._apis:
|
for api in self._apis:
|
||||||
@ -114,4 +108,3 @@ class DefaultApiProvider(ApiProvider):
|
|||||||
ContributorApi(self._api),
|
ContributorApi(self._api),
|
||||||
SocialApi(self._api)]
|
SocialApi(self._api)]
|
||||||
)
|
)
|
||||||
pass
|
|
Loading…
x
Reference in New Issue
Block a user