tui-utilities 1.0.27__py3-none-any.whl → 1.0.28__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 +15 -15
- {tui_utilities-1.0.27.dist-info → tui_utilities-1.0.28.dist-info}/METADATA +1 -1
- tui_utilities-1.0.28.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.28.dist-info}/WHEEL +0 -0
- {tui_utilities-1.0.27.dist-info → tui_utilities-1.0.28.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}", 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}", color = "#ff0000")
|
|
77
77
|
|
|
78
78
|
def validate_integer(
|
|
79
79
|
message = "Ingrese un número: ",
|
|
@@ -84,12 +84,12 @@ def validate_integer(
|
|
|
84
84
|
while True:
|
|
85
85
|
integer = input(text = message, bold = True)
|
|
86
86
|
if not integer:
|
|
87
|
-
print(f"\n{blank_error}
|
|
87
|
+
print(f"\n{blank_error}", color = "#ff0000")
|
|
88
88
|
continue
|
|
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}", color = "#ff0000")
|
|
93
93
|
|
|
94
94
|
def validate_double(
|
|
95
95
|
message = "Ingrese un número: ",
|
|
@@ -100,12 +100,12 @@ def validate_double(
|
|
|
100
100
|
while True:
|
|
101
101
|
double = input(text = message, bold = True)
|
|
102
102
|
if not double:
|
|
103
|
-
print(f"\n{blank_error}
|
|
103
|
+
print(f"\n{blank_error}", color = "#ff0000")
|
|
104
104
|
continue
|
|
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}", color = "#ff0000")
|
|
109
109
|
|
|
110
110
|
def validate_date(
|
|
111
111
|
message = "Ingrese una fecha: ",
|
|
@@ -116,13 +116,13 @@ def validate_date(
|
|
|
116
116
|
while True:
|
|
117
117
|
date_string = input(text = message, bold = True)
|
|
118
118
|
if not date_string:
|
|
119
|
-
print(f"\n{blank_error}
|
|
119
|
+
print(f"\n{blank_error}", color = "#ff0000")
|
|
120
120
|
continue
|
|
121
121
|
if pattern.match(date_string):
|
|
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}", color = "#ff0000")
|
|
126
126
|
|
|
127
127
|
def validate_id(
|
|
128
128
|
message = "Ingrese un número de D.N.I.: ",
|
|
@@ -133,10 +133,10 @@ def validate_id(
|
|
|
133
133
|
while True:
|
|
134
134
|
id = input(text = message, bold = True)
|
|
135
135
|
if not id:
|
|
136
|
-
print(f"\n{blank_error}
|
|
136
|
+
print(f"\n{blank_error}", color = "#ff0000")
|
|
137
137
|
continue
|
|
138
138
|
if pattern.match(id): return id
|
|
139
|
-
|
|
139
|
+
print(f"\n{invalid_error}", color = "#ff0000")
|
|
140
140
|
|
|
141
141
|
def validate_cellphone_number(
|
|
142
142
|
message = "Ingrese un número telefónico: ",
|
|
@@ -147,10 +147,10 @@ def validate_cellphone_number(
|
|
|
147
147
|
while True:
|
|
148
148
|
cellphone_number = input(text = message, bold = True)
|
|
149
149
|
if not cellphone_number:
|
|
150
|
-
print(f"\n{blank_error}
|
|
150
|
+
print(f"\n{blank_error}", color = "#ff0000")
|
|
151
151
|
continue
|
|
152
152
|
if pattern.match(cellphone_number): return cellphone_number
|
|
153
|
-
|
|
153
|
+
print(f"\n{invalid_error}", color = "#ff0000")
|
|
154
154
|
|
|
155
155
|
def validate_email(
|
|
156
156
|
message = "Ingrese el correo electrónico: ",
|
|
@@ -161,7 +161,7 @@ def validate_email(
|
|
|
161
161
|
while True:
|
|
162
162
|
email = input(text = message, bold = True)
|
|
163
163
|
if not email:
|
|
164
|
-
print(f"\n{blank_error}
|
|
164
|
+
print(f"\n{blank_error}", color = "#ff0000")
|
|
165
165
|
continue
|
|
166
166
|
if pattern.match(email): return email
|
|
167
|
-
print(f"\n{invalid_error}
|
|
167
|
+
print(f"\n{invalid_error}", color = "#ff0000")
|
|
@@ -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=HmUp4KtVorIHj0Uk7cEPO62aj3lrPyrsaeqbgf5lUY0,6474
|
|
6
|
+
tui_utilities/_tlds/tlds.txt,sha256=ieHVMCtLqEoh8aiMZIZPepNdOjR3CGlO2QgH5LKCRuI,10916
|
|
7
|
+
tui_utilities-1.0.28.dist-info/METADATA,sha256=qAdF28hNRG4WZCme65keJhr4R-fz3lqYIpHmxNhcaE0,4250
|
|
8
|
+
tui_utilities-1.0.28.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
9
|
+
tui_utilities-1.0.28.dist-info/top_level.txt,sha256=TF1KuV0fMB1rkFRhqaCkqjprAnH-Tpc4Klsxwif5RWI,14
|
|
10
|
+
tui_utilities-1.0.28.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
|