From 42270718e92f6f202fa7a4e5d5705990162c6d69 Mon Sep 17 00:00:00 2001 From: Ryan Hitchman Date: Wed, 18 Nov 2009 18:49:51 -0700 Subject: [PATCH] make argument naming more consistent (input) -> (inp) --- plugins/bf.py | 4 ++-- plugins/dice.py | 6 +++--- plugins/hash.py | 12 ++++++------ plugins/pyexec.py | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/plugins/bf.py b/plugins/bf.py index f70d198..ce9fac7 100644 --- a/plugins/bf.py +++ b/plugins/bf.py @@ -12,10 +12,10 @@ MAX_STEPS = 1000000 @hook.command -def bf(input): +def bf(inp): """Runs a Brainfuck program.""" - program = re.sub('[^][<>+-.,]', '', input) + program = re.sub('[^][<>+-.,]', '', inp) # create a dict of brackets pairs, for speed later on brackets={} diff --git a/plugins/dice.py b/plugins/dice.py index 6edb920..fcb5522 100644 --- a/plugins/dice.py +++ b/plugins/dice.py @@ -30,13 +30,13 @@ def nrolls(count, n): @hook.command -def dice(input): +def dice(inp): ".dice - simulates dicerolls, e.g. .dice 2d20-d5+4 roll 2 " \ "D20s, subtract 1D5, add 4" - if not input.strip(): + if not inp.strip(): return dice.__doc__ - spec = whitespace_re.sub('', input) + spec = whitespace_re.sub('', inp) if not valid_diceroll_re.match(spec): return "Invalid diceroll" sum = 0 diff --git a/plugins/hash.py b/plugins/hash.py index f4f5956..5df4e47 100644 --- a/plugins/hash.py +++ b/plugins/hash.py @@ -4,16 +4,16 @@ from util import hook @hook.command -def md5(input): - return hashlib.md5(input).hexdigest() +def md5(inp): + return hashlib.md5(inp).hexdigest() @hook.command -def sha1(input): - return hashlib.sha1(input).hexdigest() +def sha1(inp): + return hashlib.sha1(inp).hexdigest() @hook.command -def hash(input): - return ', '.join(x + ": " + getattr(hashlib, x)(input).hexdigest() +def hash(inp): + return ', '.join(x + ": " + getattr(hashlib, x)(inp).hexdigest() for x in 'md5 sha1 sha256'.split()) diff --git a/plugins/pyexec.py b/plugins/pyexec.py index 431d386..d0b5542 100644 --- a/plugins/pyexec.py +++ b/plugins/pyexec.py @@ -8,9 +8,9 @@ re_lineends = re.compile(r'[\r\n]*') @hook.command -def py(input): +def py(inp): res = urllib.urlopen("http://eval.appspot.com/eval?statement=%s" % - urllib.quote(input.strip(), safe='')).readlines() + urllib.quote(inp.strip(), safe='')).readlines() if len(res) == 0: return res[0] = re_lineends.split(res[0])[0]