refactor: put classes together
This commit is contained in:
parent
691e175370
commit
bdee9f46e3
|
@ -27,6 +27,17 @@ class Extension(NamedTuple):
|
||||||
db_name: Optional[str] = None
|
db_name: Optional[str] = None
|
||||||
version: Optional[str] = ""
|
version: Optional[str] = ""
|
||||||
|
|
||||||
|
class InstallableExtension(NamedTuple):
|
||||||
|
id: str
|
||||||
|
name: str
|
||||||
|
archive: str
|
||||||
|
hash: str
|
||||||
|
short_description: Optional[str] = None
|
||||||
|
details: Optional[str] = None
|
||||||
|
icon: Optional[str] = None
|
||||||
|
dependencies: List[str] = []
|
||||||
|
is_admin_only: bool = False
|
||||||
|
version: Optional[int] = 0
|
||||||
|
|
||||||
class ExtensionManager:
|
class ExtensionManager:
|
||||||
def __init__(self, include_disabled_exts=False):
|
def __init__(self, include_disabled_exts=False):
|
||||||
|
@ -119,18 +130,6 @@ class InstalledExtensionMiddleware:
|
||||||
await self.app(scope, receive, send)
|
await self.app(scope, receive, send)
|
||||||
|
|
||||||
|
|
||||||
class InstallableExtension(NamedTuple):
|
|
||||||
id: str
|
|
||||||
name: str
|
|
||||||
archive: str
|
|
||||||
hash: str
|
|
||||||
short_description: Optional[str] = None
|
|
||||||
details: Optional[str] = None
|
|
||||||
icon: Optional[str] = None
|
|
||||||
dependencies: List[str] = []
|
|
||||||
is_admin_only: bool = False
|
|
||||||
|
|
||||||
|
|
||||||
def get_valid_extensions(include_disabled_exts=False) -> List[Extension]:
|
def get_valid_extensions(include_disabled_exts=False) -> List[Extension]:
|
||||||
return [
|
return [
|
||||||
extension
|
extension
|
||||||
|
|
Loading…
Reference in New Issue
Block a user