Merge changes from master

This commit is contained in:
Griatch 2020-07-15 18:07:45 +02:00
commit 94cf728081
24 changed files with 324 additions and 244 deletions

View file

@ -539,7 +539,9 @@ def objtag(accessing_obj, accessed_obj, *args, **kwargs):
Only true if accessed_obj has the specified tag and optional
category.
"""
return bool(accessed_obj.tags.get(*args))
tagkey = args[0] if args else None
category = args[1] if len(args) > 1 else None
return bool(accessed_obj.tags.get(tagkey, category=category))
def inside(accessing_obj, accessed_obj, *args, **kwargs):

View file

@ -236,7 +236,7 @@ class LockHandler(object):
elist.append(_("Lock: lock-function '%s' is not available.") % funcstring)
continue
args = list(arg.strip() for arg in rest.split(",") if arg and "=" not in arg)
kwargs = dict([arg.split("=", 1) for arg in rest.split(",") if arg and "=" in arg])
kwargs = dict([(part.strip() for part in arg.split("=", 1)) for arg in rest.split(",") if arg and "=" in arg])
lock_funcs.append((func, args, kwargs))
evalstring = evalstring.replace(funcstring, "%s")
if len(lock_funcs) < nfuncs: