mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-03 16:39:25 +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)
|
||||
return group.get(id)()
|
||||
|
||||
def setUserValue(self, prefixOrName, name, value):
|
||||
id = str(ircdb.users.getUserId(prefixOrName))
|
||||
def setUserValue(self, prefixOrName, name, value,
|
||||
ignoreNoUser=False, setValue=False):
|
||||
try:
|
||||
id = str(ircdb.users.getUserId(prefixOrName))
|
||||
except KeyError:
|
||||
if ignoreNoUser:
|
||||
return
|
||||
else:
|
||||
raise
|
||||
plugin = self.name()
|
||||
group = conf.users.plugins.get(plugin)
|
||||
names = name.split('.')
|
||||
for name in names:
|
||||
group = group.get(name)
|
||||
group = group.get(id)
|
||||
group.set(value)
|
||||
if setValue:
|
||||
group.setValue(value)
|
||||
else:
|
||||
group.set(value)
|
||||
|
||||
|
||||
class IrcObjectProxyRegexp(RichReplyMethods):
|
||||
|
Loading…
Reference in New Issue
Block a user