mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 20:52:42 +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:
|
if not name:
|
||||||
irc.reply(msg, utils.commaAndify(self.configurables.names()))
|
irc.reply(msg, utils.commaAndify(self.configurables.names()))
|
||||||
return
|
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:
|
try:
|
||||||
self.configurables.set(name, value, channel)
|
if not value:
|
||||||
irc.reply(msg, conf.replySuccess)
|
help = self.configurables.help(name)
|
||||||
except ConfigurableTypeError, e:
|
value = self.configurables.get(name, channel=channel)
|
||||||
irc.error(msg, str(e))
|
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)
|
_randomnickRe = re.compile(r'\$randomnick', re.I)
|
||||||
|
Loading…
Reference in New Issue
Block a user