Skip to content

Commit fc6fb8d

Browse files
authored
Refactor: 硬编码 NoneBot LOGO 并移除 pyfiglet 依赖 (#170)
* ♻️ make logo hard-coded instead of calling pyfiglet * ➖ remove pyfiglet since not needed
1 parent df45e19 commit fc6fb8d

File tree

3 files changed

+17
-39
lines changed

3 files changed

+17
-39
lines changed

nb_cli/handlers/meta.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,24 @@
1919
from . import templates
2020
from .process import create_process, create_process_shell
2121

22-
try:
23-
from pyfiglet import figlet_format
24-
except ModuleNotFoundError as e:
25-
if e.name == "pkg_resources":
26-
raise ModuleNotFoundError("Please install setuptools to use pyfiglet") from e
27-
raise
28-
2922
R = TypeVar("R")
3023
P = ParamSpec("P")
3124

3225
DEFAULT_PYTHON = ("python3", "python")
3326
WINDOWS_DEFAULT_PYTHON = ("python",)
3427

28+
_LOGO = """
29+
d8b db .d88b. d8b db d88888b d8888b. .d88b. d888888b
30+
888o 88 .8P Y8. 888o 88 88' 88 `8D .8P Y8. `~~88~~'
31+
88V8o 88 88 88 88V8o 88 88ooooo 88oooY' 88 88 88
32+
88 V8o88 88 88 88 V8o88 88~~~~~ 88~~~b. 88 88 88
33+
88 V888 `8b d8' 88 V888 88. 88 8D `8b d8' 88
34+
VP V8P `Y88P' VP V8P Y88888P Y8888P' `Y88P' YP
35+
"""
36+
3537

3638
def draw_logo() -> str:
37-
return figlet_format("NoneBot", font="basic").strip()
39+
return _LOGO.strip()
3840

3941

4042
def get_config_manager(cwd: Path | None = None) -> ConfigManager:

pdm.lock

Lines changed: 7 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ dependencies = [
2828
"virtualenv ~=20.21",
2929
"cashews >=6.0, <8.0",
3030
"typing-extensions ~=4.4",
31-
"pyfiglet >=1.0.1, <2.0.0",
3231
"noneprompt >=0.1.10, <1.0.0",
3332
"pydantic >=1.10.0, <3.0.0, !=2.5.0, !=2.5.1",
3433
"nonestorage>=0.1.0",

0 commit comments

Comments
 (0)