Improved lock-setting logic to handle empty locks, and allow customizing locks via .create()'s new generate_default_locks
This commit is contained in:
parent
e2a7c54e24
commit
a0907ec94d
3 changed files with 118 additions and 30 deletions
|
|
@ -338,9 +338,16 @@ class LockHandler:
|
|||
|
||||
"""
|
||||
if isinstance(lockstring, str):
|
||||
lockdefs = lockstring.split(";")
|
||||
lockdefs = [
|
||||
stripped for lockdef in lockstring.split(";") if (stripped := lockdef.strip())
|
||||
]
|
||||
else:
|
||||
lockdefs = [lockdef for locks in lockstring for lockdef in locks.split(";")]
|
||||
lockdefs = [
|
||||
stripped
|
||||
for locks in lockstring
|
||||
for lockdef in locks.split(";")
|
||||
if (stripped := lockdef.strip())
|
||||
]
|
||||
lockstring = ";".join(lockdefs)
|
||||
|
||||
err = ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue