tui-utilities 1.0.20__tar.gz → 1.0.22__tar.gz
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-1.0.20 → tui_utilities-1.0.22}/PKG-INFO +1 -1
- {tui_utilities-1.0.20 → tui_utilities-1.0.22}/pyproject.toml +1 -1
- {tui_utilities-1.0.20 → tui_utilities-1.0.22}/tui_utilities/console.py +13 -7
- {tui_utilities-1.0.20 → tui_utilities-1.0.22}/tui_utilities.egg-info/PKG-INFO +1 -1
- {tui_utilities-1.0.20 → tui_utilities-1.0.22}/README.md +0 -0
- {tui_utilities-1.0.20 → tui_utilities-1.0.22}/setup.cfg +0 -0
- {tui_utilities-1.0.20 → tui_utilities-1.0.22}/tui_utilities/__init__.py +0 -0
- {tui_utilities-1.0.20 → tui_utilities-1.0.22}/tui_utilities/_tlds/tlds.txt +0 -0
- {tui_utilities-1.0.20 → tui_utilities-1.0.22}/tui_utilities/format.py +0 -0
- {tui_utilities-1.0.20 → tui_utilities-1.0.22}/tui_utilities/structure.py +0 -0
- {tui_utilities-1.0.20 → tui_utilities-1.0.22}/tui_utilities/validation.py +0 -0
- {tui_utilities-1.0.20 → tui_utilities-1.0.22}/tui_utilities.egg-info/SOURCES.txt +0 -0
- {tui_utilities-1.0.20 → tui_utilities-1.0.22}/tui_utilities.egg-info/dependency_links.txt +0 -0
- {tui_utilities-1.0.20 → tui_utilities-1.0.22}/tui_utilities.egg-info/requires.txt +0 -0
- {tui_utilities-1.0.20 → tui_utilities-1.0.22}/tui_utilities.egg-info/top_level.txt +0 -0
|
@@ -2,7 +2,6 @@ from rich.console import Console, RenderableType
|
|
|
2
2
|
from rich.text import Text
|
|
3
3
|
from rich.align import Align
|
|
4
4
|
from rich.padding import Padding
|
|
5
|
-
from rich.protocol import is_renderable
|
|
6
5
|
import os
|
|
7
6
|
import readchar
|
|
8
7
|
|
|
@@ -75,14 +74,20 @@ def _style(
|
|
|
75
74
|
)
|
|
76
75
|
return Padding(paddable, final_padding)
|
|
77
76
|
|
|
78
|
-
if
|
|
77
|
+
if isinstance(object, Text):
|
|
79
78
|
aligned = apply_alignment(object)
|
|
80
79
|
padded = apply_padding(aligned)
|
|
81
80
|
return padded
|
|
82
|
-
|
|
81
|
+
if isinstance(object, (str, list)):
|
|
83
82
|
styled = apply_text_styles(object)
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
aligned = apply_alignment(styled)
|
|
84
|
+
padded = apply_padding(aligned)
|
|
85
|
+
return padded
|
|
86
|
+
if isinstance(object, RenderableType):
|
|
87
|
+
aligned = apply_alignment(object)
|
|
88
|
+
padded = apply_padding(aligned)
|
|
89
|
+
return padded
|
|
90
|
+
styled = apply_text_styles(str(object))
|
|
86
91
|
aligned = apply_alignment(styled)
|
|
87
92
|
padded = apply_padding(aligned)
|
|
88
93
|
return padded
|
|
@@ -108,7 +113,8 @@ def print(
|
|
|
108
113
|
):
|
|
109
114
|
renderables = []
|
|
110
115
|
for object in objects:
|
|
111
|
-
if isinstance(object, (
|
|
116
|
+
if isinstance(object, Text): renderables.append(object)
|
|
117
|
+
elif isinstance(object, (str, list)):
|
|
112
118
|
renderables.append(_style(
|
|
113
119
|
object = object,
|
|
114
120
|
color = color,
|
|
@@ -125,7 +131,7 @@ def print(
|
|
|
125
131
|
left_padding = left_padding,
|
|
126
132
|
plain_text = plain_text
|
|
127
133
|
))
|
|
128
|
-
elif
|
|
134
|
+
elif isinstance(object, RenderableType):
|
|
129
135
|
renderables.append(_style(
|
|
130
136
|
object = object,
|
|
131
137
|
alignment = alignment,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|