tui-utilities 1.1.3__py3-none-any.whl → 1.1.5__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 CHANGED
@@ -20,8 +20,7 @@ def _style(
20
20
  top_padding = None,
21
21
  right_padding = None,
22
22
  bottom_padding = None,
23
- left_padding = None,
24
- plain_text = False
23
+ left_padding = None
25
24
  ):
26
25
  def apply_text_styles(object):
27
26
  styleable = Text()
@@ -63,20 +62,18 @@ def _style(
63
62
  if current_segment: styleable.append(current_segment, style = style)
64
63
  return styleable
65
64
 
66
- def apply_alignment(alignable): return Align(alignable, alignment)
65
+ def apply_alignment(alignable): return Align(alignable, alignment) if alignment else alignable
67
66
 
68
67
  def apply_padding(paddable):
68
+ if not padding and not top_padding and not right_padding and not bottom_padding and not left_padding: return paddable
69
69
  final_padding = (
70
- top_padding if top_padding is not None else padding,
71
- (right_padding if right_padding is not None else padding) * 2,
72
- bottom_padding if bottom_padding is not None else padding,
73
- (left_padding if left_padding is not None else padding) * 2
70
+ top_padding if top_padding else padding,
71
+ (right_padding if right_padding else padding) * 2,
72
+ bottom_padding if bottom_padding else padding,
73
+ (left_padding if left_padding else padding) * 2
74
74
  )
75
75
  return Padding(paddable, final_padding)
76
76
 
77
- if plain_text:
78
- styled = apply_text_styles(object)
79
- return styled
80
77
  if isinstance(object, (str, list)):
81
78
  styled = apply_text_styles(object)
82
79
  aligned = apply_alignment(styled)
@@ -99,15 +96,14 @@ def print(
99
96
  underline = False,
100
97
  strike = False,
101
98
  reverse = False,
102
- alignment = "left",
103
- padding = 0,
99
+ alignment = None,
100
+ padding = None,
104
101
  top_padding = None,
105
102
  right_padding = None,
106
103
  bottom_padding = None,
107
104
  left_padding = None,
108
105
  separator = " ",
109
106
  end = "\n",
110
- plain_text = False,
111
107
  **kwargs
112
108
  ):
113
109
  renderables = []
@@ -125,8 +121,7 @@ def print(
125
121
  top_padding = top_padding,
126
122
  right_padding = right_padding,
127
123
  bottom_padding = bottom_padding,
128
- left_padding = left_padding,
129
- plain_text = plain_text
124
+ left_padding = left_padding
130
125
  ))
131
126
  _console.print(*renderables, sep = separator, end = end, **kwargs)
132
127
 
@@ -146,8 +141,7 @@ def input(
146
141
  italic = italic,
147
142
  underline = underline,
148
143
  strike = strike,
149
- reverse = reverse,
150
- plain_text = True
144
+ reverse = reverse
151
145
  )).strip()
152
146
 
153
147
  def clear_console(): os.system("cls")
@@ -165,8 +159,7 @@ def wait_for_key(
165
159
  top_padding = None,
166
160
  right_padding = None,
167
161
  bottom_padding = None,
168
- left_padding = None,
169
- plain_text = True
162
+ left_padding = None
170
163
  ):
171
164
  print(
172
165
  f"\n{text}",
@@ -182,7 +175,6 @@ def wait_for_key(
182
175
  right_padding = right_padding,
183
176
  bottom_padding = bottom_padding,
184
177
  left_padding = left_padding,
185
- end = "",
186
- plain_text = plain_text
178
+ end = ""
187
179
  )
188
180
  readchar.readkey()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tui_utilities
3
- Version: 1.1.3
3
+ Version: 1.1.5
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
- tui_utilities/console.py,sha256=3p3VVzWOAjxzvoYK3P05ZlC7f7zdxocPim8vxbN5fjw,6023
2
+ tui_utilities/console.py,sha256=L4a0UNC_S9J4o9GDiBtuvOCeyrkWtVtUfQ11vaPx87U,5870
3
3
  tui_utilities/format.py,sha256=6Ou6aeRku1Fb5Nf0tKmCgh8CIsh3sRJZogog-f5_igc,657
4
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.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,,
8
+ tui_utilities-1.1.5.dist-info/METADATA,sha256=uy3qIxBq6hDJc27mT_p2aOj-ASL79i1PoaD3Xjo-ERQ,4727
9
+ tui_utilities-1.1.5.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
10
+ tui_utilities-1.1.5.dist-info/top_level.txt,sha256=TF1KuV0fMB1rkFRhqaCkqjprAnH-Tpc4Klsxwif5RWI,14
11
+ tui_utilities-1.1.5.dist-info/RECORD,,