unbold ansi grays

This commit is contained in:
ed 2022-10-19 15:30:17 +02:00
parent 20c6b82bec
commit c003dfab03
5 changed files with 19 additions and 19 deletions

View file

@ -804,7 +804,7 @@ def main(argv: Optional[list[str]] = None) -> None:
S_VERSION, S_VERSION,
CODENAME, CODENAME,
S_BUILD_DT, S_BUILD_DT,
py_desc().replace("[", "\033[1;30m["), py_desc().replace("[", "\033[90m["),
SQLITE_VER, SQLITE_VER,
JINJA_VER, JINJA_VER,
PYFTPD_VER, PYFTPD_VER,

View file

@ -200,7 +200,7 @@ class HttpSrv(object):
while not self.stopping: while not self.stopping:
if self.args.log_conn: if self.args.log_conn:
self.log(self.name, "|%sC-ncli" % ("-" * 1,), c="1;30") self.log(self.name, "|%sC-ncli" % ("-" * 1,), c="90")
if self.ncli >= self.nclimax: if self.ncli >= self.nclimax:
self.log(self.name, "at connection limit; waiting", 3) self.log(self.name, "at connection limit; waiting", 3)
@ -208,7 +208,7 @@ class HttpSrv(object):
time.sleep(0.1) time.sleep(0.1)
if self.args.log_conn: if self.args.log_conn:
self.log(self.name, "|%sC-acc1" % ("-" * 2,), c="1;30") self.log(self.name, "|%sC-acc1" % ("-" * 2,), c="90")
try: try:
sck, addr = srv_sck.accept() sck, addr = srv_sck.accept()
@ -221,7 +221,7 @@ class HttpSrv(object):
t = "|{}C-acc2 \033[0;36m{} \033[3{}m{}".format( t = "|{}C-acc2 \033[0;36m{} \033[3{}m{}".format(
"-" * 3, ip, port % 8, port "-" * 3, ip, port % 8, port
) )
self.log("%s %s" % addr, t, c="1;30") self.log("%s %s" % addr, t, c="90")
self.accept(sck, addr) self.accept(sck, addr)
@ -328,7 +328,7 @@ class HttpSrv(object):
fno = sck.fileno() fno = sck.fileno()
try: try:
if self.args.log_conn: if self.args.log_conn:
self.log("%s %s" % addr, "|%sC-crun" % ("-" * 4,), c="1;30") self.log("%s %s" % addr, "|%sC-crun" % ("-" * 4,), c="90")
cli.run() cli.run()
@ -343,7 +343,7 @@ class HttpSrv(object):
finally: finally:
sck = cli.s sck = cli.s
if self.args.log_conn: if self.args.log_conn:
self.log("%s %s" % addr, "|%sC-cdone" % ("-" * 5,), c="1;30") self.log("%s %s" % addr, "|%sC-cdone" % ("-" * 5,), c="90")
try: try:
fno = sck.fileno() fno = sck.fileno()
@ -353,7 +353,7 @@ class HttpSrv(object):
self.log( self.log(
"%s %s" % addr, "%s %s" % addr,
"shut({}): {}".format(fno, ex), "shut({}): {}".format(fno, ex),
c="1;30", c="90",
) )
if ex.errno not in E_SCK: if ex.errno not in E_SCK:
raise raise

View file

@ -269,7 +269,7 @@ class ThumbSrv(object):
except Exception as ex: except Exception as ex:
msg = "{} could not create thumbnail of {}\n{}" msg = "{} could not create thumbnail of {}\n{}"
msg = msg.format(fun.__name__, abspath, min_ex()) msg = msg.format(fun.__name__, abspath, min_ex())
c: Union[str, int] = 1 if "<Signals.SIG" in msg else "1;30" c: Union[str, int] = 1 if "<Signals.SIG" in msg else "90"
self.log(msg, c) self.log(msg, c)
if getattr(ex, "returncode", 0) != 321: if getattr(ex, "returncode", 0) != 321:
with open(tpath, "wb") as _: with open(tpath, "wb") as _:
@ -323,7 +323,7 @@ class ThumbSrv(object):
try: try:
im = self.fancy_pillow(im) im = self.fancy_pillow(im)
except Exception as ex: except Exception as ex:
self.log("fancy_pillow {}".format(ex), "1;30") self.log("fancy_pillow {}".format(ex), "90")
im.thumbnail(self.res) im.thumbnail(self.res)
fmts = ["RGB", "L"] fmts = ["RGB", "L"]
@ -423,7 +423,7 @@ class ThumbSrv(object):
if not ret: if not ret:
return return
c: Union[str, int] = "1;30" c: Union[str, int] = "90"
t = "FFmpeg failed (probably a corrupt video file):\n" t = "FFmpeg failed (probably a corrupt video file):\n"
if ( if (
(not self.args.th_ff_jpg or time.time() - int(self.args.th_ff_jpg) < 60) (not self.args.th_ff_jpg or time.time() - int(self.args.th_ff_jpg) < 60)

View file

@ -614,7 +614,7 @@ class Up2k(object):
ft = "\033[0;32m{}{:.0}" ft = "\033[0;32m{}{:.0}"
ff = "\033[0;35m{}{:.0}" ff = "\033[0;35m{}{:.0}"
fv = "\033[0;36m{}:\033[1;30m{}" fv = "\033[0;36m{}:\033[90m{}"
fx = set(("html_head",)) fx = set(("html_head",))
a = [ a = [
(ft if v is True else ff if v is False else fv).format(k, str(v)) (ft if v is True else ff if v is False else fv).format(k, str(v))
@ -1441,7 +1441,7 @@ class Up2k(object):
if self.args.mtag_vv: if self.args.mtag_vv:
t = "parsers for {}: \033[0m{}" t = "parsers for {}: \033[0m{}"
self.log(t.format(ptop, list(parsers.keys())), "1;30") self.log(t.format(ptop, list(parsers.keys())), "90")
self.mtp_parsers[ptop] = parsers self.mtp_parsers[ptop] = parsers
@ -1572,7 +1572,7 @@ class Up2k(object):
all_parsers = self.mtp_parsers[ptop] all_parsers = self.mtp_parsers[ptop]
except: except:
if self.args.mtag_vv: if self.args.mtag_vv:
self.log("no mtp defined for {}".format(ptop), "1;30") self.log("no mtp defined for {}".format(ptop), "90")
return {} return {}
entags = self.entags[ptop] entags = self.entags[ptop]
@ -1584,13 +1584,13 @@ class Up2k(object):
if v.audio == "n": if v.audio == "n":
if self.args.mtag_vv: if self.args.mtag_vv:
t = "skip mtp {}; is no-audio, have audio" t = "skip mtp {}; is no-audio, have audio"
self.log(t.format(k), "1;30") self.log(t.format(k), "90")
continue continue
# is not audio, require audio? # is not audio, require audio?
elif v.audio == "y": elif v.audio == "y":
if self.args.mtag_vv: if self.args.mtag_vv:
t = "skip mtp {}; is audio, have no-audio" t = "skip mtp {}; is audio, have no-audio"
self.log(t.format(k), "1;30") self.log(t.format(k), "90")
continue continue
if v.ext: if v.ext:
@ -1603,7 +1603,7 @@ class Up2k(object):
if not match: if not match:
if self.args.mtag_vv: if self.args.mtag_vv:
t = "skip mtp {}; need file-ext {}, have {}" t = "skip mtp {}; need file-ext {}, have {}"
self.log(t.format(k, v.ext, abspath.rsplit(".")[-1]), "1;30") self.log(t.format(k, v.ext, abspath.rsplit(".")[-1]), "90")
continue continue
parsers[k] = v parsers[k] = v
@ -1651,13 +1651,13 @@ class Up2k(object):
if not qe.mtp: if not qe.mtp:
if self.args.mtag_vv: if self.args.mtag_vv:
t = "tag-thr: {}({})" t = "tag-thr: {}({})"
self.log(t.format(self.mtag.backend, qe.abspath), "1;30") self.log(t.format(self.mtag.backend, qe.abspath), "90")
tags = self.mtag.get(qe.abspath) tags = self.mtag.get(qe.abspath)
else: else:
if self.args.mtag_vv: if self.args.mtag_vv:
t = "tag-thr: {}({})" t = "tag-thr: {}({})"
self.log(t.format(list(qe.mtp.keys()), qe.abspath), "1;30") self.log(t.format(list(qe.mtp.keys()), qe.abspath), "90")
tags = self.mtag.get_bin(qe.mtp, qe.abspath, qe.oth_tags) tags = self.mtag.get_bin(qe.mtp, qe.abspath, qe.oth_tags)
vtags = [ vtags = [

View file

@ -1752,7 +1752,7 @@ def shut_socket(log: "NamedLogger", sck: socket.socket, timeout: int = 3) -> Non
finally: finally:
td = time.time() - t0 td = time.time() - t0
if td >= 1: if td >= 1:
log("shut({}) in {:.3f} sec".format(fd, td), "1;30") log("shut({}) in {:.3f} sec".format(fd, td), "90")
sck.close() sck.close()