mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 02:49:27 +01:00
commands.reversed => commands.reverse
This commit is contained in:
parent
66196683a5
commit
c0a8f5e45d
@ -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):
|
||||
|
@ -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:
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user