added background fill; added info load per image

This commit is contained in:
2023-09-24 16:39:18 -05:00
parent f10c6d9afd
commit b6d2e9ec54
5 changed files with 27 additions and 3 deletions

View File

@@ -25,6 +25,12 @@ def daemon_threaded_wrapper(fn):
threading.Thread(target=fn, args=args, kwargs=kwargs, daemon=True).start()
return wrapper
def sizeof_fmt_def(num, suffix="B"):
for unit in ["", "K", "M", "G", "T", "Pi", "Ei", "Zi"]:
if abs(num) < 1024.0:
return f"{num:3.1f} {unit}{suffix}"
num /= 1024.0
return f"{num:.1f} Yi{suffix}"
# NOTE: Just reminding myself we can add to builtins two different ways...
@@ -40,4 +46,5 @@ builtins.logger = Logger(settings.get_home_config_path(), \
builtins.threaded = threaded_wrapper
builtins.daemon_threaded = daemon_threaded_wrapper
builtins.sizeof_fmt = sizeof_fmt_def
builtins.event_sleep_time = 0.05