mirror of
https://github.com/revanced/revanced-static-api.git
synced 2025-04-30 06:34:30 +02:00
refactor: remove type hinting from init methods
This commit is contained in:
parent
4b4608ddbc
commit
078a8da77f
@ -7,7 +7,7 @@ class Api:
|
|||||||
_api_key: str | None
|
_api_key: str | None
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def __init__(self, api_key: str | None = None) -> None:
|
def __init__(self, api_key: str | None = None):
|
||||||
self._api_key = api_key
|
self._api_key = api_key
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
@ -36,7 +36,7 @@ class Api:
|
|||||||
|
|
||||||
|
|
||||||
class GitHubApi(Api):
|
class GitHubApi(Api):
|
||||||
def __init__(self) -> None:
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def get_contributor(self, repository):
|
def get_contributor(self, repository):
|
||||||
|
@ -8,7 +8,7 @@ from abc import abstractmethod
|
|||||||
class Api:
|
class Api:
|
||||||
_api: api.Api
|
_api: api.Api
|
||||||
|
|
||||||
def __init__(self, name: str, api: api.Api = api.GitHubApi()) -> None:
|
def __init__(self, name: str, api: api.Api = api.GitHubApi()):
|
||||||
self.name = name
|
self.name = name
|
||||||
self._api = api
|
self._api = api
|
||||||
|
|
||||||
@ -25,9 +25,8 @@ class Api:
|
|||||||
|
|
||||||
|
|
||||||
class ReleaseApi(Api):
|
class ReleaseApi(Api):
|
||||||
def __init__(self, api) -> None:
|
def __init__(self, api):
|
||||||
super().__init__("release", api)
|
super().__init__("release", api)
|
||||||
pass
|
|
||||||
|
|
||||||
def generate(self, config, path):
|
def generate(self, config, path):
|
||||||
path = join(path, "release")
|
path = join(path, "release")
|
||||||
@ -61,9 +60,8 @@ class ReleaseApi(Api):
|
|||||||
|
|
||||||
|
|
||||||
class ContributorApi(Api):
|
class ContributorApi(Api):
|
||||||
def __init__(self, api) -> None:
|
def __init__(self, api):
|
||||||
super().__init__("contributor", api)
|
super().__init__("contributor", api)
|
||||||
pass
|
|
||||||
|
|
||||||
def generate(self, config, path):
|
def generate(self, config, path):
|
||||||
path = join(path, "contributor")
|
path = join(path, "contributor")
|
||||||
@ -81,7 +79,7 @@ class ContributorApi(Api):
|
|||||||
|
|
||||||
|
|
||||||
class SocialApi(Api):
|
class SocialApi(Api):
|
||||||
def __init__(self, api) -> None:
|
def __init__(self, api):
|
||||||
super().__init__("social", api)
|
super().__init__("social", api)
|
||||||
|
|
||||||
def generate(self, config, path):
|
def generate(self, config, path):
|
||||||
@ -96,7 +94,7 @@ class SocialApi(Api):
|
|||||||
class ApiProvider:
|
class ApiProvider:
|
||||||
_apis: list[Api]
|
_apis: list[Api]
|
||||||
|
|
||||||
def __init__(self, apis: list[Api]) -> None:
|
def __init__(self, apis: list[Api]):
|
||||||
self._apis = apis
|
self._apis = apis
|
||||||
|
|
||||||
def get(self, name: str) -> Api | None:
|
def get(self, name: str) -> Api | None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user