From 1384d1976fa984b6b254c93677363f67944c0c7a Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 9 May 2010 21:49:15 +0200 Subject: Made everything much more error resistant --- modules/help.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules/help.py') diff --git a/modules/help.py b/modules/help.py index ed3e4d3..99f05a4 100644 --- a/modules/help.py +++ b/modules/help.py @@ -1,4 +1,4 @@ -from base import ModuleBase +from . import ModuleBase import re class Module(ModuleBase): @@ -12,8 +12,8 @@ class Module(ModuleBase): if not re.match(r'!help(?:\W|\Z)', text): return - commands = reduce(lambda l, mod: l + mod.commands(), self.manager.modules.itervalues(), []) + commands = self.manager.commands() helpstring = reduce(lambda s, (c, h): s + c + ': ' + h + '\n', commands, '') - helptexts = '\n'.join(reduce(lambda l, mod: l + mod.helptexts(), self.manager.modules.itervalues(), [])) + helptexts = '\n'.join(self.manager.helptexts()) handler.reply(('Befehle:\n' + helpstring + '\n' + helptexts).strip()) -- cgit v1.2.3