Code and log beautification #14

Merged
Jan Lindemann merged 2 commits from jan/feature/20260612-lib-execcontext-callcontext-log-delim-beautify into master 2026-06-12 19:16:06 +02:00 AGit
Showing only changes of commit 658a87fde0 - Show all commits

lib.ExecContext.CallContext.log_delim: Beautify
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m10s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m16s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m16s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m9s
CI / Packaging test (push) Successful in 0s

Fix commit 238cc05d which promised to beautify .log_delim but didn't.

Signed-off-by: Jan Lindemann <jan@janware.com>
Jan Lindemann 2026-06-12 09:52:06 +02:00
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61

View file

@ -120,8 +120,10 @@ class ExecContext(Base):
self.__log_prefix = log_prefix self.__log_prefix = log_prefix
self.__parent = parent self.__parent = parent
self.__pretty_cmd: str | None = None self.__pretty_cmd: str | None = None
self.__title = f'{parent.uri}: Running {self.pretty_cmd} -' self.__title = (
self.__delim = f'---- {title} -' title if title else f'{parent.uri}: Running {self.pretty_cmd} -'
)
self.__delim = f'---- {self.__title} -'
delim_len = 120 delim_len = 120
self.__delim += '-' * max(0, delim_len - len(self.__delim)) self.__delim += '-' * max(0, delim_len - len(self.__delim))
self.__mod_env = {'LC_ALL': 'C'} if mod_env is None else mod_env self.__mod_env = {'LC_ALL': 'C'} if mod_env is None else mod_env