From 18fc614a4aedabae31efec2e3df39bf807b22a13 Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Thu, 20 Jan 2011 14:15:10 -0600 Subject: [PATCH] assorted whitespace nitpicking --- modules/Dice.py | 6 +++--- modules/Help.py | 10 +++++----- modules/IrcAdmin.py | 2 +- modules/Markov.py | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/Dice.py b/modules/Dice.py index d64750c..c2089f8 100644 --- a/modules/Dice.py +++ b/modules/Dice.py @@ -83,7 +83,7 @@ class Dice(Module): else: outstr += ",".join(str(i) for i in a) outstr += "]" - + return (total, outstr) def process_roll(self, trials, mods, comment): @@ -173,7 +173,7 @@ class Dice(Module): mods = p[1] else: mods = [p[1]] - p[0] = self.process_roll(None, mods, p[2]) + p[0] = self.process_roll(None, mods, p[2]) output = p[0] def p_comment(self, p): @@ -243,7 +243,7 @@ class Dice(Module): else: p[0] = None - def p_dice(self, p): + def p_dice(self, p): 'dice : NUMBER "d"' p[0] = p[1] diff --git a/modules/Help.py b/modules/Help.py index e113cb4..8bc16a4 100755 --- a/modules/Help.py +++ b/modules/Help.py @@ -36,7 +36,7 @@ class Help(Module): self.helpre = re.compile('^!help(\s+(\S+)(\s+(.+))?)?\s*$') def do(self, connection, event, nick, userhost, what, admin_unlocked): - """look for !help and subcommands, + """look for !help and subcommands, and dispatch for further processing""" match = self.helpre.search(what) @@ -56,7 +56,7 @@ class Help(Module): description = module.help_description() if description: message += " %s - %s\n" % (module.__class__.__name__, - description) + description) return message def handle_help_module(self, modname): @@ -82,7 +82,7 @@ class Help(Module): return "no help available for module '%s', command '%s'" % (modname, key) else: return "no module named '%s' is loaded" % (modname) - + return "asked for help on module %s detail %s" % (modname, key) def find_module(self, modname): @@ -103,7 +103,7 @@ class Help(Module): If this returns None, the summary will be "no help available for module foo" """ - return """!help [module [detail]] + return """!help [module [detail]] type '!help Help module' or '!help Help detail' for more information""" def help_detail(self, command): @@ -113,7 +113,7 @@ type '!help Help module' or '!help Help detail' for more information""" return """get a summary of a module's commands or function""" elif command == 'detail': return """get information on a specific module-defined detail""" - else: + else: return None if __name__ == "__main__": diff --git a/modules/IrcAdmin.py b/modules/IrcAdmin.py index 3685faa..7e3e550 100644 --- a/modules/IrcAdmin.py +++ b/modules/IrcAdmin.py @@ -177,7 +177,7 @@ class IrcAdmin(Module): If this returns None, the summary will be "no help available for module foo" """ - return """Bot admin commands (do '!help IrcAdmin [cmd] for details): + return """Bot admin commands (do '!help IrcAdmin [cmd] for details): !join, !part, !quit, !autojoin, !save, !nick, !load, !reload, !unload, !modules""" def help_detail(self, command): diff --git a/modules/Markov.py b/modules/Markov.py index 7f56b93..47e0579 100644 --- a/modules/Markov.py +++ b/modules/Markov.py @@ -31,13 +31,13 @@ class Markov(Module): """ Create a chatterbot very similar to a MegaHAL, but simpler and implemented in pure Python. Proof of concept code from Ape. - + Ape wrote: based on this: http://uswaretech.com/blog/2009/06/pseudo-random-text-markov-chains-python/ and this: http://code.activestate.com/recipes/194364-the-markov-chain-algorithm/ """ - + def __init__(self, irc, config, server): """Create the Markov chainer, and learn text from a file if available."""