mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-05 23:09:32 +01:00
feat: [WIP] remote dir download
This commit is contained in:
+12
-2
@@ -547,11 +547,20 @@ class RemoteBASE(object):
|
||||
if to_info.scheme != "local":
|
||||
raise NotImplementedError
|
||||
|
||||
logger.debug("Downloading '{}' to '{}'".format(from_info, to_info))
|
||||
makedirs(to_info.parent, exist_ok=True, mode=dir_mode)
|
||||
|
||||
if self.isdir(from_info):
|
||||
# need to create dir here
|
||||
# also pass the individual file name (file and to)
|
||||
for file_info in self.walk_files(from_info):
|
||||
self.single_file_download(file_info, to_info, name, no_progress_bar, file_mode)
|
||||
else:
|
||||
self.single_file_download(from_info, to_info, name, no_progress_bar, file_mode)
|
||||
|
||||
def single_file_download(self, from_info, to_info, name, no_progress_bar, file_mode):
|
||||
logger.debug("Downloading '{}' to '{}'".format(from_info, to_info))
|
||||
name = name or to_info.name
|
||||
|
||||
makedirs(to_info.parent, exist_ok=True, mode=dir_mode)
|
||||
tmp_file = tmp_fname(to_info)
|
||||
|
||||
try:
|
||||
@@ -567,6 +576,7 @@ class RemoteBASE(object):
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
def open(self, path_info, mode="r", encoding=None):
|
||||
if hasattr(self, "_generate_download_url"):
|
||||
get_url = partial(self._generate_download_url, path_info)
|
||||
|
||||
Reference in New Issue
Block a user