You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,12 +20,12 @@
20
20
new, instead of flags, you can also once use the literal `"before"` and once `"after"`, which corresponds to all non-flagged values before or after all flagged values
21
21
* changed the default `default_color` for all `Console` class input methods to `None`
22
22
* the method `Console.restricted_input()` now returns an empty string instead of `None` if the user didn't input anything
23
-
* fixed several small bugs for `Console.restricted_input()` regarding the ANSI formatting of the input prompt and the input text in the console
24
23
* completely rewrote `Console.restricted_input()`, so now it's actually usable, and renamed it to just `Console.input()`
25
24
* removed method `Console.pwd_input()`, since you can now simply use `Console.input(mask_char="*")` instead, which does the exact same thing
26
25
* removed the CLI command `xx-help`, since it was redundant because there's already the CLI command `xulbux-help`
27
26
* removed the `xx_` from all the library modules since it's redundant, and without it the imports look more professional and cleaner
28
27
* 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"
28
+
* the constants form inside the `consts` module are now all uppercase (*except the class methods*), to make clear that they're constants
29
29
* 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
|`xulbux-help`| shows some information about the library |
40
+
41
+
<br>
42
+
34
43
## Usage
35
44
36
45
Import the full library under the alias `xx`, so its constants, classes, methods, and types are accessible with `xx.CONSTANT.value`, `xx.Class.method()`, `xx.type()`:
@@ -39,12 +48,12 @@ import xulbux as xx
39
48
```
40
49
So you don't have to import the full library under an alias, you can also import only certain parts of the library's contents:
41
50
```python
42
-
# CONSTANTS
43
-
from xulbux importCOLOR, CHARS, ANSI
44
-
# Classes
51
+
#LIBRARY CONSTANTS
52
+
from xulbux.base.constsimportCOLOR, CHARS, ANSI
53
+
#Main Classes
45
54
from xulbux import Code, Color, Console, ...
46
-
#types
47
-
from xulbux import rgba, hsla, hexa
55
+
#module specific imports
56
+
from xulbux.colorimport rgba, hsla, hexa
48
57
```
49
58
50
59
<br>
@@ -71,26 +80,30 @@ from xulbux import rgba, hsla, hexa
71
80
72
81
## Example Usage
73
82
74
-
This is what it could look like using this library for a simple but very nice looking color converter:
83
+
This is what it could look like using this library for a simple but ultra good-looking color converter:
75
84
```python
76
-
from xulbux importCOLOR# CONSTANTS
77
-
from xulbux importFormatCodes, Console # Classes
78
-
from xulbux importhexa # types
85
+
from xulbux.base.constsimportCOLOR, CHARS
86
+
from xulbux.colorimporthexa
87
+
from xulbux importConsole
79
88
80
89
81
90
defmain() -> None:
82
91
83
92
# LET THE USER ENTER A HEXA COLOR IN ANY HEXA FORMAT
84
-
input_clr = FormatCodes.input(
85
-
"\n[b](Enter a HEXA color in any format) [dim](>) "
93
+
input_clr = Console.input(
94
+
"[b](Enter a HEXA color in any format) > ",
95
+
start="\n",
96
+
placeholder="#7075FF",
97
+
max_len=7,
98
+
allowed_chars=CHARS.HEX_DIGITS,
86
99
)
87
100
88
101
# ANNOUNCE INDEXING THE INPUT COLOR
89
102
Console.log(
90
103
"INDEX",
91
104
"Indexing the input HEXA color...",
92
105
start="\n",
93
-
title_bg_color=COLOR.blue,
106
+
title_bg_color=COLOR.BLUE,
94
107
)
95
108
96
109
try:
@@ -109,7 +122,7 @@ def main() -> None:
109
122
Console.log(
110
123
"CONVERT",
111
124
"Converting the HEXA color into different types...",
112
-
title_bg_color=COLOR.tangerine,
125
+
title_bg_color=COLOR.TANGERINE,
113
126
)
114
127
115
128
# CONVERT THE HEXA COLOR INTO THE TWO OTHER COLOR TYPES
0 commit comments