xulbux 1.6.0__py3-none-any.whl → 1.6.2__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.
Potentially problematic release.
This version of xulbux might be problematic. Click here for more details.
- xulbux/__init__.py +1 -1
- xulbux/_consts_.py +16 -16
- xulbux/xx_code.py +4 -4
- xulbux/xx_color.py +155 -144
- xulbux/xx_console.py +26 -41
- xulbux/xx_data.py +69 -66
- xulbux/xx_env_path.py +4 -4
- xulbux/xx_file.py +35 -26
- xulbux/xx_format_codes.py +122 -64
- xulbux/xx_json.py +27 -22
- xulbux/xx_path.py +2 -7
- xulbux/xx_regex.py +61 -61
- xulbux/xx_string.py +14 -13
- xulbux/xx_system.py +59 -8
- {xulbux-1.6.0.dist-info → xulbux-1.6.2.dist-info}/METADATA +3 -3
- xulbux-1.6.2.dist-info/RECORD +21 -0
- {xulbux-1.6.0.dist-info → xulbux-1.6.2.dist-info}/WHEEL +1 -1
- xulbux-1.6.0.dist-info/RECORD +0 -21
- {xulbux-1.6.0.dist-info → xulbux-1.6.2.dist-info}/LICENSE +0 -0
- {xulbux-1.6.0.dist-info → xulbux-1.6.2.dist-info}/entry_points.txt +0 -0
- {xulbux-1.6.0.dist-info → xulbux-1.6.2.dist-info}/top_level.txt +0 -0
xulbux/__init__.py
CHANGED
xulbux/_consts_.py
CHANGED
|
@@ -116,14 +116,14 @@ class ANSI:
|
|
|
116
116
|
"cyan": 36,
|
|
117
117
|
"white": 37,
|
|
118
118
|
########## BRIGHT DEFAULT CONSOLE COLORS ###########
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
119
|
+
"br:black": 90,
|
|
120
|
+
"br:red": 91,
|
|
121
|
+
"br:green": 92,
|
|
122
|
+
"br:yellow": 93,
|
|
123
|
+
"br:blue": 94,
|
|
124
|
+
"br:magenta": 95,
|
|
125
|
+
"br:cyan": 96,
|
|
126
|
+
"br:white": 97,
|
|
127
127
|
######## DEFAULT CONSOLE BACKGROUND COLORS #########
|
|
128
128
|
"bg:black": 40,
|
|
129
129
|
"bg:red": 41,
|
|
@@ -134,12 +134,12 @@ class ANSI:
|
|
|
134
134
|
"bg:cyan": 46,
|
|
135
135
|
"bg:white": 47,
|
|
136
136
|
##### BRIGHT DEFAULT CONSOLE BACKGROUND COLORS #####
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
137
|
+
"bg:br:black": 100,
|
|
138
|
+
"bg:br:red": 101,
|
|
139
|
+
"bg:br:green": 102,
|
|
140
|
+
"bg:br:yellow": 103,
|
|
141
|
+
"bg:br:blue": 104,
|
|
142
|
+
"bg:br:magenta": 105,
|
|
143
|
+
"bg:br:cyan": 106,
|
|
144
|
+
"bg:br:white": 107,
|
|
145
145
|
}
|
xulbux/xx_code.py
CHANGED
|
@@ -23,9 +23,9 @@ class Code:
|
|
|
23
23
|
|
|
24
24
|
@staticmethod
|
|
25
25
|
def change_tab_size(code: str, new_tab_size: int, remove_empty_lines: bool = False) -> str:
|
|
26
|
-
"""Replaces all tabs with `new_tab_size` spaces
|
|
27
|
-
|
|
28
|
-
"""
|
|
26
|
+
"""Replaces all tabs with `new_tab_size` spaces.\n
|
|
27
|
+
----------------------------------------------------------------------------------
|
|
28
|
+
If `remove_empty_lines` is `True`, empty lines will be removed in the process."""
|
|
29
29
|
code_lines = String.get_lines(code, remove_empty_lines=True)
|
|
30
30
|
lines = code_lines if remove_empty_lines else String.get_lines(code)
|
|
31
31
|
tab_spaces = Code.get_tab_spaces(code)
|
|
@@ -54,7 +54,7 @@ class Code:
|
|
|
54
54
|
|
|
55
55
|
@staticmethod
|
|
56
56
|
def is_js(code: str, funcs: list = ["__", "$t", "$lang"]) -> bool:
|
|
57
|
-
"""Will check if the code is likely to be JavaScript."""
|
|
57
|
+
"""Will check if the code is very likely to be JavaScript."""
|
|
58
58
|
funcs = "|".join(funcs)
|
|
59
59
|
js_pattern = _rx.compile(
|
|
60
60
|
Regex.outside_strings(
|