Added registry.split.

This commit is contained in:
Jeremy Fincher 2004-07-25 11:06:00 +00:00
parent d868a17bf9
commit 282846fd59

View File

@ -820,7 +820,7 @@ class Privmsg(irclib.IrcCallback):
def registryValue(self, name, channel=None):
plugin = self.name()
group = conf.supybot.plugins.get(plugin)
names = name.split('.')
names = registry.split(name)
for name in names:
group = group.get(name)
if channel is None:
@ -828,6 +828,17 @@ class Privmsg(irclib.IrcCallback):
else:
return group.get(channel)()
def setRegistryValue(self, name, value, channel=None):
plugin = self.name()
group = conf.supybot.plugins.get(plugin)
names = registry.split(name)
for name in names:
group = group.get(name)
if channel is None:
group.setValue(value)
else:
group.get(channel).setValue(value)
def userValue(self, name, prefixOrName, default=None):
try:
id = str(ircdb.users.getUserId(prefixOrName))
@ -835,7 +846,7 @@ class Privmsg(irclib.IrcCallback):
return None
plugin = self.name()
group = conf.users.plugins.get(plugin)
names = name.split('.')
names = registry.split(name)
for name in names:
group = group.get(name)
return group.get(id)()
@ -851,7 +862,7 @@ class Privmsg(irclib.IrcCallback):
raise
plugin = self.name()
group = conf.users.plugins.get(plugin)
names = name.split('.')
names = registry.split(name)
for name in names:
group = group.get(name)
group = group.get(id)