mirror of
https://github.com/onyx-and-iris/obsws-cli.git
synced 2025-06-07 20:20:32 +01:00
dry up the imports
This commit is contained in:
parent
868d40ec8d
commit
723d79e306
@ -1,5 +1,6 @@
|
|||||||
"""Command line interface for the OBS WebSocket API."""
|
"""Command line interface for the OBS WebSocket API."""
|
||||||
|
|
||||||
|
import importlib
|
||||||
from typing import Annotated
|
from typing import Annotated
|
||||||
|
|
||||||
import obsws_python as obsws
|
import obsws_python as obsws
|
||||||
@ -8,45 +9,29 @@ from rich.console import Console
|
|||||||
|
|
||||||
from obsws_cli.__about__ import __version__ as obsws_cli_version
|
from obsws_cli.__about__ import __version__ as obsws_cli_version
|
||||||
|
|
||||||
from . import (
|
from . import settings
|
||||||
filter,
|
|
||||||
group,
|
|
||||||
hotkey,
|
|
||||||
input,
|
|
||||||
profile,
|
|
||||||
projector,
|
|
||||||
record,
|
|
||||||
replaybuffer,
|
|
||||||
scene,
|
|
||||||
scenecollection,
|
|
||||||
sceneitem,
|
|
||||||
screenshot,
|
|
||||||
settings,
|
|
||||||
stream,
|
|
||||||
studiomode,
|
|
||||||
virtualcam,
|
|
||||||
)
|
|
||||||
from .alias import AliasGroup
|
from .alias import AliasGroup
|
||||||
|
|
||||||
app = typer.Typer(cls=AliasGroup)
|
app = typer.Typer(cls=AliasGroup)
|
||||||
for module in (
|
for sub_typer in [
|
||||||
filter,
|
'filter',
|
||||||
group,
|
'group',
|
||||||
hotkey,
|
'hotkey',
|
||||||
input,
|
'input',
|
||||||
projector,
|
'profile',
|
||||||
profile,
|
'projector',
|
||||||
record,
|
'record',
|
||||||
replaybuffer,
|
'replaybuffer',
|
||||||
scene,
|
'scene',
|
||||||
scenecollection,
|
'scenecollection',
|
||||||
sceneitem,
|
'sceneitem',
|
||||||
screenshot,
|
'screenshot',
|
||||||
stream,
|
'stream',
|
||||||
studiomode,
|
'studiomode',
|
||||||
virtualcam,
|
'virtualcam',
|
||||||
):
|
]:
|
||||||
app.add_typer(module.app, name=module.__name__.split('.')[-1])
|
module = importlib.import_module(f'.{sub_typer}', package=__package__)
|
||||||
|
app.add_typer(module.app, name=sub_typer)
|
||||||
|
|
||||||
out_console = Console()
|
out_console = Console()
|
||||||
err_console = Console(stderr=True)
|
err_console = Console(stderr=True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user