mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 12:42:34 +01:00
Remove unnecessary allowExtra and switch from 'text' specs to 'something'
specs in non-arbitrary text situations.
This commit is contained in:
parent
635509c323
commit
de711b5bab
@ -298,8 +298,7 @@ class Factoids(callbacks.Privmsg):
|
|||||||
try:
|
try:
|
||||||
irc.reply(factoids[number])
|
irc.reply(factoids[number])
|
||||||
except IndexError:
|
except IndexError:
|
||||||
irc.error('That\'s not a valid number for that key.')
|
irc.errorInvalid('number for that key')
|
||||||
return
|
|
||||||
else:
|
else:
|
||||||
intro = self.registryValue('factoidPrefix', channel)
|
intro = self.registryValue('factoidPrefix', channel)
|
||||||
prefix = '%s %s' % (utils.quoted(key), intro)
|
prefix = '%s %s' % (utils.quoted(key), intro)
|
||||||
@ -333,8 +332,8 @@ 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', reverse(optional('positiveInt', 0)), 'text'],
|
whatis = wrap(whatis, ['channeldb', reverse(optional('positiveInt', 0)),
|
||||||
allowExtra=True)
|
'something'])
|
||||||
|
|
||||||
def lock(self, irc, msg, args, channel, key):
|
def lock(self, irc, msg, args, channel, key):
|
||||||
"""[<channel>] <key>
|
"""[<channel>] <key>
|
||||||
@ -345,7 +344,7 @@ class Factoids(callbacks.Privmsg):
|
|||||||
"""
|
"""
|
||||||
self.db.lock(channel, key)
|
self.db.lock(channel, key)
|
||||||
irc.replySuccess()
|
irc.replySuccess()
|
||||||
lock = wrap(lock, ['channeldb', 'text'], allowExtra=True)
|
lock = wrap(lock, ['channeldb', 'something'])
|
||||||
|
|
||||||
def unlock(self, irc, msg, args, channel, key):
|
def unlock(self, irc, msg, args, channel, key):
|
||||||
"""[<channel>] <key>
|
"""[<channel>] <key>
|
||||||
@ -356,7 +355,7 @@ class Factoids(callbacks.Privmsg):
|
|||||||
"""
|
"""
|
||||||
self.db.unlock(channel, key)
|
self.db.unlock(channel, key)
|
||||||
irc.replySuccess()
|
irc.replySuccess()
|
||||||
unlock = wrap(unlock, ['channeldb', 'text'], allowExtra=True)
|
unlock = wrap(unlock, ['channeldb', 'something'])
|
||||||
|
|
||||||
def forget(self, irc, msg, args, channel, number, key):
|
def forget(self, irc, msg, args, channel, number, key):
|
||||||
"""[<channel>] <key> [<number>|*]
|
"""[<channel>] <key> [<number>|*]
|
||||||
@ -383,7 +382,7 @@ class Factoids(callbacks.Privmsg):
|
|||||||
'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',
|
||||||
reverse(first('positiveInt', ('literal', '*'))),
|
reverse(first('positiveInt', ('literal', '*'))),
|
||||||
'text'], allowExtra=True)
|
'something'])
|
||||||
|
|
||||||
def random(self, irc, msg, args, channel):
|
def random(self, irc, msg, args, channel):
|
||||||
"""[<channel>]
|
"""[<channel>]
|
||||||
@ -422,7 +421,7 @@ class Factoids(callbacks.Privmsg):
|
|||||||
(utils.quoted(key), locked and 'locked' or 'not locked',
|
(utils.quoted(key), locked and 'locked' or 'not locked',
|
||||||
utils.nItems('factoid', counter), factoids)
|
utils.nItems('factoid', counter), factoids)
|
||||||
irc.reply(s)
|
irc.reply(s)
|
||||||
info = wrap(info, ['channeldb', 'text'], allowExtra=True)
|
info = wrap(info, ['channeldb', 'something'])
|
||||||
|
|
||||||
def change(self, irc, msg, args):
|
def change(self, irc, msg, args):
|
||||||
"""[<channel>] <key> <number> <regexp>
|
"""[<channel>] <key> <number> <regexp>
|
||||||
@ -497,7 +496,7 @@ class Factoids(callbacks.Privmsg):
|
|||||||
irc.reply('No keys matched that query.')
|
irc.reply('No keys matched that query.')
|
||||||
search = wrap(search, ['channeldb',
|
search = wrap(search, ['channeldb',
|
||||||
getopts({'values':'', 'regexp':'regexpMatcher'}),
|
getopts({'values':'', 'regexp':'regexpMatcher'}),
|
||||||
additional('text')])
|
additional('something')]) # XXX 'glob' spec
|
||||||
|
|
||||||
|
|
||||||
Class = Factoids
|
Class = Factoids
|
||||||
|
Loading…
Reference in New Issue
Block a user