mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +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):
|
def registryValue(self, name, channel=None):
|
||||||
plugin = self.name()
|
plugin = self.name()
|
||||||
group = conf.supybot.plugins.get(plugin)
|
group = conf.supybot.plugins.get(plugin)
|
||||||
names = name.split('.')
|
names = registry.split(name)
|
||||||
for name in names:
|
for name in names:
|
||||||
group = group.get(name)
|
group = group.get(name)
|
||||||
if channel is None:
|
if channel is None:
|
||||||
@ -828,6 +828,17 @@ class Privmsg(irclib.IrcCallback):
|
|||||||
else:
|
else:
|
||||||
return group.get(channel)()
|
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):
|
def userValue(self, name, prefixOrName, default=None):
|
||||||
try:
|
try:
|
||||||
id = str(ircdb.users.getUserId(prefixOrName))
|
id = str(ircdb.users.getUserId(prefixOrName))
|
||||||
@ -835,7 +846,7 @@ class Privmsg(irclib.IrcCallback):
|
|||||||
return None
|
return None
|
||||||
plugin = self.name()
|
plugin = self.name()
|
||||||
group = conf.users.plugins.get(plugin)
|
group = conf.users.plugins.get(plugin)
|
||||||
names = name.split('.')
|
names = registry.split(name)
|
||||||
for name in names:
|
for name in names:
|
||||||
group = group.get(name)
|
group = group.get(name)
|
||||||
return group.get(id)()
|
return group.get(id)()
|
||||||
@ -851,7 +862,7 @@ class Privmsg(irclib.IrcCallback):
|
|||||||
raise
|
raise
|
||||||
plugin = self.name()
|
plugin = self.name()
|
||||||
group = conf.users.plugins.get(plugin)
|
group = conf.users.plugins.get(plugin)
|
||||||
names = name.split('.')
|
names = registry.split(name)
|
||||||
for name in names:
|
for name in names:
|
||||||
group = group.get(name)
|
group = group.get(name)
|
||||||
group = group.get(id)
|
group = group.get(id)
|
||||||
|
Loading…
Reference in New Issue
Block a user