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
This commit is contained in:
Richard Darst 2009-07-31 11:10:24 -07:00
parent 79e0bef1ba
commit 572cd73cc0
1 changed files with 11 additions and 8 deletions

View File

@ -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