Skip to content

Commit d4dec59

Browse files
committed
rename class properties
1 parent 0da4308 commit d4dec59

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
**BREAKING CHANGES:**
2727
* Made the value input into the params `bar_format` and `limited_bar_format` of `ProgressBar` be a list/tuple of strings instead of a single string, so the user can define multiple formats for different console widths.
2828
* Added a new param <code>sep: str = " "</code> to the `ProgressBar` class, which is used to join multiple bar-format strings.
29+
* Renamed the class property `Console.wh` to `Console.size`, since it describes the property better.
30+
* Renamed the class property `Console.usr` to `Console.user`, since it describes the property better.
2931

3032
<span id="v1-9-0" />
3133

src/xulbux/console.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ class Console:
188188
"""The width of the console in characters."""
189189
h: int = _ConsoleHeight() # type: ignore[assignment]
190190
"""The height of the console in lines."""
191-
wh: tuple[int, int] = _ConsoleSize() # type: ignore[assignment]
191+
size: tuple[int, int] = _ConsoleSize() # type: ignore[assignment]
192192
"""A tuple with the width and height of the console in characters and lines."""
193-
usr: str = _ConsoleUser() # type: ignore[assignment]
193+
user: str = _ConsoleUser() # type: ignore[assignment]
194194
"""The name of the current user."""
195195

196196
@staticmethod
@@ -913,7 +913,7 @@ def log_box_bordered(
913913

914914
@staticmethod
915915
def __prepare_log_box(
916-
values: tuple[object, ...],
916+
values: list[object] | tuple[object, ...],
917917
default_color: Optional[Rgba | Hexa] = None,
918918
has_rules: bool = False,
919919
) -> tuple[list[str], list[tuple[str, tuple[tuple[int, str], ...]]], int]:

tests/test_console.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def mock_prompt_toolkit(monkeypatch):
4242

4343

4444
def test_console_user():
45-
user_output = Console.usr
45+
user_output = Console.user
4646
assert isinstance(user_output, str)
4747
assert user_output != ""
4848

@@ -60,7 +60,7 @@ def test_console_height(mock_terminal_size):
6060

6161

6262
def test_console_size(mock_terminal_size):
63-
size_output = Console.wh
63+
size_output = Console.size
6464
assert isinstance(size_output, tuple)
6565
assert len(size_output) == 2
6666
assert size_output[0] == 80

0 commit comments

Comments
 (0)