usecli 0.2.2__py3-none-any.whl → 0.2.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- usecli/cli/core/ui/title.py +33 -2
- usecli/cli/services/command_service.py +4 -0
- {usecli-0.2.2.dist-info → usecli-0.2.3.dist-info}/METADATA +1 -1
- {usecli-0.2.2.dist-info → usecli-0.2.3.dist-info}/RECORD +7 -7
- {usecli-0.2.2.dist-info → usecli-0.2.3.dist-info}/WHEEL +0 -0
- {usecli-0.2.2.dist-info → usecli-0.2.3.dist-info}/entry_points.txt +0 -0
- {usecli-0.2.2.dist-info → usecli-0.2.3.dist-info}/licenses/LICENSE +0 -0
usecli/cli/core/ui/title.py
CHANGED
|
@@ -77,6 +77,20 @@ def get_framework_description() -> str | None:
|
|
|
77
77
|
return summary or None
|
|
78
78
|
|
|
79
79
|
|
|
80
|
+
def _strip_blank_edges(text: str) -> str:
|
|
81
|
+
"""Drop whitespace-only lines above and below rendered art.
|
|
82
|
+
|
|
83
|
+
Banner spacing belongs to ``banner.top_space``/``banner.bottom_space``;
|
|
84
|
+
literal blank lines baked into art would double it.
|
|
85
|
+
"""
|
|
86
|
+
lines = text.split("\n")
|
|
87
|
+
while lines and not lines[0].strip():
|
|
88
|
+
lines.pop(0)
|
|
89
|
+
while lines and not lines[-1].strip():
|
|
90
|
+
lines.pop()
|
|
91
|
+
return "\n".join(lines)
|
|
92
|
+
|
|
93
|
+
|
|
80
94
|
def _get_script_command_name(start_dir: Path | None = None) -> str | None:
|
|
81
95
|
if start_dir is None:
|
|
82
96
|
start_dir = Path.cwd()
|
|
@@ -212,6 +226,23 @@ def get_project_version() -> str | None:
|
|
|
212
226
|
return None
|
|
213
227
|
|
|
214
228
|
|
|
229
|
+
def _banner_config():
|
|
230
|
+
"""Config that owns the banner layout.
|
|
231
|
+
|
|
232
|
+
The usecli binary renders the framework banner, so its layout (file, font,
|
|
233
|
+
spacing, show flags) comes from the installed framework config rather than
|
|
234
|
+
the downstream project being scaffolded. Downstream CLIs keep using the
|
|
235
|
+
discovered project config.
|
|
236
|
+
"""
|
|
237
|
+
if _running_framework_distribution() is None:
|
|
238
|
+
return get_config()
|
|
239
|
+
|
|
240
|
+
from usecli.shared.config.globals import PACKAGE_ROOT
|
|
241
|
+
from usecli.shared.config.manager import ConfigManager
|
|
242
|
+
|
|
243
|
+
return ConfigManager(start_dir=PACKAGE_ROOT)
|
|
244
|
+
|
|
245
|
+
|
|
215
246
|
def render_plain_title(
|
|
216
247
|
title: str,
|
|
217
248
|
description: str | None = None,
|
|
@@ -265,7 +296,7 @@ def print_title(title: str | None = None) -> None:
|
|
|
265
296
|
|
|
266
297
|
█████▓▓▓▓▓▒▒▒▒▒░░░░░░░░░░░░░░▒▒▒▒▒▓▓▓▓▓█████
|
|
267
298
|
"""
|
|
268
|
-
config =
|
|
299
|
+
config = _banner_config()
|
|
269
300
|
|
|
270
301
|
top_space = config.get("banner.top_space", True)
|
|
271
302
|
bottom_space = config.get("banner.bottom_space", True)
|
|
@@ -313,7 +344,7 @@ def print_title(title: str | None = None) -> None:
|
|
|
313
344
|
pass
|
|
314
345
|
|
|
315
346
|
if title is None or title.lower() == "usecli":
|
|
316
|
-
console.print(f"[{COLOR.PRIMARY}]{default_title_text}")
|
|
347
|
+
console.print(f"[{COLOR.PRIMARY}]{_strip_blank_edges(default_title_text)}")
|
|
317
348
|
if bottom_space:
|
|
318
349
|
console.print()
|
|
319
350
|
return
|
|
@@ -70,6 +70,10 @@ class CommandService:
|
|
|
70
70
|
project_commands_dir.relative_to(package_commands_dir)
|
|
71
71
|
return
|
|
72
72
|
except ValueError:
|
|
73
|
+
if command_name == "usecli":
|
|
74
|
+
# The framework binary exposes the framework's commands only;
|
|
75
|
+
# project commands belong to the project's own CLI.
|
|
76
|
+
return
|
|
73
77
|
self._load_from_dir(project_commands_dir)
|
|
74
78
|
|
|
75
79
|
def _load_version(self) -> None:
|
|
@@ -37,7 +37,7 @@ usecli/cli/core/exceptions/validation.py,sha256=94kVisVfM60BbQXXPgbbij-Wk-JG2oSE
|
|
|
37
37
|
usecli/cli/core/runtime.py,sha256=oYw3utJfP6l0Ge-lh7LemzlpFfwhcTqd8f0UMjDw-uY,2734
|
|
38
38
|
usecli/cli/core/ui/__init__.py,sha256=DlDpV0TkDHFgzy8QSKq1BtBXMZ0rPb83Doa9YJtJk8o,1182
|
|
39
39
|
usecli/cli/core/ui/list.py,sha256=Xbd-yrBL2pbbFVTKyuhcE0P79SNkrPd36rjY8gTvQj0,17716
|
|
40
|
-
usecli/cli/core/ui/title.py,sha256=
|
|
40
|
+
usecli/cli/core/ui/title.py,sha256=X1R1F9nDILymQtBmagngw0EB2mNijit7Hn2gri8Tw24,12149
|
|
41
41
|
usecli/cli/core/ui/title.txt,sha256=FczT0qLn__wPje2HgWlG2QK-n9IFkrXbYB9r3BG-cME,592
|
|
42
42
|
usecli/cli/core/validators/__init__.py,sha256=vh_vuBI4jjbyW_HK5YISSOqIF7hL3D1FH7yVwIZiLHQ,724
|
|
43
43
|
usecli/cli/core/validators/network.py,sha256=ArjtXz8iu4VY_V3_KkPAuvKptieIQYLF_IgZx1nTpCo,1941
|
|
@@ -45,7 +45,7 @@ usecli/cli/core/validators/numeric.py,sha256=RnWdhzvpo6CH8gAO9HH9vDO6GgTR_YIBXo1
|
|
|
45
45
|
usecli/cli/core/validators/path.py,sha256=4_yPF6YCTA7dYcMMUdR98KtgdE0VIDYH96Xu0oPIRDs,1727
|
|
46
46
|
usecli/cli/core/validators/string.py,sha256=S8s5vcI5C1VgTsEFeaDEXM98r6a1uJHUUIUWMAPvUL8,1355
|
|
47
47
|
usecli/cli/services/__init__.py,sha256=UsU5DrOuj54zExzb1aNr8pwL2JAxxBnGCxP0WS2_gm0,67
|
|
48
|
-
usecli/cli/services/command_service.py,sha256=
|
|
48
|
+
usecli/cli/services/command_service.py,sha256=HjABXGX75oeweHDbOzFs8fX1LxZxvACejP1Rfv200E0,6543
|
|
49
49
|
usecli/cli/templates/command.py.j2,sha256=aLmPbZmt7IkoX_VryhudMghz9RWqCT_1YbMsujPrmx0,2918
|
|
50
50
|
usecli/cli/templates/theme.toml.j2,sha256=PXns8o-D6tGSOs33mItFOOU1gIZByRLlFzH5MhHBeZs,582
|
|
51
51
|
usecli/cli/templates/usecli.config.toml.j2,sha256=x1pnaq9OwuNXOgAyBke3jHAQRMy4u9yEFwUcMkpZzNo,1875
|
|
@@ -80,8 +80,8 @@ usecli/shared/upgrades/service.py,sha256=mbdOlltlhy5aIoXQg-Z8bRZOBKx-V_ZE2LeFCaw
|
|
|
80
80
|
usecli/shared/upgrades/settings.py,sha256=Fs3QPHC6WCZiR8vHR-p-iBhzt9Gb1pde_oqLpX-EanE,4054
|
|
81
81
|
usecli/ui.py,sha256=692vBCg8NB1fnl50qftdfifL2HFw5QsM0ZzY5Y8GH-A,2893
|
|
82
82
|
usecli/usecli.config.toml,sha256=GtbIu__TbPyl4D0P8g71BZDcTPuhIraphGlpRaYtbkg,1371
|
|
83
|
-
usecli-0.2.
|
|
84
|
-
usecli-0.2.
|
|
85
|
-
usecli-0.2.
|
|
86
|
-
usecli-0.2.
|
|
87
|
-
usecli-0.2.
|
|
83
|
+
usecli-0.2.3.dist-info/licenses/LICENSE,sha256=__gKAkMUpLmsNxVlHtoB_EZRb3qtfLICULaZFQdeBOs,1071
|
|
84
|
+
usecli-0.2.3.dist-info/WHEEL,sha256=G_-rrEibZr7OEM7zdH1dSO6s-VdjfnS5PA4CLAdI9Vw,80
|
|
85
|
+
usecli-0.2.3.dist-info/entry_points.txt,sha256=g-WrjhqUPo8h-70iEg5MXsbI6Fh5lHo0MCPcyDAeKFQ,75
|
|
86
|
+
usecli-0.2.3.dist-info/METADATA,sha256=66MPwvKFXJs3mFiodcm5iPPZxXBIXQdVFi0l7ahJlAo,13334
|
|
87
|
+
usecli-0.2.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|