mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
outs/deps: remove loadd
Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
@@ -28,7 +28,7 @@ def loadd_from(stage, d_list):
|
||||
ret = []
|
||||
for d in d_list:
|
||||
p = d[DependencyBase.PARAM_PATH]
|
||||
ret.append(_get(p).loadd(stage, d))
|
||||
ret.append(_get(p)(stage, **d))
|
||||
return ret
|
||||
|
||||
|
||||
|
||||
@@ -56,8 +56,3 @@ class DependencyBase(object):
|
||||
|
||||
def dumpd(self):
|
||||
return {self.PARAM_PATH: self.path}
|
||||
|
||||
@classmethod
|
||||
def loadd(cls, stage, d):
|
||||
path = d[cls.PARAM_PATH]
|
||||
return cls(stage, path)
|
||||
|
||||
+4
-11
@@ -22,7 +22,10 @@ class DependencyLOCAL(DependencyBase):
|
||||
def __init__(self, stage, path, md5=None):
|
||||
self.stage = stage
|
||||
self.project = stage.project
|
||||
self.path = os.path.abspath(os.path.normpath(path))
|
||||
if not os.path.isabs(path):
|
||||
path = self.unixpath(path)
|
||||
path = os.path.join(stage.cwd, path)
|
||||
self.path = os.path.normpath(path)
|
||||
self.md5 = md5
|
||||
|
||||
@property
|
||||
@@ -76,13 +79,3 @@ class DependencyLOCAL(DependencyBase):
|
||||
|
||||
return {self.PARAM_PATH: path,
|
||||
self.PARAM_MD5:self.md5}
|
||||
|
||||
@classmethod
|
||||
def loadd(cls, stage, d):
|
||||
path = d[cls.PARAM_PATH]
|
||||
if not os.path.isabs(path):
|
||||
path = cls.unixpath(path)
|
||||
path = os.path.join(stage.cwd, path)
|
||||
path = os.path.normpath(path)
|
||||
md5 = d.get(cls.PARAM_MD5, None)
|
||||
return cls(stage, path, md5=md5)
|
||||
|
||||
@@ -48,9 +48,3 @@ class DependencyS3(DependencyBase):
|
||||
def dumpd(self):
|
||||
return {self.PARAM_PATH: self.path,
|
||||
self.PARAM_ETAG: self.etag}
|
||||
|
||||
@classmethod
|
||||
def loadd(cls, stage, d):
|
||||
path = d[cls.PARAM_PATH]
|
||||
etag = d.get(cls.PARAM_ETAG, None)
|
||||
return cls(stage, path, etag=etag)
|
||||
|
||||
@@ -26,12 +26,12 @@ def loadd_from(stage, d_list):
|
||||
ret = []
|
||||
for d in d_list:
|
||||
p = d[DependencyBase.PARAM_PATH]
|
||||
ret.append(_get(p).loadd(stage, d))
|
||||
ret.append(_get(p)(stage, **d))
|
||||
return ret
|
||||
|
||||
|
||||
def loads_from(stage, s_list, use_cache=False):
|
||||
ret = []
|
||||
for s in s_list:
|
||||
ret.append(_get(s)(stage, s, use_cache=use_cache))
|
||||
ret.append(_get(s)(stage, s, cache=use_cache))
|
||||
return ret
|
||||
|
||||
+2
-8
@@ -4,9 +4,9 @@ from dvc.dependency.gs import DependencyGS
|
||||
class OutputGS(DependencyGS):
|
||||
PARAM_CACHE = 'cache'
|
||||
|
||||
def __init__(self, stage, path, etag=None, use_cache=True):
|
||||
def __init__(self, stage, path, etag=None, cache=True):
|
||||
super(OutputGS, self).__init__(stage, path, etag=etag)
|
||||
self.use_cache = use_cache
|
||||
self.use_cache = cache
|
||||
|
||||
@property
|
||||
def cache(self):
|
||||
@@ -22,12 +22,6 @@ class OutputGS(DependencyGS):
|
||||
ret[self.PARAM_CACHE] = self.use_cache
|
||||
return ret
|
||||
|
||||
@classmethod
|
||||
def loadd(cls, stage, d):
|
||||
ret = super(OutputGS, cls).loadd(stage, d)
|
||||
ret.use_cache = d.get(cls.PARAM_CACHE, True)
|
||||
return ret
|
||||
|
||||
def changed(self):
|
||||
if super(OutputGS, self).changed():
|
||||
return True
|
||||
|
||||
+2
-8
@@ -16,9 +16,9 @@ class OutputLOCAL(DependencyLOCAL):
|
||||
DoesNotExistError = OutputDoesNotExistError
|
||||
IsNotFileOrDirError = OutputIsNotFileOrDirError
|
||||
|
||||
def __init__(self, stage, path, md5=None, use_cache=True):
|
||||
def __init__(self, stage, path, md5=None, cache=True):
|
||||
super(OutputLOCAL, self).__init__(stage, path, md5=md5)
|
||||
self.use_cache = use_cache
|
||||
self.use_cache = cache
|
||||
|
||||
@property
|
||||
def cache(self):
|
||||
@@ -32,12 +32,6 @@ class OutputLOCAL(DependencyLOCAL):
|
||||
ret[self.PARAM_CACHE] = self.use_cache
|
||||
return ret
|
||||
|
||||
@classmethod
|
||||
def loadd(cls, stage, d):
|
||||
ret = super(OutputLOCAL, cls).loadd(stage, d)
|
||||
ret.use_cache = d.get(cls.PARAM_CACHE, True)
|
||||
return ret
|
||||
|
||||
def changed(self):
|
||||
if super(OutputLOCAL, self).changed():
|
||||
return True
|
||||
|
||||
+2
-8
@@ -4,9 +4,9 @@ from dvc.dependency.s3 import DependencyS3
|
||||
class OutputS3(DependencyS3):
|
||||
PARAM_CACHE = 'cache'
|
||||
|
||||
def __init__(self, stage, path, etag=None, use_cache=True):
|
||||
def __init__(self, stage, path, etag=None, cache=True):
|
||||
super(OutputS3, self).__init__(stage, path, etag=etag)
|
||||
self.use_cache = use_cache
|
||||
self.use_cache = cache
|
||||
|
||||
@property
|
||||
def cache(self):
|
||||
@@ -22,12 +22,6 @@ class OutputS3(DependencyS3):
|
||||
ret[self.PARAM_CACHE] = self.use_cache
|
||||
return ret
|
||||
|
||||
@classmethod
|
||||
def loadd(cls, stage, d):
|
||||
ret = super(OutputS3, cls).loadd(stage, d)
|
||||
ret.use_cache = d.get(cls.PARAM_CACHE, True)
|
||||
return ret
|
||||
|
||||
def changed(self):
|
||||
if super(OutputS3, self).changed():
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user