Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/supybotconfig.py
diff options
context:
space:
mode:
authorRichard Darst <rkd@zgib.net>2009-07-31 18:10:24 (GMT)
committer Richard Darst <rkd@zgib.net>2009-07-31 18:10:24 (GMT)
commitd71f46398059cb408869a59dfb22e6e48965856d (patch)
treeda745c4cdcd8173a05593a65b4f4e1c018ebc889 /supybotconfig.py
parenta232afc9558bf84502f3c5bfdd067bd301c5644e (diff)
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
Diffstat (limited to 'supybotconfig.py')
-rw-r--r--supybotconfig.py19
1 files changed, 11 insertions, 8 deletions
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