tui-utilities 1.1.1__py3-none-any.whl → 1.1.3__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.

@@ -2,6 +2,11 @@ from .console import print, input, clear_console
2
2
  import sys
3
3
  import traceback
4
4
 
5
+ def _total_characters(object):
6
+ if isinstance(object, str): return len(object)
7
+ if isinstance(object, list): return sum(len(segment) for segment, _ in object)
8
+ return len(str(object))
9
+
5
10
  def _choose_option(
6
11
  options,
7
12
  message = "Seleccione una opción:",
@@ -62,7 +67,7 @@ def header(
62
67
  first_character = separator_first_character,
63
68
  separator_character = separator_separator_character,
64
69
  last_character = separator_last_character,
65
- length = separator_length if separator_length else len(title) + 2,
70
+ length = separator_length if separator_length else _total_characters(title) + 2,
66
71
  color = separator_color,
67
72
  aligment = separator_aligment,
68
73
  padding = separator_padding,
@@ -165,7 +170,8 @@ def separator(
165
170
  bottom_padding = None,
166
171
  left_padding = None
167
172
  ):
168
- print(first_character + f"{separator_character * length - 2}" + last_character,
173
+ print(
174
+ first_character + separator_character * (length - 2) + last_character,
169
175
  color = color,
170
176
  bold = True,
171
177
  alignment = aligment,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tui_utilities
3
- Version: 1.1.1
3
+ Version: 1.1.3
4
4
  Summary: Personal-use console utilities library
5
5
  Author-email: Guido Iván Gross <grossguidoivan@gmail.com>
6
6
  License: MIT
@@ -1,11 +1,11 @@
1
1
  tui_utilities/__init__.py,sha256=zL2dBAmn6OgjnkjP7ABpgTaivse9WhCj_sQl2W3H0Uw,549
2
2
  tui_utilities/console.py,sha256=3p3VVzWOAjxzvoYK3P05ZlC7f7zdxocPim8vxbN5fjw,6023
3
3
  tui_utilities/format.py,sha256=6Ou6aeRku1Fb5Nf0tKmCgh8CIsh3sRJZogog-f5_igc,657
4
- tui_utilities/structure.py,sha256=CnmlRAjEqjgYblHSFOfSIGgojgm20kRZSC90KeVKZYw,8324
4
+ tui_utilities/structure.py,sha256=DTNCopWHbURvWduDC1pP1JDjBL5B4bNu3NCzvTk8vHs,8544
5
5
  tui_utilities/system.py,sha256=KGkEg11zlH18FiQsuywgW0Ls7aiPlvgJr7tDsQMJCBo,308
6
6
  tui_utilities/validation.py,sha256=DGaVjTiLAsdG3wFIuiYWg9vRZZ5R0OgBB8cxWg-riZ8,6502
7
7
  tui_utilities/_tlds/tlds.txt,sha256=ieHVMCtLqEoh8aiMZIZPepNdOjR3CGlO2QgH5LKCRuI,10916
8
- tui_utilities-1.1.1.dist-info/METADATA,sha256=2oQZYVg7-rrBAdB3rODqWj43Ictke8_aTx2EIK6uC54,4727
9
- tui_utilities-1.1.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
10
- tui_utilities-1.1.1.dist-info/top_level.txt,sha256=TF1KuV0fMB1rkFRhqaCkqjprAnH-Tpc4Klsxwif5RWI,14
11
- tui_utilities-1.1.1.dist-info/RECORD,,
8
+ tui_utilities-1.1.3.dist-info/METADATA,sha256=yU5sf8oG3ibYWoLi_pNgrpZgaLNUizXHxEb44L44p4Q,4727
9
+ tui_utilities-1.1.3.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
10
+ tui_utilities-1.1.3.dist-info/top_level.txt,sha256=TF1KuV0fMB1rkFRhqaCkqjprAnH-Tpc4Klsxwif5RWI,14
11
+ tui_utilities-1.1.3.dist-info/RECORD,,