tui-utilities 1.0.27__py3-none-any.whl → 1.0.29__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 tui-utilities might be problematic. Click here for more details.
- tui_utilities/console.py +2 -2
- tui_utilities/structure.py +1 -1
- tui_utilities/validation.py +8 -8
- {tui_utilities-1.0.27.dist-info → tui_utilities-1.0.29.dist-info}/METADATA +1 -1
- tui_utilities-1.0.29.dist-info/RECORD +10 -0
- tui_utilities-1.0.27.dist-info/RECORD +0 -10
- {tui_utilities-1.0.27.dist-info → tui_utilities-1.0.29.dist-info}/WHEEL +0 -0
- {tui_utilities-1.0.27.dist-info → tui_utilities-1.0.29.dist-info}/top_level.txt +0 -0
tui_utilities/console.py
CHANGED
|
@@ -153,7 +153,7 @@ def input(
|
|
|
153
153
|
def clear_console(): os.system("cls" if os.name == "nt" else "clear")
|
|
154
154
|
|
|
155
155
|
def wait_for_key(
|
|
156
|
-
text = "
|
|
156
|
+
text = "Pulse cualquier tecla para continuar...",
|
|
157
157
|
color = "#ffffff",
|
|
158
158
|
bold = False,
|
|
159
159
|
italic = False,
|
|
@@ -168,7 +168,7 @@ def wait_for_key(
|
|
|
168
168
|
left_padding = None
|
|
169
169
|
):
|
|
170
170
|
print(
|
|
171
|
-
text,
|
|
171
|
+
f"\n{text}",
|
|
172
172
|
color = color,
|
|
173
173
|
bold = bold,
|
|
174
174
|
italic = italic,
|
tui_utilities/structure.py
CHANGED
|
@@ -12,7 +12,7 @@ def _choose_option(
|
|
|
12
12
|
for key, option in options.items(): print([(f"{key}:", {"bold": True}), (f" {option}", {})])
|
|
13
13
|
selection = input(f"\n{selection_text}", bold = True).upper()
|
|
14
14
|
while selection not in options:
|
|
15
|
-
print(f"\n{error}
|
|
15
|
+
print(f"\n{error}", color = "#ff0000")
|
|
16
16
|
selection = input(f"\n{selection_text}", bold = True).upper()
|
|
17
17
|
return selection
|
|
18
18
|
|
tui_utilities/validation.py
CHANGED
|
@@ -61,19 +61,19 @@ def _build_email_pattern():
|
|
|
61
61
|
def check_if_empty(list, message = "La lista está vacía"):
|
|
62
62
|
if not list:
|
|
63
63
|
clear_console()
|
|
64
|
-
print(message, color = "#ff0000")
|
|
64
|
+
print(f"\n{message}\n", color = "#ff0000")
|
|
65
65
|
wait_for_key()
|
|
66
66
|
return True
|
|
67
67
|
return False
|
|
68
68
|
|
|
69
69
|
def validate_string(
|
|
70
70
|
message = "Ingrese un texto: ",
|
|
71
|
-
|
|
71
|
+
blank_error = "El texto no puede estar vacío, intente nuevamente"
|
|
72
72
|
):
|
|
73
73
|
while True:
|
|
74
74
|
string = input(text = message, bold = True)
|
|
75
75
|
if string: return string
|
|
76
|
-
print(f"\n{
|
|
76
|
+
print(f"\n{blank_error}\n", color = "#ff0000")
|
|
77
77
|
|
|
78
78
|
def validate_integer(
|
|
79
79
|
message = "Ingrese un número: ",
|
|
@@ -89,7 +89,7 @@ def validate_integer(
|
|
|
89
89
|
if pattern.match(integer):
|
|
90
90
|
unformatted_integer = integer.replace(".", "")
|
|
91
91
|
return int(unformatted_integer)
|
|
92
|
-
|
|
92
|
+
print(f"\n{invalid_error}\n", color = "#ff0000")
|
|
93
93
|
|
|
94
94
|
def validate_double(
|
|
95
95
|
message = "Ingrese un número: ",
|
|
@@ -105,7 +105,7 @@ def validate_double(
|
|
|
105
105
|
if pattern.match(double):
|
|
106
106
|
unformatted_double = double.replace(".", "").replace(",", ".")
|
|
107
107
|
return float(unformatted_double)
|
|
108
|
-
|
|
108
|
+
print(f"\n{invalid_error}\n", color = "#ff0000")
|
|
109
109
|
|
|
110
110
|
def validate_date(
|
|
111
111
|
message = "Ingrese una fecha: ",
|
|
@@ -122,7 +122,7 @@ def validate_date(
|
|
|
122
122
|
date_part, time_part = date_string.split(" - ")
|
|
123
123
|
date_part = date_part.replace(".", "")
|
|
124
124
|
return datetime.strptime(f"{date_part} - {time_part}", "%d/%m/%Y - %H:%M")
|
|
125
|
-
|
|
125
|
+
print(f"\n{invalid_error}\n", color = "#ff0000")
|
|
126
126
|
|
|
127
127
|
def validate_id(
|
|
128
128
|
message = "Ingrese un número de D.N.I.: ",
|
|
@@ -136,7 +136,7 @@ def validate_id(
|
|
|
136
136
|
print(f"\n{blank_error}\n", color = "#ff0000")
|
|
137
137
|
continue
|
|
138
138
|
if pattern.match(id): return id
|
|
139
|
-
|
|
139
|
+
print(f"\n{invalid_error}\n", color = "#ff0000")
|
|
140
140
|
|
|
141
141
|
def validate_cellphone_number(
|
|
142
142
|
message = "Ingrese un número telefónico: ",
|
|
@@ -150,7 +150,7 @@ def validate_cellphone_number(
|
|
|
150
150
|
print(f"\n{blank_error}\n", color = "#ff0000")
|
|
151
151
|
continue
|
|
152
152
|
if pattern.match(cellphone_number): return cellphone_number
|
|
153
|
-
|
|
153
|
+
print(f"\n{invalid_error}\n", color = "#ff0000")
|
|
154
154
|
|
|
155
155
|
def validate_email(
|
|
156
156
|
message = "Ingrese el correo electrónico: ",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
tui_utilities/__init__.py,sha256=8WIoKhRFLM4Bcdd7W3grDoBgfSR0HFWxTsP4ON6Il-E,775
|
|
2
|
+
tui_utilities/console.py,sha256=huYmaPh13zUg43rGhEnoy7MHwH5er7kdXHmZpq9Qb74,5997
|
|
3
|
+
tui_utilities/format.py,sha256=6Ou6aeRku1Fb5Nf0tKmCgh8CIsh3sRJZogog-f5_igc,657
|
|
4
|
+
tui_utilities/structure.py,sha256=04px4ME1WuLxEGSKZsg3oAorIFayLhbUKgP3R_H3R1I,5284
|
|
5
|
+
tui_utilities/validation.py,sha256=DGaVjTiLAsdG3wFIuiYWg9vRZZ5R0OgBB8cxWg-riZ8,6502
|
|
6
|
+
tui_utilities/_tlds/tlds.txt,sha256=ieHVMCtLqEoh8aiMZIZPepNdOjR3CGlO2QgH5LKCRuI,10916
|
|
7
|
+
tui_utilities-1.0.29.dist-info/METADATA,sha256=ol-ZWfjcKqHi-mpe7SWWzLAbGByXm0zGNfK50FEQzGA,4250
|
|
8
|
+
tui_utilities-1.0.29.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
9
|
+
tui_utilities-1.0.29.dist-info/top_level.txt,sha256=TF1KuV0fMB1rkFRhqaCkqjprAnH-Tpc4Klsxwif5RWI,14
|
|
10
|
+
tui_utilities-1.0.29.dist-info/RECORD,,
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
tui_utilities/__init__.py,sha256=8WIoKhRFLM4Bcdd7W3grDoBgfSR0HFWxTsP4ON6Il-E,775
|
|
2
|
-
tui_utilities/console.py,sha256=ft-LTJAoIWCcyjOwlkmPg8OjCzuhNQ8N0wPJHkQHZQk,5992
|
|
3
|
-
tui_utilities/format.py,sha256=6Ou6aeRku1Fb5Nf0tKmCgh8CIsh3sRJZogog-f5_igc,657
|
|
4
|
-
tui_utilities/structure.py,sha256=ZT75tblz52nI9_2FdFCUAw1AITLjMP7pdx8hErRgWjs,5286
|
|
5
|
-
tui_utilities/validation.py,sha256=xybjpleTg0l7lRT0D3QuD62_RwV-r03ZTwPqO9us9Tg,6511
|
|
6
|
-
tui_utilities/_tlds/tlds.txt,sha256=ieHVMCtLqEoh8aiMZIZPepNdOjR3CGlO2QgH5LKCRuI,10916
|
|
7
|
-
tui_utilities-1.0.27.dist-info/METADATA,sha256=jc1B2efzjLYoCEc6T8rBNIjgJ9VEkuHUB1wfSvAeuuM,4250
|
|
8
|
-
tui_utilities-1.0.27.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
9
|
-
tui_utilities-1.0.27.dist-info/top_level.txt,sha256=TF1KuV0fMB1rkFRhqaCkqjprAnH-Tpc4Klsxwif5RWI,14
|
|
10
|
-
tui_utilities-1.0.27.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|