assorted whitespace nitpicking
This commit is contained in:
parent
7601b025e1
commit
18fc614a4a
|
@ -83,7 +83,7 @@ class Dice(Module):
|
||||||
else:
|
else:
|
||||||
outstr += ",".join(str(i) for i in a)
|
outstr += ",".join(str(i) for i in a)
|
||||||
outstr += "]"
|
outstr += "]"
|
||||||
|
|
||||||
return (total, outstr)
|
return (total, outstr)
|
||||||
|
|
||||||
def process_roll(self, trials, mods, comment):
|
def process_roll(self, trials, mods, comment):
|
||||||
|
@ -173,7 +173,7 @@ class Dice(Module):
|
||||||
mods = p[1]
|
mods = p[1]
|
||||||
else:
|
else:
|
||||||
mods = [p[1]]
|
mods = [p[1]]
|
||||||
p[0] = self.process_roll(None, mods, p[2])
|
p[0] = self.process_roll(None, mods, p[2])
|
||||||
output = p[0]
|
output = p[0]
|
||||||
|
|
||||||
def p_comment(self, p):
|
def p_comment(self, p):
|
||||||
|
@ -243,7 +243,7 @@ class Dice(Module):
|
||||||
else:
|
else:
|
||||||
p[0] = None
|
p[0] = None
|
||||||
|
|
||||||
def p_dice(self, p):
|
def p_dice(self, p):
|
||||||
'dice : NUMBER "d"'
|
'dice : NUMBER "d"'
|
||||||
p[0] = p[1]
|
p[0] = p[1]
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ class Help(Module):
|
||||||
self.helpre = re.compile('^!help(\s+(\S+)(\s+(.+))?)?\s*$')
|
self.helpre = re.compile('^!help(\s+(\S+)(\s+(.+))?)?\s*$')
|
||||||
|
|
||||||
def do(self, connection, event, nick, userhost, what, admin_unlocked):
|
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"""
|
and dispatch for further processing"""
|
||||||
|
|
||||||
match = self.helpre.search(what)
|
match = self.helpre.search(what)
|
||||||
|
@ -56,7 +56,7 @@ class Help(Module):
|
||||||
description = module.help_description()
|
description = module.help_description()
|
||||||
if description:
|
if description:
|
||||||
message += " %s - %s\n" % (module.__class__.__name__,
|
message += " %s - %s\n" % (module.__class__.__name__,
|
||||||
description)
|
description)
|
||||||
return message
|
return message
|
||||||
|
|
||||||
def handle_help_module(self, modname):
|
def handle_help_module(self, modname):
|
||||||
|
@ -82,7 +82,7 @@ class Help(Module):
|
||||||
return "no help available for module '%s', command '%s'" % (modname, key)
|
return "no help available for module '%s', command '%s'" % (modname, key)
|
||||||
else:
|
else:
|
||||||
return "no module named '%s' is loaded" % (modname)
|
return "no module named '%s' is loaded" % (modname)
|
||||||
|
|
||||||
return "asked for help on module %s detail %s" % (modname, key)
|
return "asked for help on module %s detail %s" % (modname, key)
|
||||||
|
|
||||||
def find_module(self, modname):
|
def find_module(self, modname):
|
||||||
|
@ -103,7 +103,7 @@ class Help(Module):
|
||||||
If this returns None, the summary will be
|
If this returns None, the summary will be
|
||||||
"no help available for module foo"
|
"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"""
|
type '!help Help module' or '!help Help detail' for more information"""
|
||||||
|
|
||||||
def help_detail(self, command):
|
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"""
|
return """get a summary of a module's commands or function"""
|
||||||
elif command == 'detail':
|
elif command == 'detail':
|
||||||
return """get information on a specific module-defined detail"""
|
return """get information on a specific module-defined detail"""
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
@ -177,7 +177,7 @@ class IrcAdmin(Module):
|
||||||
If this returns None, the summary will be
|
If this returns None, the summary will be
|
||||||
"no help available for module foo"
|
"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"""
|
!join, !part, !quit, !autojoin, !save, !nick, !load, !reload, !unload, !modules"""
|
||||||
|
|
||||||
def help_detail(self, command):
|
def help_detail(self, command):
|
||||||
|
|
|
@ -31,13 +31,13 @@ class Markov(Module):
|
||||||
"""
|
"""
|
||||||
Create a chatterbot very similar to a MegaHAL, but simpler and
|
Create a chatterbot very similar to a MegaHAL, but simpler and
|
||||||
implemented in pure Python. Proof of concept code from Ape.
|
implemented in pure Python. Proof of concept code from Ape.
|
||||||
|
|
||||||
Ape wrote: based on this:
|
Ape wrote: based on this:
|
||||||
http://uswaretech.com/blog/2009/06/pseudo-random-text-markov-chains-python/
|
http://uswaretech.com/blog/2009/06/pseudo-random-text-markov-chains-python/
|
||||||
and this:
|
and this:
|
||||||
http://code.activestate.com/recipes/194364-the-markov-chain-algorithm/
|
http://code.activestate.com/recipes/194364-the-markov-chain-algorithm/
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, irc, config, server):
|
def __init__(self, irc, config, server):
|
||||||
"""Create the Markov chainer, and learn text from a file if available."""
|
"""Create the Markov chainer, and learn text from a file if available."""
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue