Use conf.registerGlobalValue to ensure generated values are properly setup.

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit 0c62204809)
This commit is contained in:
James Vega 2010-06-24 00:37:40 -04:00
parent 8c280369a6
commit 3f63917dc2
3 changed files with 10 additions and 10 deletions

View File

@ -1,6 +1,6 @@
### ###
# Copyright (c) 2002-2004, Jeremiah Fincher # Copyright (c) 2002-2004, Jeremiah Fincher
# Copyright (c) 2009, James Vega # Copyright (c) 2009-2010, James Vega
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # 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) f = new.instancemethod(f, self, Alias)
except RecursiveAlias: except RecursiveAlias:
raise AliasError, 'You can\'t define a recursive alias.' raise AliasError, 'You can\'t define a recursive alias.'
aliasGroup = self.registryValue('aliases', value=False)
if name in self.aliases: if name in self.aliases:
# We gotta remove it so its value gets updated. # We gotta remove it so its value gets updated.
conf.supybot.plugins.Alias.aliases.unregister(name) aliasGroup.unregister(name)
conf.supybot.plugins.Alias.aliases.register(name, conf.registerGlobalValue(aliasGroup, name, registry.String(alias, ''))
registry.String(alias, '')) conf.registerGlobalValue(aliasGroup.get(name), 'locked',
conf.supybot.plugins.Alias.aliases.get(name).register('locked', registry.Boolean(lock, ''))
registry.Boolean(lock, ''))
self.aliases[name] = [alias, lock, f] self.aliases[name] = [alias, lock, f]
def removeAlias(self, name, evenIfLocked=False): def removeAlias(self, name, evenIfLocked=False):

View File

@ -1,6 +1,6 @@
### ###
# Copyright (c) 2002-2004, Jeremiah Fincher # Copyright (c) 2002-2004, Jeremiah Fincher
# Copyright (c) 2008-2009, James Vega # Copyright (c) 2008-2010, James Vega
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -102,7 +102,7 @@ class RSS(callbacks.Plugin):
def _registerFeed(self, name, url=''): def _registerFeed(self, name, url=''):
self.registryValue('feeds').add(name) self.registryValue('feeds').add(name)
group = self.registryValue('feeds', value=False) group = self.registryValue('feeds', value=False)
group.register(name, registry.String(url, '')) conf.registerGlobalValue(group, name, registry.String(url, ''))
def __call__(self, irc, msg): def __call__(self, irc, msg):
self.__parent.__call__(irc, msg) self.__parent.__call__(irc, msg)

View File

@ -36,8 +36,8 @@ def registerNick(nick, password=''):
p = conf.supybot.plugins.Services.Nickserv.get('password') p = conf.supybot.plugins.Services.Nickserv.get('password')
h = 'Determines what password the bot will use with NickServ when ' \ h = 'Determines what password the bot will use with NickServ when ' \
'identifying as %s.' % nick 'identifying as %s.' % nick
v = p.register(nick, registry.String(password, h, private=True)) v = conf.registerGlobalValue(p, nick,
v.channelValue = False registry.String(password, h, private=True))
if password: if password:
v.setValue(password) v.setValue(password)