Skip to content

Commit 6168f61

Browse files
committed
update 1.8.0
1 parent fb3fb05 commit 6168f61

5 files changed

Lines changed: 51 additions & 50 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
* renamed the previously internal module `_consts_` to `consts` and made it accessible via `from xulbux.base.consts import …`, since you should be able to use library constants without them being "internal"
2828
* the constants form inside the `consts` module are now all uppercase (*except the class methods*), to make clear that they're constants
2929
* removed the wildcard imports from the `__init__.py` file, so now you can only access the main classes directly with `from xulbux import …` and for the rest you have to import the specific module first
30+
* now `prompt` from `Console.pause_exit()` also supports custom formatting codes and the method new pauses per default (*without exiting*)
3031

3132
## 29.07.2025 `v1.7.3`
3233
* removed the param `title_bg_color` from the `Console.log()` preset methods, since that is part of the preset and doesn't need to be changed by the user

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ keywords = [
106106
"License" = "https://github.com/XulbuX/PythonLibraryXulbuX/blob/main/LICENSE"
107107

108108
[project.scripts]
109-
xulbux-help = "xulbux._cli_:help_command"
109+
xulbux-help = "xulbux.cli.help:show_help"
110110

111111
[tool.black]
112112
line-length = 127

src/xulbux/_cli_.py

Lines changed: 0 additions & 45 deletions
This file was deleted.

src/xulbux/cli/help.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
from .. import __version__
2+
from ..base.consts import COLOR
3+
from ..format_codes import FormatCodes
4+
from ..console import Console
5+
6+
7+
CLR = {
8+
"class": COLOR.TANGERINE,
9+
"const": COLOR.RED,
10+
"func": COLOR.CYAN,
11+
"import": COLOR.NEON_GREEN,
12+
"lib": COLOR.ORANGE,
13+
"punctuators": COLOR.DARK_GRAY,
14+
"code_border": COLOR.GRAY,
15+
}
16+
HELP = FormatCodes.to_ansi(
17+
rf""" [_|b|#7075FF] __ __
18+
[b|#7075FF] _ __ __ __/ / / /_ __ ___ __
19+
[b|#7075FF] | |/ // / / / / / __ \/ / / | |/ /
20+
[b|#7075FF] > , </ /_/ / /_/ /_/ / /_/ /> , <
21+
[b|#7075FF]/_/|_|\____/\__/\____/\____//_/|_| [*|BG:{COLOR.GRAY}|#000] v[b]{__version__} [*]
22+
23+
[i|{COLOR.CORAL}]A TON OF COOL FUNCTIONS, YOU NEED![*]
24+
25+
[b|#FCFCFF]Usage:[*]
26+
[dim|{CLR['code_border']}](╭────────────────────────────────────────────────────╮)
27+
[dim|{CLR['code_border']}](│) [{CLR['punctuators']}]# LIBRARY CONSTANTS[*] [dim|{CLR['code_border']}](│)
28+
[dim|{CLR['code_border']}](│) [{CLR['import']}]from [{CLR['lib']}]xulbux[{CLR['punctuators']}].[{CLR['lib']}]base[{CLR['punctuators']}].[{CLR['lib']}]consts [{CLR['import']}]import [{CLR['const']}]COLOR[{CLR['punctuators']}], [{CLR['const']}]CHARS[{CLR['punctuators']}], [{CLR['const']}]ANSI[*] [dim|{CLR['code_border']}](│)
29+
[dim|{CLR['code_border']}](│) [{CLR['punctuators']}]# Main Classes[*] [dim|{CLR['code_border']}](│)
30+
[dim|{CLR['code_border']}](│) [{CLR['import']}]from [{CLR['lib']}]xulbux [{CLR['import']}]import [{CLR['class']}]Code[{CLR['punctuators']}], [{CLR['class']}]Color[{CLR['punctuators']}], [{CLR['class']}]Console[{CLR['punctuators']}], ...[*] [dim|{CLR['code_border']}](│)
31+
[dim|{CLR['code_border']}](│) [{CLR['punctuators']}]# module specific imports[*] [dim|{CLR['code_border']}](│)
32+
[dim|{CLR['code_border']}](│) [{CLR['import']}]from [{CLR['lib']}]xulbux[{CLR['punctuators']}].[{CLR['lib']}]color [{CLR['import']}]import [{CLR['func']}]rgba[{CLR['punctuators']}], [{CLR['func']}]hsla[{CLR['punctuators']}], [{CLR['func']}]hexa[*] [dim|{CLR['code_border']}](│)
33+
[dim|{CLR['code_border']}](╰────────────────────────────────────────────────────╯)
34+
[b|#FCFCFF]Documentation:[*]
35+
[dim|{CLR['code_border']}](╭────────────────────────────────────────────────────╮)
36+
[dim|{CLR['code_border']}](│) [#DADADD]For more information see the GitHub page. [dim|{CLR['code_border']}](│)
37+
[dim|{CLR['code_border']}](│) [u|#8085FF](https://github.com/XulbuX/PythonLibraryXulbuX/wiki) [dim|{CLR['code_border']}](│)
38+
[dim|{CLR['code_border']}](╰────────────────────────────────────────────────────╯)
39+
[_]"""
40+
)
41+
42+
43+
def show_help() -> None:
44+
print(HELP)
45+
Console.pause_exit(pause=True, prompt=" [dim](Press any key to exit...)\n\n")

src/xulbux/console.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,15 +332,15 @@ def get_args(
332332

333333
@staticmethod
334334
def pause_exit(
335-
pause: bool = False,
335+
pause: bool = True,
336336
exit: bool = False,
337337
prompt: object = "",
338338
exit_code: int = 0,
339339
reset_ansi: bool = False,
340340
) -> None:
341-
"""Will print the `prompt` and then pause the program if `pause` is set
342-
to `True` and after the pause, exit the program if `exit` is set to `True`."""
343-
print(prompt, end="", flush=True)
341+
"""Will print the `prompt` and then pause the program if `pause` is
342+
true and after the pause, exit the program if `exit` is set true."""
343+
FormatCodes.print(prompt, end="", flush=True)
344344
if reset_ansi:
345345
FormatCodes.print("[_]", end="")
346346
if pause:

0 commit comments

Comments
 (0)