diff --git a/copyparty/tcpsrv.py b/copyparty/tcpsrv.py index 23121793..256b9394 100644 --- a/copyparty/tcpsrv.py +++ b/copyparty/tcpsrv.py @@ -402,17 +402,17 @@ def netmon(self): if not netdevs: continue - added = "nothing" - removed = "nothing" + add = [] + rem = [] for k, v in netdevs.items(): if k not in self.netdevs: - added = "{} = {}".format(k, v) + add.append("\n added %s = %s" % (k, v)) for k, v in self.netdevs.items(): if k not in netdevs: - removed = "{} = {}".format(k, v) + rem.append("\nremoved %s = %s" % (k, v)) - t = "network change detected:\n added {}\033[0;33m\nremoved {}" - self.log("tcpsrv", t.format(added, removed), 3) + t = "network change detected:\033[32m%s\033[33m%s" + self.log("tcpsrv", t % ("".join(add), "".join(rem)), 3) self.netdevs = netdevs self._distribute_netdevs()