refactor: put classes together

This commit is contained in:
Vlad Stan 2022-11-30 11:16:10 +02:00
parent 691e175370
commit bdee9f46e3

View File

@ -27,6 +27,17 @@ class Extension(NamedTuple):
db_name: Optional[str] = None
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:
def __init__(self, include_disabled_exts=False):
@ -119,18 +130,6 @@ class InstalledExtensionMiddleware:
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]:
return [
extension