mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
unbold ansi grays
This commit is contained in:
parent
20c6b82bec
commit
c003dfab03
|
@ -804,7 +804,7 @@ def main(argv: Optional[list[str]] = None) -> None:
|
|||
S_VERSION,
|
||||
CODENAME,
|
||||
S_BUILD_DT,
|
||||
py_desc().replace("[", "\033[1;30m["),
|
||||
py_desc().replace("[", "\033[90m["),
|
||||
SQLITE_VER,
|
||||
JINJA_VER,
|
||||
PYFTPD_VER,
|
||||
|
|
|
@ -200,7 +200,7 @@ class HttpSrv(object):
|
|||
|
||||
while not self.stopping:
|
||||
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:
|
||||
self.log(self.name, "at connection limit; waiting", 3)
|
||||
|
@ -208,7 +208,7 @@ class HttpSrv(object):
|
|||
time.sleep(0.1)
|
||||
|
||||
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:
|
||||
sck, addr = srv_sck.accept()
|
||||
|
@ -221,7 +221,7 @@ class HttpSrv(object):
|
|||
t = "|{}C-acc2 \033[0;36m{} \033[3{}m{}".format(
|
||||
"-" * 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)
|
||||
|
||||
|
@ -328,7 +328,7 @@ class HttpSrv(object):
|
|||
fno = sck.fileno()
|
||||
try:
|
||||
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()
|
||||
|
||||
|
@ -343,7 +343,7 @@ class HttpSrv(object):
|
|||
finally:
|
||||
sck = cli.s
|
||||
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:
|
||||
fno = sck.fileno()
|
||||
|
@ -353,7 +353,7 @@ class HttpSrv(object):
|
|||
self.log(
|
||||
"%s %s" % addr,
|
||||
"shut({}): {}".format(fno, ex),
|
||||
c="1;30",
|
||||
c="90",
|
||||
)
|
||||
if ex.errno not in E_SCK:
|
||||
raise
|
||||
|
|
|
@ -269,7 +269,7 @@ class ThumbSrv(object):
|
|||
except Exception as ex:
|
||||
msg = "{} could not create thumbnail of {}\n{}"
|
||||
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)
|
||||
if getattr(ex, "returncode", 0) != 321:
|
||||
with open(tpath, "wb") as _:
|
||||
|
@ -323,7 +323,7 @@ class ThumbSrv(object):
|
|||
try:
|
||||
im = self.fancy_pillow(im)
|
||||
except Exception as ex:
|
||||
self.log("fancy_pillow {}".format(ex), "1;30")
|
||||
self.log("fancy_pillow {}".format(ex), "90")
|
||||
im.thumbnail(self.res)
|
||||
|
||||
fmts = ["RGB", "L"]
|
||||
|
@ -423,7 +423,7 @@ class ThumbSrv(object):
|
|||
if not ret:
|
||||
return
|
||||
|
||||
c: Union[str, int] = "1;30"
|
||||
c: Union[str, int] = "90"
|
||||
t = "FFmpeg failed (probably a corrupt video file):\n"
|
||||
if (
|
||||
(not self.args.th_ff_jpg or time.time() - int(self.args.th_ff_jpg) < 60)
|
||||
|
|
|
@ -614,7 +614,7 @@ class Up2k(object):
|
|||
|
||||
ft = "\033[0;32m{}{:.0}"
|
||||
ff = "\033[0;35m{}{:.0}"
|
||||
fv = "\033[0;36m{}:\033[1;30m{}"
|
||||
fv = "\033[0;36m{}:\033[90m{}"
|
||||
fx = set(("html_head",))
|
||||
a = [
|
||||
(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:
|
||||
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
|
||||
|
||||
|
@ -1572,7 +1572,7 @@ class Up2k(object):
|
|||
all_parsers = self.mtp_parsers[ptop]
|
||||
except:
|
||||
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 {}
|
||||
|
||||
entags = self.entags[ptop]
|
||||
|
@ -1584,13 +1584,13 @@ class Up2k(object):
|
|||
if v.audio == "n":
|
||||
if self.args.mtag_vv:
|
||||
t = "skip mtp {}; is no-audio, have audio"
|
||||
self.log(t.format(k), "1;30")
|
||||
self.log(t.format(k), "90")
|
||||
continue
|
||||
# is not audio, require audio?
|
||||
elif v.audio == "y":
|
||||
if self.args.mtag_vv:
|
||||
t = "skip mtp {}; is audio, have no-audio"
|
||||
self.log(t.format(k), "1;30")
|
||||
self.log(t.format(k), "90")
|
||||
continue
|
||||
|
||||
if v.ext:
|
||||
|
@ -1603,7 +1603,7 @@ class Up2k(object):
|
|||
if not match:
|
||||
if self.args.mtag_vv:
|
||||
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
|
||||
|
||||
parsers[k] = v
|
||||
|
@ -1651,13 +1651,13 @@ class Up2k(object):
|
|||
if not qe.mtp:
|
||||
if self.args.mtag_vv:
|
||||
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)
|
||||
else:
|
||||
if self.args.mtag_vv:
|
||||
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)
|
||||
vtags = [
|
||||
|
|
|
@ -1752,7 +1752,7 @@ def shut_socket(log: "NamedLogger", sck: socket.socket, timeout: int = 3) -> Non
|
|||
finally:
|
||||
td = time.time() - t0
|
||||
if td >= 1:
|
||||
log("shut({}) in {:.3f} sec".format(fd, td), "1;30")
|
||||
log("shut({}) in {:.3f} sec".format(fd, td), "90")
|
||||
|
||||
sck.close()
|
||||
|
||||
|
|
Loading…
Reference in a new issue