Skip to content

Commit

Permalink
help: Remove configurability for number of help lines
Browse files Browse the repository at this point in the history
This isn't KDE; we can pick sane defaults for things nobody will ever
think to configure.
  • Loading branch information
embolalia committed Jul 3, 2015
1 parent 8be94aa commit 7b738fd
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions willie/modules/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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:
Expand Down

0 comments on commit 7b738fd

Please sign in to comment.