Storycraft: don't flood the target with storycraft_listgames, display only ids if count > 5

This commit is contained in:
Brian S. Stephan 2011-01-09 11:12:27 -06:00
parent fd22cb64d4
commit 797f660a9e
1 changed files with 9 additions and 6 deletions

View File

@ -288,15 +288,18 @@ class Storycraft(Module):
if category == 'open':
games = self._get_open_games()
gamestrs = []
for game in games:
gamestrs.append(self._get_game_summary(game))
return '\n'.join(gamestrs)
elif category == 'in progress':
games = self._get_in_progress_games()
if len(games) > 5:
# just list the game ids
gameids = []
for game in games:
gameids.append(str(game.id))
return 'Too many to list! ids: ' + ','.join(gameids)
else:
# show game details, since there's not many
gamestrs = []
for game in games:
gamestrs.append(self._get_game_summary(game))