From d71f46398059cb408869a59dfb22e6e48965856d Mon Sep 17 00:00:00 2001 From: Richard Darst Date: Fri, 31 Jul 2009 18:10:24 +0000 Subject: Allow bool variables to be set via supybot registry. - Now, all str and bool variables can be set via supybot. darcs-hash:20090731181024-82ea9-afba08351c4d40af5612551a4945db351d809239.gz --- diff --git a/supybotconfig.py b/supybotconfig.py index bdbb68f..f846b4d 100644 --- a/supybotconfig.py +++ b/supybotconfig.py @@ -127,14 +127,17 @@ def setup_config(OriginalConfig): continue attr = getattr(OriginalConfig, attrname) # Don't configure attributes that aren't strings. - if not isinstance(attr, (str, unicode)): - continue - attr = attr.replace('\n', '\\n') - # For a global value: conf.registerGlobalValue and remove the - # channel= option from registryValue call above. - conf.registerChannelValue(MeetBotConfigGroup, attrname, - registry.String(attr,"")) - settable_attributes.append(attrname) + if isinstance(attr, (str, unicode)): + attr = attr.replace('\n', '\\n') + # For a global value: conf.registerGlobalValue and remove the + # channel= option from registryValue call above. + conf.registerChannelValue(MeetBotConfigGroup, attrname, + registry.String(attr,"")) + settable_attributes.append(attrname) + if isinstance(attr, bool): + conf.registerChannelValue(MeetBotConfigGroup, attrname, + registry.Boolean(attr,"")) + settable_attributes.append(attrname) # writer_map # (doing the commented out commands below will erase the previously -- cgit v0.9.1