diff --git a/src/Owner.py b/src/Owner.py index d8a1537e6..c05b2acea 100644 --- a/src/Owner.py +++ b/src/Owner.py @@ -185,17 +185,17 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg): setattr(conf, name, value) irc.reply(msg, conf.replySuccess) elif name: - typetable = {'mystr': 'string', - 'mybool': 'boolean', - 'float': 'float'} - + typeNames = {conf.mystr: 'string', + conf.mybool: 'boolean', + float: 'float'} try: - vtype = conf.types[name].__name__ + type = typeNames[conf.types[name]] except KeyError: - irc.error(msg, 'That conf variable doesn\'t exist.') + irc.error(msg, 'That configuration variable doesn\'t exist.') return try: - irc.reply(msg, '%s is a %s.' % (name, typetable[vtype])) + value = getattr(conf, name) + irc.reply(msg, '%s is a %s (%s).' % (name, type, value)) except KeyError: irc.error(msg, '%s is of an unknown type.' % name) else: diff --git a/test/test_Owner.py b/test/test_Owner.py index 68b62c0da..dc1c9eafd 100644 --- a/test/test_Owner.py +++ b/test/test_Owner.py @@ -101,9 +101,9 @@ class OwnerTestCase(PluginTestCase, PluginDocumentation): def testSetconf(self): self.assertRegexp('setconf', 'confDir') self.assertNotRegexp('setconf', 'allowEval') - self.assertResponse('setconf confDir', 'confDir is a string.') - self.assertResponse('setconf whackyConfOption', - 'Error: That conf variable doesn\'t exist.') + self.assertResponse('setconf confDir', + 'confDir is a string (%s).' % conf.confDir) + self.assertError('setconf whackyConfOption') try: originalConfAllowEval = conf.allowEval conf.allowEval = False