xulbux 1.8.0__tar.gz → 1.8.1__tar.gz
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.
Potentially problematic release.
This version of xulbux might be problematic. Click here for more details.
- {xulbux-1.8.0/src/xulbux.egg-info → xulbux-1.8.1}/PKG-INFO +1 -1
- {xulbux-1.8.0 → xulbux-1.8.1}/pyproject.toml +4 -2
- {xulbux-1.8.0 → xulbux-1.8.1}/src/xulbux/__init__.py +1 -1
- xulbux-1.8.1/src/xulbux/base/consts.py +173 -0
- xulbux-1.8.1/src/xulbux/cli/help.py +45 -0
- {xulbux-1.8.0 → xulbux-1.8.1}/src/xulbux/console.py +22 -17
- {xulbux-1.8.0 → xulbux-1.8.1/src/xulbux.egg-info}/PKG-INFO +1 -1
- {xulbux-1.8.0 → xulbux-1.8.1}/src/xulbux.egg-info/SOURCES.txt +2 -1
- xulbux-1.8.0/LICENSE +0 -21
- {xulbux-1.8.0 → xulbux-1.8.1}/README.md +0 -0
- {xulbux-1.8.0 → xulbux-1.8.1}/setup.cfg +0 -0
- {xulbux-1.8.0 → xulbux-1.8.1}/src/xulbux/code.py +0 -0
- {xulbux-1.8.0 → xulbux-1.8.1}/src/xulbux/color.py +0 -0
- {xulbux-1.8.0 → xulbux-1.8.1}/src/xulbux/data.py +0 -0
- {xulbux-1.8.0 → xulbux-1.8.1}/src/xulbux/env_path.py +0 -0
- {xulbux-1.8.0 → xulbux-1.8.1}/src/xulbux/file.py +0 -0
- {xulbux-1.8.0 → xulbux-1.8.1}/src/xulbux/format_codes.py +0 -0
- {xulbux-1.8.0 → xulbux-1.8.1}/src/xulbux/json.py +0 -0
- {xulbux-1.8.0 → xulbux-1.8.1}/src/xulbux/path.py +0 -0
- {xulbux-1.8.0 → xulbux-1.8.1}/src/xulbux/regex.py +0 -0
- {xulbux-1.8.0 → xulbux-1.8.1}/src/xulbux/string.py +0 -0
- {xulbux-1.8.0 → xulbux-1.8.1}/src/xulbux/system.py +0 -0
- {xulbux-1.8.0 → xulbux-1.8.1}/src/xulbux.egg-info/dependency_links.txt +0 -0
- {xulbux-1.8.0 → xulbux-1.8.1}/src/xulbux.egg-info/entry_points.txt +0 -0
- {xulbux-1.8.0 → xulbux-1.8.1}/src/xulbux.egg-info/requires.txt +0 -0
- {xulbux-1.8.0 → xulbux-1.8.1}/src/xulbux.egg-info/top_level.txt +0 -0
- {xulbux-1.8.0 → xulbux-1.8.1}/tests/test_code.py +0 -0
- {xulbux-1.8.0 → xulbux-1.8.1}/tests/test_color.py +0 -0
- {xulbux-1.8.0 → xulbux-1.8.1}/tests/test_color_types.py +0 -0
- {xulbux-1.8.0 → xulbux-1.8.1}/tests/test_console.py +0 -0
- {xulbux-1.8.0 → xulbux-1.8.1}/tests/test_data.py +0 -0
- {xulbux-1.8.0 → xulbux-1.8.1}/tests/test_env_path.py +0 -0
- {xulbux-1.8.0 → xulbux-1.8.1}/tests/test_file.py +0 -0
- {xulbux-1.8.0 → xulbux-1.8.1}/tests/test_format_codes.py +0 -0
- {xulbux-1.8.0 → xulbux-1.8.1}/tests/test_json.py +0 -0
- {xulbux-1.8.0 → xulbux-1.8.1}/tests/test_path.py +0 -0
- {xulbux-1.8.0 → xulbux-1.8.1}/tests/test_string.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xulbux
|
|
3
|
-
Version: 1.8.
|
|
3
|
+
Version: 1.8.1
|
|
4
4
|
Summary: A Python library which includes lots of helpful classes, types and functions aiming to make common programming tasks simpler.
|
|
5
5
|
Author-email: XulbuX <xulbux.real@gmail.com>
|
|
6
6
|
Maintainer-email: XulbuX <xulbux.real@gmail.com>
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "xulbux"
|
|
7
|
-
version = "1.8.
|
|
7
|
+
version = "1.8.1"
|
|
8
8
|
authors = [{ name = "XulbuX", email = "xulbux.real@gmail.com" }]
|
|
9
9
|
maintainers = [{ name = "XulbuX", email = "xulbux.real@gmail.com" }]
|
|
10
10
|
description = "A Python library which includes lots of helpful classes, types and functions aiming to make common programming tasks simpler."
|
|
@@ -143,9 +143,11 @@ extend-ignore = ["E203", "E266", "W503"]
|
|
|
143
143
|
per-file-ignores = ["__init__.py:F403,F405"]
|
|
144
144
|
|
|
145
145
|
[tool.setuptools]
|
|
146
|
-
packages = ["xulbux"]
|
|
147
146
|
package-dir = { "" = "src" }
|
|
148
147
|
|
|
148
|
+
[tool.setuptools.packages.find]
|
|
149
|
+
where = ["src"]
|
|
150
|
+
|
|
149
151
|
[tool.pytest.ini_options]
|
|
150
152
|
minversion = "7.0"
|
|
151
153
|
addopts = "-ra -q"
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
from typing import TypeAlias
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
FormattableString: TypeAlias = str
|
|
5
|
+
"""A `str` object that is made to be formatted with the `.format()` method."""
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class COLOR:
|
|
9
|
+
"""Hexa color presets."""
|
|
10
|
+
|
|
11
|
+
WHITE = "#F1F2FF"
|
|
12
|
+
LIGHT_GRAY = "#B6B7C0"
|
|
13
|
+
GRAY = "#7B7C8D"
|
|
14
|
+
DARK_GRAY = "#67686C"
|
|
15
|
+
BLACK = "#202125"
|
|
16
|
+
RED = "#FF606A"
|
|
17
|
+
CORAL = "#FF7069"
|
|
18
|
+
ORANGE = "#FF876A"
|
|
19
|
+
TANGERINE = "#FF9962"
|
|
20
|
+
GOLD = "#FFAF60"
|
|
21
|
+
YELLOW = "#FFD260"
|
|
22
|
+
LIME = "#C9F16E"
|
|
23
|
+
GREEN = "#7EE787"
|
|
24
|
+
NEON_GREEN = "#4CFF85"
|
|
25
|
+
TEAL = "#50EAAF"
|
|
26
|
+
CYAN = "#3EDEE6"
|
|
27
|
+
ICE = "#77DBEF"
|
|
28
|
+
LIGHT_BLUE = "#60AAFF"
|
|
29
|
+
BLUE = "#8085FF"
|
|
30
|
+
LAVENDER = "#9B7DFF"
|
|
31
|
+
PURPLE = "#AD68FF"
|
|
32
|
+
MAGENTA = "#C860FF"
|
|
33
|
+
PINK = "#F162EF"
|
|
34
|
+
ROSE = "#FF609F"
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class CHARS:
|
|
38
|
+
"""Text character sets."""
|
|
39
|
+
|
|
40
|
+
class _AllTextChars:
|
|
41
|
+
pass
|
|
42
|
+
|
|
43
|
+
ALL = _AllTextChars
|
|
44
|
+
"""Code to signal that all characters are allowed."""
|
|
45
|
+
|
|
46
|
+
DIGITS = "0123456789"
|
|
47
|
+
"""Digits: `0`-`9`"""
|
|
48
|
+
FLOAT_DIGITS = DIGITS + "."
|
|
49
|
+
"""Digits: `0`-`9` with decimal point `.`"""
|
|
50
|
+
HEX_DIGITS = DIGITS + "#abcdefABCDEF"
|
|
51
|
+
"""Digits: `0`-`9` Letters: `a`-`f` `A`-`F` and a hashtag `#`"""
|
|
52
|
+
|
|
53
|
+
LOWERCASE = "abcdefghijklmnopqrstuvwxyz"
|
|
54
|
+
"""Lowercase letters `a`-`z`"""
|
|
55
|
+
LOWERCASE_EXTENDED = LOWERCASE + "äëïöüÿàèìòùáéíóúýâêîôûãñõåæç"
|
|
56
|
+
"""Lowercase letters `a`-`z` with all lowercase diacritic letters."""
|
|
57
|
+
UPPERCASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
58
|
+
"""Uppercase letters `A`-`Z`"""
|
|
59
|
+
UPPERCASE_EXTENDED = UPPERCASE + "ÄËÏÖÜÀÈÌÒÙÁÉÍÓÚÝÂÊÎÔÛÃÑÕÅÆÇß"
|
|
60
|
+
"""Uppercase letters `A`-`Z` with all uppercase diacritic letters."""
|
|
61
|
+
|
|
62
|
+
LETTERS = LOWERCASE + UPPERCASE
|
|
63
|
+
"""Lowercase and uppercase letters `a`-`z` and `A`-`Z`"""
|
|
64
|
+
LETTERS_EXTENDED = LOWERCASE_EXTENDED + UPPERCASE_EXTENDED
|
|
65
|
+
"""Lowercase and uppercase letters `a`-`z` `A`-`Z` and all diacritic letters."""
|
|
66
|
+
|
|
67
|
+
SPECIAL_ASCII = " !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"
|
|
68
|
+
"""All ASCII special characters."""
|
|
69
|
+
SPECIAL_ASCII_EXTENDED = SPECIAL_ASCII + "ø£Ø×ƒªº¿®¬½¼¡«»░▒▓│┤©╣║╗╝¢¥┐└┴┬├─┼╚╔╩╦╠═╬¤ðÐı┘┌█▄¦▀µþÞ¯´≡±‗¾¶§÷¸°¨·¹³²■ "
|
|
70
|
+
"""All ASCII special characters with the extended ASCII special characters."""
|
|
71
|
+
STANDARD_ASCII = SPECIAL_ASCII + DIGITS + LETTERS
|
|
72
|
+
"""All standard ASCII characters."""
|
|
73
|
+
FULL_ASCII = SPECIAL_ASCII_EXTENDED + DIGITS + LETTERS_EXTENDED
|
|
74
|
+
"""All characters in the ASCII table."""
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class ANSI:
|
|
78
|
+
"""Constants and methods for use of ANSI escape codes"""
|
|
79
|
+
|
|
80
|
+
ESCAPED_CHAR = "\\x1b"
|
|
81
|
+
"""The printable ANSI escape character."""
|
|
82
|
+
CHAR = char = "\x1b"
|
|
83
|
+
"""The ANSI escape character."""
|
|
84
|
+
START = start = "["
|
|
85
|
+
"""The start of an ANSI escape sequence."""
|
|
86
|
+
SEP = sep = ";"
|
|
87
|
+
"""The separator between ANSI escape sequence parts."""
|
|
88
|
+
END = end = "m"
|
|
89
|
+
"""The end of an ANSI escape sequence."""
|
|
90
|
+
|
|
91
|
+
@classmethod
|
|
92
|
+
def seq(cls, parts: int = 1) -> FormattableString:
|
|
93
|
+
"""Generate an ANSI sequence with `parts` amount of placeholders."""
|
|
94
|
+
return cls.CHAR + cls.START + cls.SEP.join(["{}" for _ in range(parts)]) + cls.END
|
|
95
|
+
|
|
96
|
+
SEQ_COLOR: FormattableString = CHAR + START + "38" + SEP + "2" + SEP + "{}" + SEP + "{}" + SEP + "{}" + END
|
|
97
|
+
"""The ANSI escape sequence for setting the text RGB color."""
|
|
98
|
+
SEQ_BG_COLOR: FormattableString = CHAR + START + "48" + SEP + "2" + SEP + "{}" + SEP + "{}" + SEP + "{}" + END
|
|
99
|
+
"""The ANSI escape sequence for setting the background RGB color."""
|
|
100
|
+
|
|
101
|
+
COLOR_MAP: tuple[str, ...] = (
|
|
102
|
+
########### DEFAULT CONSOLE COLOR NAMES ############
|
|
103
|
+
"black",
|
|
104
|
+
"red",
|
|
105
|
+
"green",
|
|
106
|
+
"yellow",
|
|
107
|
+
"blue",
|
|
108
|
+
"magenta",
|
|
109
|
+
"cyan",
|
|
110
|
+
"white",
|
|
111
|
+
)
|
|
112
|
+
"""The console default color names."""
|
|
113
|
+
|
|
114
|
+
CODES_MAP: dict[str | tuple[str, ...], int] = {
|
|
115
|
+
################# SPECIFIC RESETS ##################
|
|
116
|
+
"_": 0,
|
|
117
|
+
("_bold", "_b"): 22,
|
|
118
|
+
("_dim", "_d"): 22,
|
|
119
|
+
("_italic", "_i"): 23,
|
|
120
|
+
("_underline", "_u"): 24,
|
|
121
|
+
("_double-underline", "_du"): 24,
|
|
122
|
+
("_inverse", "_invert", "_in"): 27,
|
|
123
|
+
("_hidden", "_hide", "_h"): 28,
|
|
124
|
+
("_strikethrough", "_s"): 29,
|
|
125
|
+
("_color", "_c"): 39,
|
|
126
|
+
("_background", "_bg"): 49,
|
|
127
|
+
################### TEXT STYLES ####################
|
|
128
|
+
("bold", "b"): 1,
|
|
129
|
+
("dim", "d"): 2,
|
|
130
|
+
("italic", "i"): 3,
|
|
131
|
+
("underline", "u"): 4,
|
|
132
|
+
("inverse", "invert", "in"): 7,
|
|
133
|
+
("hidden", "hide", "h"): 8,
|
|
134
|
+
("strikethrough", "s"): 9,
|
|
135
|
+
("double-underline", "du"): 21,
|
|
136
|
+
################## DEFAULT COLORS ##################
|
|
137
|
+
"black": 30,
|
|
138
|
+
"red": 31,
|
|
139
|
+
"green": 32,
|
|
140
|
+
"yellow": 33,
|
|
141
|
+
"blue": 34,
|
|
142
|
+
"magenta": 35,
|
|
143
|
+
"cyan": 36,
|
|
144
|
+
"white": 37,
|
|
145
|
+
############## BRIGHT DEFAULT COLORS ###############
|
|
146
|
+
"br:black": 90,
|
|
147
|
+
"br:red": 91,
|
|
148
|
+
"br:green": 92,
|
|
149
|
+
"br:yellow": 93,
|
|
150
|
+
"br:blue": 94,
|
|
151
|
+
"br:magenta": 95,
|
|
152
|
+
"br:cyan": 96,
|
|
153
|
+
"br:white": 97,
|
|
154
|
+
############ DEFAULT BACKGROUND COLORS #############
|
|
155
|
+
"bg:black": 40,
|
|
156
|
+
"bg:red": 41,
|
|
157
|
+
"bg:green": 42,
|
|
158
|
+
"bg:yellow": 43,
|
|
159
|
+
"bg:blue": 44,
|
|
160
|
+
"bg:magenta": 45,
|
|
161
|
+
"bg:cyan": 46,
|
|
162
|
+
"bg:white": 47,
|
|
163
|
+
######### BRIGHT DEFAULT BACKGROUND COLORS #########
|
|
164
|
+
"bg:br:black": 100,
|
|
165
|
+
"bg:br:red": 101,
|
|
166
|
+
"bg:br:green": 102,
|
|
167
|
+
"bg:br:yellow": 103,
|
|
168
|
+
"bg:br:blue": 104,
|
|
169
|
+
"bg:br:magenta": 105,
|
|
170
|
+
"bg:br:cyan": 106,
|
|
171
|
+
"bg:br:white": 107,
|
|
172
|
+
}
|
|
173
|
+
"""All custom format keys and their corresponding ANSI format number codes."""
|
|
@@ -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")
|
|
@@ -366,9 +366,12 @@ class Console:
|
|
|
366
366
|
end: str = "\n",
|
|
367
367
|
title_bg_color: Optional[Rgba | Hexa] = None,
|
|
368
368
|
default_color: Optional[Rgba | Hexa] = None,
|
|
369
|
-
|
|
369
|
+
tab_size: int = 8,
|
|
370
|
+
title_px: int = 1,
|
|
371
|
+
title_mx: int = 2,
|
|
370
372
|
) -> None:
|
|
371
|
-
"""
|
|
373
|
+
"""Prints a nicely formatted log message.\n
|
|
374
|
+
-------------------------------------------------------------------------------------------
|
|
372
375
|
- `title` -⠀the title of the log message (e.g. `DEBUG`, `WARN`, `FAIL`, etc.)
|
|
373
376
|
- `prompt` -⠀the log message
|
|
374
377
|
- `format_linebreaks` -⠀whether to format (indent after) the line breaks or not
|
|
@@ -376,38 +379,40 @@ class Console:
|
|
|
376
379
|
- `end` -⠀something to print after the log is printed (e.g. `\\n`)
|
|
377
380
|
- `title_bg_color` -⠀the background color of the `title`
|
|
378
381
|
- `default_color` -⠀the default text color of the `prompt`
|
|
379
|
-
- `
|
|
380
|
-
|
|
382
|
+
- `tab_size` -⠀the tab size used for the log (default is 8 like console tabs)
|
|
383
|
+
- `title_px` -⠀the horizontal padding (in chars) to the title (if `title_bg_color` is set)
|
|
384
|
+
- `title_mx` -⠀the horizontal margin (in chars) to the title\n
|
|
385
|
+
-------------------------------------------------------------------------------------------
|
|
381
386
|
The log message can be formatted with special formatting codes. For more detailed
|
|
382
387
|
information about formatting codes, see `format_codes` module documentation."""
|
|
388
|
+
has_title_bg = title_bg_color is not None and Color.is_valid(title_bg_color)
|
|
383
389
|
title = "" if title is None else title.strip().upper()
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
title_color = "_color" if title_bg_color is None else "#000"
|
|
390
|
+
title_fg = Color.text_color_for_on_bg(
|
|
391
|
+
Color.to_hexa(title_bg_color) # type: ignore[assignment]
|
|
392
|
+
) if has_title_bg else "_color"
|
|
393
|
+
px, mx = (" " * title_px) if has_title_bg else "", " " * title_mx
|
|
394
|
+
tab = " " * (tab_size - 1 - ((len(mx) + (title_len := len(title) + 2 * len(px))) % tab_size))
|
|
390
395
|
if format_linebreaks:
|
|
391
396
|
clean_prompt, removals = FormatCodes.remove_formatting(str(prompt), get_removals=True, _ignore_linebreaks=True)
|
|
392
|
-
prompt_lst = (
|
|
397
|
+
prompt_lst = (
|
|
398
|
+
String.split_count(l, Console.w - (title_len + len(tab) + 2 * len(mx))) for l in str(clean_prompt).splitlines()
|
|
399
|
+
)
|
|
393
400
|
prompt_lst = (
|
|
394
401
|
item for lst in prompt_lst for item in ([""] if lst == [] else (lst if isinstance(lst, list) else [lst]))
|
|
395
402
|
)
|
|
396
|
-
prompt = f"\n{' ' * title_len}
|
|
403
|
+
prompt = f"\n{mx}{' ' * title_len}{mx}{tab}".join(
|
|
397
404
|
Console.__add_back_removed_parts(list(prompt_lst), cast(tuple[tuple[int, str], ...], removals))
|
|
398
405
|
)
|
|
399
|
-
else:
|
|
400
|
-
prompt = str(prompt)
|
|
401
406
|
if title == "":
|
|
402
407
|
FormatCodes.print(
|
|
403
|
-
f'{start} {f"[{default_color}]" if default_color else ""}{
|
|
408
|
+
f'{start} {f"[{default_color}]" if default_color else ""}{prompt}[_]',
|
|
404
409
|
default_color=default_color,
|
|
405
410
|
end=end,
|
|
406
411
|
)
|
|
407
412
|
else:
|
|
408
413
|
FormatCodes.print(
|
|
409
|
-
f
|
|
410
|
-
+ f
|
|
414
|
+
f"{start}{mx}[bold][{title_fg}]{f'[BG:{title_bg_color}]' if title_bg_color else ''}{px}{title}{px}[_]{mx}"
|
|
415
|
+
+ f"{tab}{f'[{default_color}]' if default_color else ''}{prompt}[_]",
|
|
411
416
|
default_color=default_color,
|
|
412
417
|
end=end,
|
|
413
418
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xulbux
|
|
3
|
-
Version: 1.8.
|
|
3
|
+
Version: 1.8.1
|
|
4
4
|
Summary: A Python library which includes lots of helpful classes, types and functions aiming to make common programming tasks simpler.
|
|
5
5
|
Author-email: XulbuX <xulbux.real@gmail.com>
|
|
6
6
|
Maintainer-email: XulbuX <xulbux.real@gmail.com>
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
LICENSE
|
|
2
1
|
README.md
|
|
3
2
|
pyproject.toml
|
|
4
3
|
src/xulbux/__init__.py
|
|
@@ -20,6 +19,8 @@ src/xulbux.egg-info/dependency_links.txt
|
|
|
20
19
|
src/xulbux.egg-info/entry_points.txt
|
|
21
20
|
src/xulbux.egg-info/requires.txt
|
|
22
21
|
src/xulbux.egg-info/top_level.txt
|
|
22
|
+
src/xulbux/base/consts.py
|
|
23
|
+
src/xulbux/cli/help.py
|
|
23
24
|
tests/test_code.py
|
|
24
25
|
tests/test_color.py
|
|
25
26
|
tests/test_color_types.py
|
xulbux-1.8.0/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 XulbuX
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|