mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-19 08:59: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)
|
factoids = self.db.get(channel, key)
|
||||||
self._replyFactoids(irc, channel, key, factoids, number)
|
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)
|
allowExtra=True)
|
||||||
|
|
||||||
def lock(self, irc, msg, args, channel, key):
|
def lock(self, irc, msg, args, channel, key):
|
||||||
@ -382,7 +382,7 @@ class Factoids(callbacks.Privmsg):
|
|||||||
'Please specify which one to remove, '
|
'Please specify which one to remove, '
|
||||||
'or use * to designate all of them.' % str(e))
|
'or use * to designate all of them.' % str(e))
|
||||||
forget = wrap(forget, ['channeldb',
|
forget = wrap(forget, ['channeldb',
|
||||||
reversed(first('positiveInt', ('literal', '*'))),
|
reverse(first('positiveInt', ('literal', '*'))),
|
||||||
'text'], allowExtra=True)
|
'text'], allowExtra=True)
|
||||||
|
|
||||||
def random(self, irc, msg, args, channel):
|
def random(self, irc, msg, args, channel):
|
||||||
|
@ -660,10 +660,10 @@ class first(context):
|
|||||||
else:
|
else:
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
class reversed(context):
|
class reverse(context):
|
||||||
def __call__(self, irc, msg, args, state):
|
def __call__(self, irc, msg, args, state):
|
||||||
args[:] = args[::-1]
|
args[:] = args[::-1]
|
||||||
super(reversed, self).__call__(irc, msg, args, state)
|
super(reverse, self).__call__(irc, msg, args, state)
|
||||||
args[:] = args[::-1]
|
args[:] = args[::-1]
|
||||||
|
|
||||||
class getopts(context):
|
class getopts(context):
|
||||||
@ -780,7 +780,7 @@ def wrap(f, specList=[], **kw):
|
|||||||
|
|
||||||
|
|
||||||
__all__ = ['wrap', 'context', 'additional', 'optional', 'any', 'compose',
|
__all__ = ['wrap', 'context', 'additional', 'optional', 'any', 'compose',
|
||||||
'Spec', 'first', 'urlSnarfer', 'thread', 'reversed',
|
'Spec', 'first', 'urlSnarfer', 'thread', 'reverse',
|
||||||
'many', 'getopts', 'getConverter', 'addConverter', 'callConverter']
|
'many', 'getopts', 'getConverter', 'addConverter', 'callConverter']
|
||||||
|
|
||||||
if world.testing:
|
if world.testing:
|
||||||
|
@ -69,8 +69,8 @@ class CommandsTestCase(SupyTestCase):
|
|||||||
self.assertRaises(callbacks.Error,
|
self.assertRaises(callbacks.Error,
|
||||||
self.assertState, spec, ['foo'], ['asdf'])
|
self.assertState, spec, ['foo'], ['asdf'])
|
||||||
|
|
||||||
def testReversed(self):
|
def testReverse(self):
|
||||||
spec = [reversed('positiveInt'), 'float', 'text']
|
spec = [reverse('positiveInt'), 'float', 'text']
|
||||||
self.assertState(spec, ['-1.0', 'foo', '1'], [1, -1.0, 'foo'])
|
self.assertState(spec, ['-1.0', 'foo', '1'], [1, -1.0, 'foo'])
|
||||||
|
|
||||||
def testGetopts(self):
|
def testGetopts(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user