Added a setValue option to setUserValue.

This commit is contained in:
Jeremy Fincher 2004-04-30 19:19:46 +00:00
parent ae542511be
commit 6e6d619f48

View File

@ -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):