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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tui_utilities
3
- Version: 1.0.20
3
+ Version: 1.0.22
4
4
  Summary: Personal-use console utilities library
5
5
  Author-email: Guido Iván Gross <grossguidoivan@gmail.com>
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "tui_utilities"
3
- version = "1.0.20"
3
+ version = "1.0.22"
4
4
  description = "Personal-use console utilities library"
5
5
  readme = "README.md"
6
6
  license = {text = "MIT"}
@@ -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 is_renderable(object) and not isinstance(object, Text):
77
+ if isinstance(object, Text):
79
78
  aligned = apply_alignment(object)
80
79
  padded = apply_padding(aligned)
81
80
  return padded
82
- elif plain_text:
81
+ if isinstance(object, (str, list)):
83
82
  styled = apply_text_styles(object)
84
- return styled
85
- styled = apply_text_styles(object)
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, (str, list)):
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 is_renderable(object):
134
+ elif isinstance(object, RenderableType):
129
135
  renderables.append(_style(
130
136
  object = object,
131
137
  alignment = alignment,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tui_utilities
3
- Version: 1.0.20
3
+ Version: 1.0.22
4
4
  Summary: Personal-use console utilities library
5
5
  Author-email: Guido Iván Gross <grossguidoivan@gmail.com>
6
6
  License: MIT
File without changes
File without changes