mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
Added registry.split.
This commit is contained in:
parent
d868a17bf9
commit
282846fd59
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user