Added maxwidth argument to evtable, for restricting upper width of table, but allowing it to resize if narrower.

This commit is contained in:
Griatch 2014-02-27 00:06:39 +01:00
parent 0d071ec75f
commit 7bde8afe66
2 changed files with 14 additions and 4 deletions

View file

@ -799,7 +799,7 @@ class CmdIRC2Chan(MuxCommand):
ircbots = [bot.typeclass for bot in PlayerDB.objects.filter(db_is_bot=True)]
if ircbots:
from src.utils.evtable import EvTable
table = EvTable("dbid", "botname", "ev-channel", "irc-channel", width=78, border_width=1)
table = EvTable("{wdbid{n", "{wbotname{n", "{wev-channel{n", "{wirc-channel{n", border="cells")
for ircbot in ircbots:
ircinfo = "%s (%s:%s)" % (ircbot.db.irc_channel, ircbot.db.irc_network, ircbot.db.irc_port)
table.add_row(ircbot.id, ircbot.db.irc_botname, ircbot.db.ev_channel, ircinfo)