mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-20 01:19:26 +01:00
Use conf.registerGlobalValue to ensure generated values are properly setup.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit 0c62204809
)
Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
This commit is contained in:
parent
dbde5fc250
commit
23cca935cb
@ -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,13 +263,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):
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user