From 7b738fddd1fb97ba14b34549943639dec471eb89 Mon Sep 17 00:00:00 2001 From: Embolalia Date: Fri, 3 Jul 2015 14:24:44 -0400 Subject: [PATCH] help: Remove configurability for number of help lines This isn't KDE; we can pick sane defaults for things nobody will ever think to configure. --- willie/modules/help.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/willie/modules/help.py b/willie/modules/help.py index 2ef6c7ffcc..fd39ff2895 100644 --- a/willie/modules/help.py +++ b/willie/modules/help.py @@ -13,16 +13,6 @@ from willie.tools import iterkeys -def setup(bot=None): - if not bot: - return - - if (bot.config.has_option('help', 'threshold') and not - bot.config.help.threshold.isdecimal()): # non-negative integer - from willie.config import ConfigurationError - raise ConfigurationError("Attribute threshold of section [help] must be a nonnegative integer") - - @rule('$nick' '(?i)(help|doc) +([A-Za-z]+)(?:\?+)?$') @example('.help tell') @commands('help') @@ -35,10 +25,8 @@ def help(bot, trigger): name = trigger.group(2) name = name.lower() - if bot.config.has_option('help', 'threshold'): - threshold = int(bot.config.help.threshold) - else: - threshold = 3 + # number of lines of help to show + threshold = 3 if name in bot.doc: if len(bot.doc[name][0]) + (1 if bot.doc[name][1] else 0) > threshold: