From 4bc4c0d8584e4fb36dbc27d380d3f2e78ffc2a08 Mon Sep 17 00:00:00 2001 From: Mike Mueller Date: Sat, 24 Mar 2012 15:20:03 -0700 Subject: [PATCH] Make _start_game arguments generic. It shouldn't need to know what specific parameters the game will take. (And its "length" parameter was out of date since the games currently use "difficulty".) --- plugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin.py b/plugin.py index 8fff3c9..e94cacd 100644 --- a/plugin.py +++ b/plugin.py @@ -118,7 +118,7 @@ class Wordgames(callbacks.Plugin): raise WordgamesError("Unable to open word file: %s" % path) return filter(regexp.match, map(str.strip, wordFile.readlines())) - def _start_game(self, Game, irc, channel, length): + def _start_game(self, Game, irc, channel, *args, **kwargs): try: game = self.games.get(channel) if game and game.is_running(): @@ -126,7 +126,7 @@ class Wordgames(callbacks.Plugin): game.show() else: words = self._get_words() - self.games[channel] = Game(words, irc, channel, length) + self.games[channel] = Game(words, irc, channel, *args, **kwargs) self.games[channel].start() except WordgamesError, e: irc.reply('Wordgames error: %s' % str(e))