Skip to content

Commit

Permalink
⚡ [Enhance] add_fillers: return terminal_width fillers if text is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Hansimov committed Jan 27, 2025
1 parent 3cc0e3d commit 3736dcb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "tclogger"
version = "1.2.10.1"
version = "1.2.10.2"
authors = [
{ name="Hansimov" },
]
Expand Down
2 changes: 1 addition & 1 deletion src/tclogger/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .colors import colored, decolored
from .logs import TCLogger, logger, TCLogstr, logstr
from .logs import TCLogger, logger, TCLogstr, logstr, add_fillers
from .times import get_now, get_now_ts, get_now_str, get_now_ts_str
from .times import TIMEZONE, set_timezone, tcdatetime
from .times import ts_to_str, str_to_ts, str_to_t
Expand Down
3 changes: 3 additions & 0 deletions src/tclogger/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ def add_fillers(
fill_color: COLOR_TYPE = None,
):
terminal_width = shutil.get_terminal_size().columns
if not text:
filled_str = colored(filler * terminal_width, color=fill_color)
return filled_str
text = text.strip()
if is_text_colored:
text_width = len(decolored(text))
Expand Down

0 comments on commit 3736dcb

Please sign in to comment.