From dfa75f660645c1be677fbba445d283ac4c1216c3 Mon Sep 17 00:00:00 2001 From: James Lu Date: Sat, 24 Sep 2016 12:02:43 -0700 Subject: [PATCH] servermaps: simplify output format Drawing all the |'s and `'s is a rather complex process, so just replace this with bullet-point output. --- plugins/servermaps.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/servermaps.py b/plugins/servermaps.py index 85e448e..b658b67 100644 --- a/plugins/servermaps.py +++ b/plugins/servermaps.py @@ -65,15 +65,12 @@ def _map(irc, source, args, show_relay=True): # Don't show relay subservers more than once. continue - # If we reach the end of a server's map, display `- instead of |- for prettier output. - linechar = '`-' if leafcount == len(leaves)-1 else '|-' - serverusers = len(serverlist[leaf].users) if is_relay_server: # Skip showing user data for relay servers. - reply("%s%s\x02%s\x02[%s] (via PyLink Relay)" % (' '*hops, linechar, serverlist[leaf].name, leaf)) + reply("%s-\x02%s\x02[%s] (via PyLink Relay)" % (' '*hops, serverlist[leaf].name, leaf)) else: - reply("%s%s\x02%s\x02[%s]: %s user(s) (%s%%)" % (' '*hops, linechar, serverlist[leaf].name, leaf, + reply("%s-\x02%s\x02[%s]: %s user(s) (%s%%)" % (' '*hops, serverlist[leaf].name, leaf, serverusers, _percent(serverusers, usercount))) showall(ircobj, leaf, hops, is_relay_server=is_relay_server)