mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-24 03:29:28 +01:00
servermaps: simplify output format
Drawing all the |'s and `'s is a rather complex process, so just replace this with bullet-point output.
This commit is contained in:
parent
60b595ea6f
commit
dfa75f6606
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user