mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-09 23:10:24 +01:00
Generalize CmdDataBase class
This commit is contained in:
@@ -4,20 +4,23 @@ from dvc.logger import Logger
|
||||
import dvc.data_cloud as cloud
|
||||
|
||||
|
||||
class CmdDataPull(CmdBase):
|
||||
def __init__(self, settings):
|
||||
super(CmdDataPull, self).__init__(settings)
|
||||
class CmdDataBase(CmdBase):
|
||||
def __init__(self, settings, cmd):
|
||||
super(CmdDataBase, self).__init__(settings)
|
||||
self.cmd = cmd
|
||||
|
||||
def run(self):
|
||||
self.cloud.pull(self.parsed_args.targets, self.parsed_args.jobs)
|
||||
self.cmd(self.parsed_args.targets, self.parsed_args.jobs)
|
||||
|
||||
|
||||
class CmdDataPush(CmdBase):
|
||||
class CmdDataPull(CmdDataBase):
|
||||
def __init__(self, settings):
|
||||
super(CmdDataPush, self).__init__(settings)
|
||||
super(CmdDataPull, self).__init__(settings, self.cloud.pull)
|
||||
|
||||
def run(self):
|
||||
self.cloud.push(self.parsed_args.targets, self.parsed_args.jobs)
|
||||
|
||||
class CmdDataPush(CmdDataBase):
|
||||
def __init__(self, settings):
|
||||
super(CmdDataPush, self).__init__(settings, self.cloud.push)
|
||||
|
||||
|
||||
class CmdDataStatus(CmdBase):
|
||||
|
||||
Reference in New Issue
Block a user