mirror of
https://github.com/fusion44/blitz_api.git
synced 2026-08-13 11:52:45 +02:00
feat: get rid of Impl in class names
This commit is contained in:
parent
e67b07299b
commit
b181c86b2e
4 changed files with 22 additions and 9 deletions
|
|
@ -6,11 +6,11 @@ PLATFORM = config("platform", default=APIPlatform.RASPIBLITZ)
|
|||
apps = None
|
||||
|
||||
if PLATFORM == APIPlatform.RASPIBLITZ:
|
||||
from .apps_impl.raspiblitz import RaspiBlitzAppsImpl as AppsImpl
|
||||
from .apps_impl.raspiblitz import RaspiBlitzApps as Apps
|
||||
elif PLATFORM == APIPlatform.NATIVE_PYTHON:
|
||||
from .apps_impl.native_python import NativePythonAppsImpl as AppsImpl
|
||||
from .apps_impl.native_python import NativePythonApps as Apps
|
||||
|
||||
apps = AppsImpl()
|
||||
apps = Apps()
|
||||
|
||||
if apps is None:
|
||||
raise RuntimeError(f"Unknown platform {PLATFORM}")
|
||||
|
|
|
|||
|
|
@ -1,5 +1,18 @@
|
|||
from app.repositories.apps_impl.apps_base import AppsBase
|
||||
|
||||
|
||||
class NativePythonAppsImpl(AppsBase):
|
||||
pass
|
||||
class NativePythonApps(AppsBase):
|
||||
async def get_app_status_single(self, app_id: str):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def get_app_status(self):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def get_app_status_sub(self):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def install_app_sub(self, app_id: str):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def uninstall_app_sub(self, app_id: str, delete_data: bool):
|
||||
raise NotImplementedError()
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ SHELL_SCRIPT_PATH = config("shell_script_path")
|
|||
node_type = config("ln_node")
|
||||
|
||||
|
||||
class RaspiBlitzAppsImpl(AppsBase):
|
||||
class RaspiBlitzApps(AppsBase):
|
||||
async def get_app_status_single(self, app_id):
|
||||
|
||||
if app_id not in available_app_ids:
|
||||
|
|
|
|||
|
|
@ -20,17 +20,17 @@ if PLATFORM == APIPlatform.RASPIBLITZ:
|
|||
get_hardware_info_impl,
|
||||
)
|
||||
|
||||
from .system_impl.raspiblitz import RaspiBlitzSystem as SystemImpl
|
||||
from .system_impl.raspiblitz import RaspiBlitzSystem as System
|
||||
elif PLATFORM == APIPlatform.NATIVE_PYTHON:
|
||||
from app.repositories.hardware_impl.native_python import (
|
||||
HW_INFO_YIELD_TIME,
|
||||
get_hardware_info_impl,
|
||||
)
|
||||
|
||||
from .system_impl.native_python import NativePythonSystem as SystemImpl
|
||||
from .system_impl.native_python import NativePythonSystem as System
|
||||
|
||||
|
||||
system = SystemImpl()
|
||||
system = System()
|
||||
|
||||
if system is None:
|
||||
raise RuntimeError(f"Unknown platform {PLATFORM}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue