Skip to content

Commit 682d5cc

Browse files
committed
📝 [Doc] README: update example with latest feature, and upgrade to v1.2.3
1 parent f291225 commit 682d5cc

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

README.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ See: [example.py](https://github.com/Hansimov/tclogger/blob/main/example.py)
2020

2121
```python
2222
import sys
23-
from pathlib import Path
24-
25-
sys.path.insert(0, str(Path(__file__).parent / "src"))
26-
2723
import tclogger
2824
import time
2925

@@ -253,6 +249,29 @@ def test_logbar_total():
253249
time.sleep(0.01)
254250

255251

252+
def test_logbar_verbose():
253+
total = 1000
254+
logbar1 = TCLogbar(total=total, show_datetime=False, head="bar1", verbose=False)
255+
logger.note("> Here should NOT show bar1")
256+
for i in range(total):
257+
logbar1.update(1)
258+
print()
259+
260+
logbar2 = TCLogbar(total=total, show_datetime=False, head="bar2", verbose=True)
261+
logger.note("> Here should show bar2")
262+
for i in range(total):
263+
logbar2.update(1)
264+
print()
265+
266+
logger.note("> Here should NOT show bar1 and bar2")
267+
TCLogbarGroup([logbar1, logbar2], verbose=False)
268+
print()
269+
270+
logger.note("> Here should show bar1 and bar2")
271+
TCLogbarGroup([logbar1, logbar2], verbose=True)
272+
print()
273+
274+
256275
def test_decorations():
257276
text = "Hello World"
258277
logger.note(f"Brackets: {logstr.mesg(brk(text))}")
@@ -275,5 +294,6 @@ if __name__ == "__main__":
275294
test_logbar()
276295
test_logbar_group()
277296
test_logbar_total()
297+
test_logbar_verbose()
278298
test_decorations()
279299
```

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "tclogger"
3-
version = "1.2.2"
3+
version = "1.2.3"
44
authors = [
55
{ name="Hansimov" },
66
]

0 commit comments

Comments
 (0)