From d765c5b027ae7d60ebfcaa2d31eede3938bf94e9 Mon Sep 17 00:00:00 2001 From: onyx-and-iris <75868496+onyx-and-iris@users.noreply.github.com> Date: Fri, 28 Oct 2022 21:07:14 +0100 Subject: [PATCH] add poetry script --- examples/xair-obs/__main__.py | 6 +++++- pyproject.toml | 3 +++ xair_api/xair.py | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/examples/xair-obs/__main__.py b/examples/xair-obs/__main__.py index 49aaafa..e3b7499 100644 --- a/examples/xair-obs/__main__.py +++ b/examples/xair-obs/__main__.py @@ -26,10 +26,14 @@ class Observer: print(f"Mute Group 1 is {self._mixer.config.mute_group[0].on}") -if __name__ == "__main__": +def main(): with xair_api.connect("MR18", ip="mixer.local") as mixer: Observer(mixer) while cmd := input(" to exit\n"): if not cmd: break + + +if __name__ == "__main__": + main() diff --git a/pyproject.toml b/pyproject.toml index 0d429df..dc094c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,3 +21,6 @@ isort = "^5.10.1" [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" + +[tool.poetry.scripts] +obs = "examples.xair-obs.__main__:main" diff --git a/xair_api/xair.py b/xair_api/xair.py index 7da229c..b008699 100644 --- a/xair_api/xair.py +++ b/xair_api/xair.py @@ -109,7 +109,7 @@ def _make_remote(kind: KindMap) -> XAirRemote: """ Creates a new XAIR remote class. - The returned class will subclass MAirRemote. + The returned class will subclass XAirRemote. """ def init(self, *args, **kwargs):