mirror of
https://github.com/Kozea/Radicale.git
synced 2025-08-13 18:50:53 +00:00
add support for placeholders 'request' and 'to_path'
This commit is contained in:
parent
cdfee329db
commit
eec7d5bbbf
1 changed files with 6 additions and 0 deletions
|
@ -78,10 +78,16 @@ class StoragePartLock(StorageBase):
|
|||
preexec_fn = os.setpgrp
|
||||
# optional argument
|
||||
path = kwargs.get('path', "")
|
||||
request = kwargs.get('request', "NONE")
|
||||
to_path = kwargs.get('to_path', "")
|
||||
if to_path != "":
|
||||
to_path = shlex.quote(self._get_collection_root_folder() + to_path)
|
||||
try:
|
||||
command = self._hook % {
|
||||
"path": shlex.quote(self._get_collection_root_folder() + path),
|
||||
"to_path": to_path,
|
||||
"cwd": shlex.quote(self._filesystem_folder),
|
||||
"request": shlex.quote(request),
|
||||
"user": shlex.quote(user or "Anonymous")}
|
||||
except KeyError as e:
|
||||
logger.error("Storage hook contains not supported placeholder %s (skip execution of: %r)" % (e, self._hook))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue