From be3e5e482a9613bf3bb0c5cc32289a9e48839e6e Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Mon, 3 Nov 2003 17:45:48 +0000 Subject: [PATCH] Changed magic numbers to variables. --- plugins/QuoteGrabs.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/QuoteGrabs.py b/plugins/QuoteGrabs.py index 178670363..2e684d845 100644 --- a/plugins/QuoteGrabs.py +++ b/plugins/QuoteGrabs.py @@ -63,6 +63,8 @@ Add an example IRC session using this module here. """) grabTime = 864000 # 10 days +minRandomLength = 8 +minRandomWords = 3 class QuoteGrabs(plugins.ChannelDBHandler, plugins.Toggleable, @@ -95,7 +97,8 @@ class QuoteGrabs(plugins.ChannelDBHandler, if ircutils.isChannel(msg.args[0]): channel = msg.args[0] if self.toggles.get('random', channel): - if len(msg.args[1]) > 8 and len(msg.args[1].split()) > 3: + if len(msg.args[1]) > minRandomLength and \ + len(msg.args[1].split()) > minRandomWords: db = self.getDb(channel) cursor = db.cursor() cursor.execute("""SELECT added_at FROM quotegrabs