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:
parent
79e0bef1ba
commit
572cd73cc0
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue