mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-30 06:49:24 +01:00
Added a value option to registryValue to allow not getting the value (and just returning the group).
This commit is contained in:
parent
b26ef394ab
commit
b252ae87c9
@ -821,16 +821,18 @@ class Privmsg(irclib.IrcCallback):
|
|||||||
elapsed = time.time() - start
|
elapsed = time.time() - start
|
||||||
self.log.debug('%s took %s seconds', name, elapsed)
|
self.log.debug('%s took %s seconds', name, elapsed)
|
||||||
|
|
||||||
def registryValue(self, name, channel=None):
|
def registryValue(self, name, channel=None, value=True):
|
||||||
plugin = self.name()
|
plugin = self.name()
|
||||||
group = conf.supybot.plugins.get(plugin)
|
group = conf.supybot.plugins.get(plugin)
|
||||||
names = registry.split(name)
|
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 not None:
|
||||||
|
group = group.get(channel)
|
||||||
|
if value:
|
||||||
return group()
|
return group()
|
||||||
else:
|
else:
|
||||||
return group.get(channel)()
|
return group
|
||||||
|
|
||||||
def setRegistryValue(self, name, value, channel=None):
|
def setRegistryValue(self, name, value, channel=None):
|
||||||
plugin = self.name()
|
plugin = self.name()
|
||||||
|
Loading…
Reference in New Issue
Block a user