From 47b0869d3731ae5159b1242c978eca11d94dc656 Mon Sep 17 00:00:00 2001 From: hermitdemschoenenleben Date: Sun, 13 Oct 2019 16:52:08 +0800 Subject: [PATCH 1/2] seafile compatibility (getlastmodified not included for folders) --- davsync | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/davsync b/davsync index 86975dd..3662f18 100755 --- a/davsync +++ b/davsync @@ -223,7 +223,11 @@ class WebDAVFileSystem (FileSystem) : name = urllib2.unquote(child.find('D:href', self.xmlns).text) fullPath = os.path.normpath('./' + os.path.join(path, name)) - mtime = datetime.strptime(child.find('.//D:getlastmodified', self.xmlns).text, RFC_1123_FORMAT) + last_modified = child.find('.//D:getlastmodified', self.xmlns) + if last_modified is not None: + mtime = mtime = datetime.strptime(last_modified.text, RFC_1123_FORMAT) + else: + mtime = None if self.isNodeCollection(child) : d = Directory(fullPath, mtime) From 501938e78c60b3ab6da58f5a4de06accbb963410 Mon Sep 17 00:00:00 2001 From: hermitdemschoenenleben Date: Sun, 13 Oct 2019 16:54:18 +0800 Subject: [PATCH 2/2] tiny fix --- davsync | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/davsync b/davsync index 3662f18..310b2af 100755 --- a/davsync +++ b/davsync @@ -225,7 +225,7 @@ class WebDAVFileSystem (FileSystem) : fullPath = os.path.normpath('./' + os.path.join(path, name)) last_modified = child.find('.//D:getlastmodified', self.xmlns) if last_modified is not None: - mtime = mtime = datetime.strptime(last_modified.text, RFC_1123_FORMAT) + mtime = datetime.strptime(last_modified.text, RFC_1123_FORMAT) else: mtime = None