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

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

View File

@ -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
@ -263,12 +263,12 @@ 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',
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]

View File

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

View File

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