mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-10 15:28:34 +01:00
dvc: use __str__ method for deps/outs
Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
@@ -20,7 +20,7 @@ class CmdPipelineShow(CmdBase):
|
||||
self.project.logger.info(stages[n].cmd)
|
||||
elif outs:
|
||||
for out in stages[n].outs:
|
||||
self.project.logger.info(out.rel_path)
|
||||
self.project.logger.info(str(out))
|
||||
else:
|
||||
self.project.logger.info(n)
|
||||
|
||||
@@ -52,10 +52,10 @@ class CmdPipelineShow(CmdBase):
|
||||
elif outs:
|
||||
for from_out in from_stage.outs:
|
||||
for to_out in to_stage.outs:
|
||||
nodes.add(from_out.rel_path)
|
||||
nodes.add(to_out.rel_path)
|
||||
edges.append((from_out.rel_path,
|
||||
to_out.rel_path))
|
||||
nodes.add(str(from_out))
|
||||
nodes.add(str(to_out))
|
||||
edges.append((str(from_out),
|
||||
str(to_out)))
|
||||
else:
|
||||
nodes.add(from_stage.relpath)
|
||||
nodes.add(to_stage.relpath)
|
||||
|
||||
@@ -31,6 +31,9 @@ class DependencyBase(object):
|
||||
self.project = stage.project
|
||||
self.path = path
|
||||
|
||||
def __str__(self):
|
||||
return self.path
|
||||
|
||||
@classmethod
|
||||
def match(cls, url):
|
||||
return re.match(cls.REGEX, url)
|
||||
|
||||
@@ -38,6 +38,9 @@ class DependencyLOCAL(DependencyBase):
|
||||
self.path_info = {'scheme': 'local',
|
||||
'path': self.path}
|
||||
|
||||
def __str__(self):
|
||||
return self.rel_path
|
||||
|
||||
@property
|
||||
def sep(self):
|
||||
return os.sep
|
||||
|
||||
Reference in New Issue
Block a user