From d7b2254f5dce91ab5431f1a0ea17ae28fae0e9d1 Mon Sep 17 00:00:00 2001 From: scdhh Date: Fri, 11 Oct 2024 05:25:25 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E6=B7=BB=E5=8A=A0=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 3 +++ src/tsl_tools/__init__.py | 3 ++- src/tsl_tools/__main__.py | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5ba2759..67c6bd2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,6 +22,9 @@ dependencies = [ requires = ["hatchling"] build-backend = "hatchling.build" +[project.scripts] +tsl_tools = "tsl_tools:main" + [tool.uv] dev-dependencies = ["basedpyright>=1.18.4", "ruff>=0.6.1"] diff --git a/src/tsl_tools/__init__.py b/src/tsl_tools/__init__.py index 3decabe..b08de4e 100644 --- a/src/tsl_tools/__init__.py +++ b/src/tsl_tools/__init__.py @@ -222,4 +222,5 @@ def timer_callback() -> None: task.append(create_task(update_result(table, queue))) -ui.run(port=5555, show=False, dark=True, language='zh-CN', reload=False) +def main() -> None: + ui.run(port=5555, show=True, dark=True, language='zh-CN', reload=False) diff --git a/src/tsl_tools/__main__.py b/src/tsl_tools/__main__.py index e69de29..c7c70d0 100644 --- a/src/tsl_tools/__main__.py +++ b/src/tsl_tools/__main__.py @@ -0,0 +1,4 @@ +from . import main + +if __name__ == '__main__': + main()