From 2a90286a7c65b216811699d6dff24f22bd09bcf6 Mon Sep 17 00:00:00 2001 From: ed Date: Wed, 3 Feb 2021 00:25:13 +0100 Subject: [PATCH] dim the socket debug msgs --- copyparty/broker_mpw.py | 2 +- copyparty/broker_thr.py | 2 +- copyparty/httpsrv.py | 6 +++--- copyparty/tcpsrv.py | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/copyparty/broker_mpw.py b/copyparty/broker_mpw.py index 815ca50a..b1a5abd3 100644 --- a/copyparty/broker_mpw.py +++ b/copyparty/broker_mpw.py @@ -73,7 +73,7 @@ class MpWorker(object): if PY2: sck = pickle.loads(sck) # nosec - self.log("%s %s" % addr, "-" * 4 + "C-qpop") + self.log("%s %s" % addr, "\033[1;30m|%sC-qpop\033[0m" % ("-" * 4,)) self.httpsrv.accept(sck, addr) with self.mutex: diff --git a/copyparty/broker_thr.py b/copyparty/broker_thr.py index 855387bf..b9d107f8 100644 --- a/copyparty/broker_thr.py +++ b/copyparty/broker_thr.py @@ -28,7 +28,7 @@ class BrokerThr(object): def put(self, want_retval, dest, *args): if dest == "httpconn": sck, addr = args - self.log("%s %s" % addr, "-" * 4 + "C-qpop") + self.log("%s %s" % addr, "\033[1;30m|%sC-qpop\033[0m" % ("-" * 4,)) self.httpsrv.accept(sck, addr) else: diff --git a/copyparty/httpsrv.py b/copyparty/httpsrv.py index e8486185..84b4255e 100644 --- a/copyparty/httpsrv.py +++ b/copyparty/httpsrv.py @@ -38,7 +38,7 @@ class HttpSrv(object): def accept(self, sck, addr): """takes an incoming tcp connection and creates a thread to handle it""" - self.log("%s %s" % addr, "-" * 5 + "C-cthr") + self.log("%s %s" % addr, "\033[1;30m|%sC-cthr\033[0m" % ("-" * 5,)) thr = threading.Thread(target=self.thr_client, args=(sck, addr)) thr.daemon = True thr.start() @@ -66,11 +66,11 @@ class HttpSrv(object): thr.start() try: - self.log("%s %s" % addr, "-" * 6 + "C-crun") + self.log("%s %s" % addr, "\033[1;30m|%sC-crun\033[0m" % ("-" * 6,)) cli.run() finally: - self.log("%s %s" % addr, "-" * 7 + "C-done") + self.log("%s %s" % addr, "\033[1;30m|%sC-cdone\033[0m" % ("-" * 7,)) try: sck.shutdown(socket.SHUT_RDWR) sck.close() diff --git a/copyparty/tcpsrv.py b/copyparty/tcpsrv.py index f7ae383d..a31cd07c 100644 --- a/copyparty/tcpsrv.py +++ b/copyparty/tcpsrv.py @@ -58,14 +58,14 @@ class TcpSrv(object): self.log("tcpsrv", "listening @ {0}:{1}".format(self.args.i, self.args.p)) while True: - self.log("tcpsrv", "-" * 1 + "C-ncli") + self.log("tcpsrv", "\033[1;30m|%sC-ncli\033[0m" % ("-" * 1,)) if self.num_clients.v >= self.args.nc: time.sleep(0.1) continue - self.log("tcpsrv", "-" * 2 + "C-acc1") + self.log("tcpsrv", "\033[1;30m|%sC-acc1\033[0m" % ("-" * 2,)) sck, addr = self.srv.accept() - self.log("%s %s" % addr, "-" * 3 + "C-acc2") + self.log("%s %s" % addr, "\033[1;30m|%sC-acc2\033[0m" % ("-" * 3,)) self.num_clients.add() self.hub.broker.put(False, "httpconn", sck, addr)