mirror of
https://github.com/Kozea/Radicale.git
synced 2025-06-26 16:45:52 +00:00
Atomic MOVE in multifilesystem
This commit is contained in:
parent
23582c8208
commit
5f66d009d6
1 changed files with 9 additions and 0 deletions
|
@ -534,6 +534,15 @@ class Collection(BaseCollection):
|
|||
|
||||
return cls(sane_path, principal=principal)
|
||||
|
||||
@classmethod
|
||||
def move(cls, item, to_collection, to_href):
|
||||
os.rename(
|
||||
path_to_filesystem(item.collection._filesystem_path, item.href),
|
||||
path_to_filesystem(to_collection._filesystem_path, to_href))
|
||||
sync_directory(to_collection._filesystem_path)
|
||||
if item.collection._filesystem_path != to_collection._filesystem_path:
|
||||
sync_directory(item.collection._filesystem_path)
|
||||
|
||||
def list(self):
|
||||
try:
|
||||
hrefs = os.listdir(self._filesystem_path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue