From 3f63917dc274ad91235d8e11464a8363d40d45bc Mon Sep 17 00:00:00 2001 From: James Vega Date: Thu, 24 Jun 2010 00:37:40 -0400 Subject: [PATCH] Use conf.registerGlobalValue to ensure generated values are properly setup. Signed-off-by: James Vega (cherry picked from commit 0c6220480941a199334828d79189429afe1a0452) --- plugins/Alias/plugin.py | 12 ++++++------ plugins/RSS/plugin.py | 4 ++-- plugins/Services/config.py | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/plugins/Alias/plugin.py b/plugins/Alias/plugin.py index 9021b6809..af22ab55f 100644 --- a/plugins/Alias/plugin.py +++ b/plugins/Alias/plugin.py @@ -1,6 +1,6 @@ ### # Copyright (c) 2002-2004, Jeremiah Fincher -# Copyright (c) 2009, James Vega +# Copyright (c) 2009-2010, James Vega # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -260,13 +260,13 @@ class Alias(callbacks.Plugin): f = new.instancemethod(f, self, Alias) except RecursiveAlias: raise AliasError, 'You can\'t define a recursive alias.' + aliasGroup = self.registryValue('aliases', value=False) if name in self.aliases: # We gotta remove it so its value gets updated. - conf.supybot.plugins.Alias.aliases.unregister(name) - conf.supybot.plugins.Alias.aliases.register(name, - registry.String(alias, '')) - conf.supybot.plugins.Alias.aliases.get(name).register('locked', - registry.Boolean(lock, '')) + aliasGroup.unregister(name) + conf.registerGlobalValue(aliasGroup, name, registry.String(alias, '')) + conf.registerGlobalValue(aliasGroup.get(name), 'locked', + registry.Boolean(lock, '')) self.aliases[name] = [alias, lock, f] def removeAlias(self, name, evenIfLocked=False): diff --git a/plugins/RSS/plugin.py b/plugins/RSS/plugin.py index 6163965fb..b2fb31b7b 100644 --- a/plugins/RSS/plugin.py +++ b/plugins/RSS/plugin.py @@ -1,6 +1,6 @@ ### # Copyright (c) 2002-2004, Jeremiah Fincher -# Copyright (c) 2008-2009, James Vega +# Copyright (c) 2008-2010, James Vega # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -102,7 +102,7 @@ class RSS(callbacks.Plugin): def _registerFeed(self, name, url=''): self.registryValue('feeds').add(name) group = self.registryValue('feeds', value=False) - group.register(name, registry.String(url, '')) + conf.registerGlobalValue(group, name, registry.String(url, '')) def __call__(self, irc, msg): self.__parent.__call__(irc, msg) diff --git a/plugins/Services/config.py b/plugins/Services/config.py index cfa8081fa..aa09131ea 100644 --- a/plugins/Services/config.py +++ b/plugins/Services/config.py @@ -36,8 +36,8 @@ def registerNick(nick, password=''): p = conf.supybot.plugins.Services.Nickserv.get('password') h = 'Determines what password the bot will use with NickServ when ' \ 'identifying as %s.' % nick - v = p.register(nick, registry.String(password, h, private=True)) - v.channelValue = False + v = conf.registerGlobalValue(p, nick, + registry.String(password, h, private=True)) if password: v.setValue(password)