mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 11:42:52 +01:00
Needed to catch the possible KeyErrors in config.
This commit is contained in:
parent
a5627c34f8
commit
6e1704a6dd
@ -356,16 +356,20 @@ class Configurable(object):
|
||||
if not name:
|
||||
irc.reply(msg, utils.commaAndify(self.configurables.names()))
|
||||
return
|
||||
if not value:
|
||||
help = self.configurables.help(name)
|
||||
value = self.configurables.get(name, channel=channel)
|
||||
irc.reply(msg, '%s: %s (Current value: %r)' % (name, help, value))
|
||||
return
|
||||
try:
|
||||
self.configurables.set(name, value, channel)
|
||||
irc.reply(msg, conf.replySuccess)
|
||||
except ConfigurableTypeError, e:
|
||||
irc.error(msg, str(e))
|
||||
if not value:
|
||||
help = self.configurables.help(name)
|
||||
value = self.configurables.get(name, channel=channel)
|
||||
s = '%s: %s (Current value: %r)' % (name, help, value)
|
||||
irc.reply(msg, s)
|
||||
return
|
||||
try:
|
||||
self.configurables.set(name, value, channel)
|
||||
irc.reply(msg, conf.replySuccess)
|
||||
except ConfigurableTypeError, e:
|
||||
irc.error(msg, str(e))
|
||||
except KeyError:
|
||||
irc.error(msg, 'There is no config variable %r' % name)
|
||||
|
||||
|
||||
_randomnickRe = re.compile(r'\$randomnick', re.I)
|
||||
|
Loading…
Reference in New Issue
Block a user