mirror of
https://github.com/jlu5/SupyPlugins.git
synced 2025-05-04 01:10:59 -05:00
MCInfo: more compact row iteration
This commit is contained in:
parent
35e82ca785
commit
8bc77c8f63
@ -153,8 +153,7 @@ class MCInfo(callbacks.Plugin):
|
||||
recipe.append(rowitems)
|
||||
|
||||
irc.reply("Recipe for %s uses: %s" % (ircutils.bold(item), ircutils.bold(ingredients)))
|
||||
for row in recipe:
|
||||
if any(row): # Only output rows that have filled squares.
|
||||
for row in filter(any, recipe): # Only output rows that have filled squares.
|
||||
# For each item, center its name based on the length of the longest item name in the
|
||||
# recipe. This gives the grid a more monospace-y feel.
|
||||
items = [s.center(maxitemlength, '-') for s in row]
|
||||
|
Loading…
x
Reference in New Issue
Block a user