[Calypso] [PATCH] Don't remove existing entries

Guido Günther agx at sigxcpu.org
Fri Oct 21 07:16:01 PDT 2016


Commit e7d713be18f20ef53a6271306baddb88cd68c2e0 switched from glob to
listdir but listdir returns relative paths while glob uses absolute
ones. The comparison always failed removing still wanted files.
---
 calypso/webdav.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/calypso/webdav.py b/calypso/webdav.py
index 0267825..107791a 100644
--- a/calypso/webdav.py
+++ b/calypso/webdav.py
@@ -344,8 +344,8 @@ class Collection(object):
                 else:
                     self.insert_directory("/".join([self.urlpath, filename]))
         for file in self.files:
-            if not file.path in filenames:
-                self.log.debug("Removed %s", file.path)
+            if os.path.basename(file.path) not in filenames:
+                self.log.debug("Removed %s %s", file.path)
                 self.remove_file(file.path)
         h = hashlib.sha1()
         for item in self.my_items:
-- 
2.9.3


More information about the Calypso mailing list