Skip to content

Commit cbc51eb

Browse files
committed
update 1.7.2
1 parent ad80c1d commit cbc51eb

4 files changed

Lines changed: 18 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515
# <br><b>Changelog</b><br>
1616

17+
## ... `v1.7.2`
18+
* the `Console.w`, `Console.h` and `Console.wh` class properties now return a default size if there is no console, instead of throwing an error
19+
1720
## 11.06.2025 `v1.7.1`
1821
* fixed an issue with the `Color.is_valid_...()` and `Color.is_valid()` methods, where you were not able to input any color without a type mismatch
1922
* renamed the method `Console.log_box()` to `Console.log_box_filled()`

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "xulbux"
7-
version = "1.7.1"
7+
version = "1.7.2"
88
authors = [{ name = "XulbuX", email = "xulbux.real@gmail.com" }]
99
description = "A Python library which includes lots of helpful classes, types and functions aiming to make common programming tasks simpler."
1010
readme = "README.md"

src/xulbux/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "1.7.1"
1+
__version__ = "1.7.2"
22
__author__ = "XulbuX"
33
__email__ = "xulbux.real@gmail.com"
44
__license__ = "MIT"

src/xulbux/xx_console.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,29 @@
2525
class _ConsoleWidth:
2626

2727
def __get__(self, obj, owner=None):
28-
return _os.get_terminal_size().columns
28+
try:
29+
return _os.get_terminal_size().columns
30+
except OSError:
31+
return 80
2932

3033

3134
class _ConsoleHeight:
3235

3336
def __get__(self, obj, owner=None):
34-
return _os.get_terminal_size().lines
37+
try:
38+
return _os.get_terminal_size().lines
39+
except OSError:
40+
return 24
3541

3642

3743
class _ConsoleSize:
3844

3945
def __get__(self, obj, owner=None):
40-
size = _os.get_terminal_size()
41-
return (size.columns, size.lines)
46+
try:
47+
size = _os.get_terminal_size()
48+
return (size.columns, size.lines)
49+
except OSError:
50+
return (80, 24)
4251

4352

4453
class _ConsoleUser:

0 commit comments

Comments
 (0)