tui-utilities 1.1.8__py3-none-any.whl → 1.1.10__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.
- tui_utilities/console.py +15 -12
- {tui_utilities-1.1.8.dist-info → tui_utilities-1.1.10.dist-info}/METADATA +1 -1
- {tui_utilities-1.1.8.dist-info → tui_utilities-1.1.10.dist-info}/RECORD +5 -5
- {tui_utilities-1.1.8.dist-info → tui_utilities-1.1.10.dist-info}/WHEEL +0 -0
- {tui_utilities-1.1.8.dist-info → tui_utilities-1.1.10.dist-info}/top_level.txt +0 -0
tui_utilities/console.py
CHANGED
|
@@ -62,25 +62,28 @@ 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
|
-
padding
|
|
78
|
+
needs_alignment = alignment is not None
|
|
79
|
+
needs_padding = (
|
|
80
|
+
padding is not None or
|
|
79
81
|
top_padding is not None or
|
|
80
82
|
right_padding is not None or
|
|
81
83
|
bottom_padding is not None or
|
|
82
84
|
left_padding is not None
|
|
83
85
|
)
|
|
86
|
+
needs_layout = needs_alignment or needs_padding
|
|
84
87
|
if isinstance(object, (str, list)):
|
|
85
88
|
styled = apply_text_styles(object)
|
|
86
89
|
if not needs_layout: return styled
|
|
@@ -101,8 +104,8 @@ def print(
|
|
|
101
104
|
underline = False,
|
|
102
105
|
strike = False,
|
|
103
106
|
reverse = False,
|
|
104
|
-
alignment =
|
|
105
|
-
padding =
|
|
107
|
+
alignment = None,
|
|
108
|
+
padding = None,
|
|
106
109
|
top_padding = None,
|
|
107
110
|
right_padding = None,
|
|
108
111
|
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=O2eMb5vKv7NZg78voSCYwuemE2AsRWCSQrp7WMo3chU,6107
|
|
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.10.dist-info/METADATA,sha256=cx_1iXlu5QPxC4brc56466ZLL3QfJUaxpX49S_LLPYM,4728
|
|
9
|
+
tui_utilities-1.1.10.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
10
|
+
tui_utilities-1.1.10.dist-info/top_level.txt,sha256=TF1KuV0fMB1rkFRhqaCkqjprAnH-Tpc4Klsxwif5RWI,14
|
|
11
|
+
tui_utilities-1.1.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|