mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-10 15:28:34 +01:00
cloud: use paths relative to cache_dir in progress bar
Fixes #508 Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
+3
-3
@@ -36,7 +36,7 @@ def percent_cb(name, part_complete, part_total, offset=0, multipart_total=None):
|
||||
Logger.debug('{}: {} transferred out of {}'.format(name,
|
||||
sizeof_fmt(complete),
|
||||
sizeof_fmt(total)))
|
||||
progress.update_target(os.path.basename(name), complete, total)
|
||||
progress.update_target(name, complete, total)
|
||||
|
||||
|
||||
def create_cb(name, offset=0, multipart_total=None):
|
||||
@@ -137,7 +137,7 @@ class DataCloudAWS(DataCloudBase):
|
||||
self._makedirs(fname)
|
||||
|
||||
tmp_file = self.tmp_file(fname)
|
||||
name = os.path.basename(fname)
|
||||
name = os.path.relpath(fname, self._cloud_settings.cache.cache_dir)
|
||||
|
||||
if self._cmp_checksum(key, fname):
|
||||
Logger.debug('File "{}" matches with "{}".'.format(fname, key.name))
|
||||
@@ -281,6 +281,6 @@ class DataCloudAWS(DataCloudBase):
|
||||
Logger.error('Failed to upload "{}": {}'.format(path, exc))
|
||||
return None
|
||||
|
||||
progress.finish_target(os.path.basename(path))
|
||||
progress.finish_target(os.path.relpath(path, self._cloud_settings.cache.cache_dir))
|
||||
|
||||
return path
|
||||
|
||||
+2
-2
@@ -48,7 +48,7 @@ class DataCloudGCP(DataCloudBase):
|
||||
def _pull_key(self, key, path):
|
||||
self._makedirs(path)
|
||||
|
||||
name = os.path.basename(path)
|
||||
name = os.path.relpath(path, self._cloud_settings.cache.cache_dir)
|
||||
tmp_file = self.tmp_file(path)
|
||||
|
||||
if self._cmp_checksum(key, path):
|
||||
@@ -85,7 +85,7 @@ class DataCloudGCP(DataCloudBase):
|
||||
|
||||
def _push_key(self, key, path):
|
||||
""" push, gcp version """
|
||||
name = os.path.basename(path)
|
||||
name = os.path.relpath(path, self._cloud_settings.cache.cache_dir)
|
||||
|
||||
progress.update_target(name, 0, None)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user