mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-04 17:09:24 +01:00
Added a setValue option to setUserValue.
This commit is contained in:
parent
ae542511be
commit
6e6d619f48
@ -823,15 +823,25 @@ class Privmsg(irclib.IrcCallback):
|
|||||||
group = group.get(name)
|
group = group.get(name)
|
||||||
return group.get(id)()
|
return group.get(id)()
|
||||||
|
|
||||||
def setUserValue(self, prefixOrName, name, value):
|
def setUserValue(self, prefixOrName, name, value,
|
||||||
id = str(ircdb.users.getUserId(prefixOrName))
|
ignoreNoUser=False, setValue=False):
|
||||||
|
try:
|
||||||
|
id = str(ircdb.users.getUserId(prefixOrName))
|
||||||
|
except KeyError:
|
||||||
|
if ignoreNoUser:
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
raise
|
||||||
plugin = self.name()
|
plugin = self.name()
|
||||||
group = conf.users.plugins.get(plugin)
|
group = conf.users.plugins.get(plugin)
|
||||||
names = name.split('.')
|
names = name.split('.')
|
||||||
for name in names:
|
for name in names:
|
||||||
group = group.get(name)
|
group = group.get(name)
|
||||||
group = group.get(id)
|
group = group.get(id)
|
||||||
group.set(value)
|
if setValue:
|
||||||
|
group.setValue(value)
|
||||||
|
else:
|
||||||
|
group.set(value)
|
||||||
|
|
||||||
|
|
||||||
class IrcObjectProxyRegexp(RichReplyMethods):
|
class IrcObjectProxyRegexp(RichReplyMethods):
|
||||||
|
Loading…
Reference in New Issue
Block a user