redesign progressbars

+ hide some progressbars
+ rewrite telemetry into a class
+ remove obsolete start info logs
+ update contributing.md to include contributing.md
+ send posthog event in a bg thread
+ related side effects
This commit is contained in:
mungai-njoroge
2023-09-27 17:18:52 +03:00
parent 54714a224b
commit 4f757e989f
20 changed files with 144 additions and 130 deletions
+16
View File
@@ -0,0 +1,16 @@
from tqdm import tqdm as _tqdm
def tqdm(*args, **kwargs):
"""
Wrapper for tqdm that sets globals.
"""
bar_format = "{percentage:3.0f}%|{bar:45}|{n_fmt}/{total_fmt}{desc}"
kwargs["bar_format"] = bar_format
if "desc" in kwargs:
print(f'INFO|{kwargs["desc"].capitalize()} ...')
kwargs["desc"] = ""
return _tqdm(*args, **kwargs)
+1 -2
View File
@@ -3,8 +3,7 @@ import threading
def background(func):
"""
a threading decorator
use @background above the function you want to run in the background
Runs the decorated function in a background thread.
"""
def background_func(*a, **kw):