尝试 0.1.1 版本 + 命令行 cli 构建中

尝试用 Typer 构建命令行入口 manage.py 。
在 pyproject.toml 中完成有关设计,计划使用 suanapi 命令调用 manage.py 。
This commit is contained in:
2026-04-24 16:23:51 +08:00
parent 16ff315a30
commit 8db1d27758
7 changed files with 137 additions and 3 deletions

9
cli/__init__.py Normal file
View File

@@ -0,0 +1,9 @@
from .message import ALREADY_INIT_MESSAGE, NOT_INIT_MESSAGE
from .path import DATA_DIR, TEMP_DIR
__all__ = [
DATA_DIR,
TEMP_DIR,
NOT_INIT_MESSAGE,
ALREADY_INIT_MESSAGE,
]

9
cli/message.py Normal file
View File

@@ -0,0 +1,9 @@
NOT_INIT_MESSAGE = """
❓ 当前目录或指定目录下[yellow]似乎还没有执行过初始化命令[/yellow]。
❓ 你也许需要先执行 [green]suanapi init[/green] 。
"""
ALREADY_INIT_MESSAGE = """
❕ 当前目录或指定目录下[yellow]似乎已经执行初始化命令过[/yellow]。
❕ 你也许需要先删除已经存在的 [blue]data[/blue] 和 [blue]temp[/blue] 目录。
"""

4
cli/path.py Normal file
View File

@@ -0,0 +1,4 @@
from pathlib import Path
DATA_DIR = Path.cwd() / "data"
TEMP_DIR = Path.cwd() / "temp"