From 8a919ac86688ae972911670077f83391904c6d6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20K=C3=BCchel?= Date: Tue, 26 Nov 2019 07:25:24 +0100 Subject: [PATCH] on pull() return a boolean, if something was changed on disk or not --- webdav3/client.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webdav3/client.py b/webdav3/client.py index 3d29207..65a6b1b 100644 --- a/webdav3/client.py +++ b/webdav3/client.py @@ -689,6 +689,8 @@ class Client(object): def prune(src, exp): return [sub(exp, "", item) for item in src] + updated=False + urn = Urn(remote_directory, directory=True) ## here we check for the current directory @@ -717,6 +719,7 @@ class Client(object): ## no need to check it here if remote_urn.path().endswith("/"): if not os.path.exists(local_path): + updated=True os.mkdir(local_path) ## nevertheless, since we pull the directory, it will be checked up there self.pull(remote_directory=remote_path, local_directory=local_path) @@ -724,6 +727,8 @@ class Client(object): if remote_resource_name in local_resource_names: continue self.download_file(remote_path=remote_path, local_path=local_path) + updated=True + return updated def sync(self, remote_directory, local_directory):