tui-utilities 1.1.8__py3-none-any.whl → 1.1.9__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 +14 -17
- {tui_utilities-1.1.8.dist-info → tui_utilities-1.1.9.dist-info}/METADATA +1 -1
- {tui_utilities-1.1.8.dist-info → tui_utilities-1.1.9.dist-info}/RECORD +5 -5
- {tui_utilities-1.1.8.dist-info → tui_utilities-1.1.9.dist-info}/WHEEL +0 -0
- {tui_utilities-1.1.8.dist-info → tui_utilities-1.1.9.dist-info}/top_level.txt +0 -0
tui_utilities/console.py
CHANGED
|
@@ -62,25 +62,22 @@ def _style(
|
|
|
62
62
|
if current_segment: styleable.append(current_segment, style = style)
|
|
63
63
|
return styleable
|
|
64
64
|
|
|
65
|
-
def apply_alignment(
|
|
65
|
+
def apply_alignment(renderable): return Align(renderable, alignment) if alignment else renderable
|
|
66
66
|
|
|
67
|
-
def apply_padding(
|
|
67
|
+
def apply_padding(renderable):
|
|
68
|
+
if not needs_padding: return renderable
|
|
69
|
+
base = padding or 0
|
|
68
70
|
final_padding = (
|
|
69
|
-
top_padding if top_padding
|
|
70
|
-
(right_padding if right_padding
|
|
71
|
-
bottom_padding if bottom_padding
|
|
72
|
-
(left_padding if left_padding
|
|
71
|
+
top_padding if top_padding else base,
|
|
72
|
+
(right_padding if right_padding else base) * 2,
|
|
73
|
+
bottom_padding if bottom_padding else base,
|
|
74
|
+
(left_padding if left_padding else base) * 2
|
|
73
75
|
)
|
|
74
|
-
return Padding(
|
|
76
|
+
return Padding(renderable, final_padding)
|
|
75
77
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
top_padding is not None or
|
|
80
|
-
right_padding is not None or
|
|
81
|
-
bottom_padding is not None or
|
|
82
|
-
left_padding is not None
|
|
83
|
-
)
|
|
78
|
+
needs_alignment = alignment is not None
|
|
79
|
+
needs_padding = (padding or top_padding or right_padding or bottom_padding or left_padding)
|
|
80
|
+
needs_layout = needs_alignment or needs_padding
|
|
84
81
|
if isinstance(object, (str, list)):
|
|
85
82
|
styled = apply_text_styles(object)
|
|
86
83
|
if not needs_layout: return styled
|
|
@@ -101,8 +98,8 @@ def print(
|
|
|
101
98
|
underline = False,
|
|
102
99
|
strike = False,
|
|
103
100
|
reverse = False,
|
|
104
|
-
alignment =
|
|
105
|
-
padding =
|
|
101
|
+
alignment = None,
|
|
102
|
+
padding = None,
|
|
106
103
|
top_padding = None,
|
|
107
104
|
right_padding = None,
|
|
108
105
|
bottom_padding = None,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
tui_utilities/__init__.py,sha256=zL2dBAmn6OgjnkjP7ABpgTaivse9WhCj_sQl2W3H0Uw,549
|
|
2
|
-
tui_utilities/console.py,sha256=
|
|
2
|
+
tui_utilities/console.py,sha256=ba0nyPvMflHfY8T3Nglt0QTcPZoNtrBuXpjmWRDZYjY,5995
|
|
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.
|
|
9
|
-
tui_utilities-1.1.
|
|
10
|
-
tui_utilities-1.1.
|
|
11
|
-
tui_utilities-1.1.
|
|
8
|
+
tui_utilities-1.1.9.dist-info/METADATA,sha256=TZdGUZn22X6L8AEIgWkB3QASKsXKYBrXlyJZR-xVIzg,4727
|
|
9
|
+
tui_utilities-1.1.9.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
10
|
+
tui_utilities-1.1.9.dist-info/top_level.txt,sha256=TF1KuV0fMB1rkFRhqaCkqjprAnH-Tpc4Klsxwif5RWI,14
|
|
11
|
+
tui_utilities-1.1.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|