diff --git a/plugins/Factoids.py b/plugins/Factoids.py index 55ad49ba8..23a0e01af 100644 --- a/plugins/Factoids.py +++ b/plugins/Factoids.py @@ -333,7 +333,7 @@ class Factoids(callbacks.Privmsg): """ factoids = self.db.get(channel, key) self._replyFactoids(irc, channel, key, factoids, number) - whatis = wrap(whatis, ['channeldb', reversed(optional('positiveInt', 0)), 'text'], + whatis = wrap(whatis, ['channeldb', reverse(optional('positiveInt', 0)), 'text'], allowExtra=True) def lock(self, irc, msg, args, channel, key): @@ -382,7 +382,7 @@ class Factoids(callbacks.Privmsg): 'Please specify which one to remove, ' 'or use * to designate all of them.' % str(e)) forget = wrap(forget, ['channeldb', - reversed(first('positiveInt', ('literal', '*'))), + reverse(first('positiveInt', ('literal', '*'))), 'text'], allowExtra=True) def random(self, irc, msg, args, channel): diff --git a/src/commands.py b/src/commands.py index 799006706..c51737724 100644 --- a/src/commands.py +++ b/src/commands.py @@ -660,10 +660,10 @@ class first(context): else: raise e -class reversed(context): +class reverse(context): def __call__(self, irc, msg, args, state): args[:] = args[::-1] - super(reversed, self).__call__(irc, msg, args, state) + super(reverse, self).__call__(irc, msg, args, state) args[:] = args[::-1] class getopts(context): @@ -780,7 +780,7 @@ def wrap(f, specList=[], **kw): __all__ = ['wrap', 'context', 'additional', 'optional', 'any', 'compose', - 'Spec', 'first', 'urlSnarfer', 'thread', 'reversed', + 'Spec', 'first', 'urlSnarfer', 'thread', 'reverse', 'many', 'getopts', 'getConverter', 'addConverter', 'callConverter'] if world.testing: diff --git a/test/test_commands.py b/test/test_commands.py index e2d609dea..5ec04c79b 100644 --- a/test/test_commands.py +++ b/test/test_commands.py @@ -69,8 +69,8 @@ class CommandsTestCase(SupyTestCase): self.assertRaises(callbacks.Error, self.assertState, spec, ['foo'], ['asdf']) - def testReversed(self): - spec = [reversed('positiveInt'), 'float', 'text'] + def testReverse(self): + spec = [reverse('positiveInt'), 'float', 'text'] self.assertState(spec, ['-1.0', 'foo', '1'], [1, -1.0, 'foo']) def testGetopts(self):