on pull() return a boolean, if something was changed on disk or not
This commit is contained in:
parent
6b90e1d16c
commit
8a919ac866
1 changed files with 5 additions and 0 deletions
|
@ -689,6 +689,8 @@ class Client(object):
|
||||||
def prune(src, exp):
|
def prune(src, exp):
|
||||||
return [sub(exp, "", item) for item in src]
|
return [sub(exp, "", item) for item in src]
|
||||||
|
|
||||||
|
updated=False
|
||||||
|
|
||||||
urn = Urn(remote_directory, directory=True)
|
urn = Urn(remote_directory, directory=True)
|
||||||
|
|
||||||
## here we check for the current directory
|
## here we check for the current directory
|
||||||
|
@ -717,6 +719,7 @@ class Client(object):
|
||||||
## no need to check it here
|
## no need to check it here
|
||||||
if remote_urn.path().endswith("/"):
|
if remote_urn.path().endswith("/"):
|
||||||
if not os.path.exists(local_path):
|
if not os.path.exists(local_path):
|
||||||
|
updated=True
|
||||||
os.mkdir(local_path)
|
os.mkdir(local_path)
|
||||||
## nevertheless, since we pull the directory, it will be checked up there
|
## nevertheless, since we pull the directory, it will be checked up there
|
||||||
self.pull(remote_directory=remote_path, local_directory=local_path)
|
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:
|
if remote_resource_name in local_resource_names:
|
||||||
continue
|
continue
|
||||||
self.download_file(remote_path=remote_path, local_path=local_path)
|
self.download_file(remote_path=remote_path, local_path=local_path)
|
||||||
|
updated=True
|
||||||
|
return updated
|
||||||
|
|
||||||
def sync(self, remote_directory, local_directory):
|
def sync(self, remote_directory, local_directory):
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue