diff --git a/pyproject.toml b/pyproject.toml index d0a4f21..c97c5d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,9 +26,7 @@ version = "0.2.10" [project.scripts] autofmt = "pyflowx.cli.autofmt:main" bumpversion = "pyflowx.cli.bumpversion:main" -clr = "pyflowx.cli.clearscreen:main" emlman = "pyflowx.cli.emlmanager:main" -envdev = "pyflowx.cli.envdev:main" filedate = "pyflowx.cli.filedate:main" filelvl = "pyflowx.cli.filelevel:main" foldback = "pyflowx.cli.folderback:main" @@ -44,8 +42,12 @@ reseticon = "pyflowx.cli.reseticoncache:main" scrcap = "pyflowx.cli.screenshot:main" sglang = "pyflowx.cli.llm.sglang:main" sshcopy = "pyflowx.cli.sshcopyid:main" -taskk = "pyflowx.cli.taskkill:main" -wch = "pyflowx.cli.which:main" +# dev +envdev = "pyflowx.cli.dev.envdev:main" +# system +clr = "pyflowx.cli.system.clearscreen:main" +taskk = "pyflowx.cli.system.taskkill:main" +wch = "pyflowx.cli.system.which:main" [project.optional-dependencies] dev = [ diff --git a/src/pyflowx/cli/dev/__init__.py b/src/pyflowx/cli/dev/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/pyflowx/cli/envdev.py b/src/pyflowx/cli/dev/envdev.py similarity index 100% rename from src/pyflowx/cli/envdev.py rename to src/pyflowx/cli/dev/envdev.py diff --git a/src/pyflowx/cli/system/__init__.py b/src/pyflowx/cli/system/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/pyflowx/cli/clearscreen.py b/src/pyflowx/cli/system/clearscreen.py similarity index 100% rename from src/pyflowx/cli/clearscreen.py rename to src/pyflowx/cli/system/clearscreen.py diff --git a/src/pyflowx/cli/taskkill.py b/src/pyflowx/cli/system/taskkill.py similarity index 98% rename from src/pyflowx/cli/taskkill.py rename to src/pyflowx/cli/system/taskkill.py index a07148b..3cb261c 100644 --- a/src/pyflowx/cli/taskkill.py +++ b/src/pyflowx/cli/system/taskkill.py @@ -35,6 +35,6 @@ def main() -> None: [ px.TaskSpec(f"kill_{proc_name}", cmd=[*cmd, f"{proc_name}*"], verbose=True) for proc_name in args.process_names - ] + ], ) px.run(graph, strategy="thread") diff --git a/src/pyflowx/cli/which.py b/src/pyflowx/cli/system/which.py similarity index 100% rename from src/pyflowx/cli/which.py rename to src/pyflowx/cli/system/which.py diff --git a/src/pyflowx/tasks/system.py b/src/pyflowx/tasks/system.py index 4ca1c6d..eb60dc4 100644 --- a/src/pyflowx/tasks/system.py +++ b/src/pyflowx/tasks/system.py @@ -6,6 +6,15 @@ from __future__ import annotations +__all__ = [ + "clr", + "reset_icon_cache", + "setenv", + "setenv_group", + "which", + "write_file", +] + import os import subprocess from pathlib import Path @@ -111,6 +120,3 @@ def write_file(path: str, content: str, encoding: str = "utf-8") -> px.TaskSpec: print(f"写入文件 {path} 失败: {e}") return px.TaskSpec(f"write_file_{path}", fn=write, verbose=True) - - -__all__ = ["clr", "reset_icon_cache", "setenv", "setenv_group", "which", "write_file"] diff --git a/tests/cli/test_clearscreen.py b/tests/cli/test_clearscreen.py index c2f8171..7ce53af 100644 --- a/tests/cli/test_clearscreen.py +++ b/tests/cli/test_clearscreen.py @@ -5,7 +5,7 @@ from __future__ import annotations from unittest.mock import patch import pyflowx as px -from pyflowx.cli import clearscreen +from pyflowx.cli.system import clearscreen # ---------------------------------------------------------------------- # diff --git a/tests/cli/test_taskkill.py b/tests/cli/test_taskkill.py index e137d42..f9e7d6c 100644 --- a/tests/cli/test_taskkill.py +++ b/tests/cli/test_taskkill.py @@ -7,7 +7,7 @@ from unittest.mock import patch import pytest import pyflowx as px -from pyflowx.cli import taskkill +from pyflowx.cli.system import taskkill from pyflowx.conditions import Constants