mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-07 15:28:28 +01:00
pull/push: generalize CmdDataBase class
Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
@@ -3,21 +3,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)
|
||||
getattr(self.cloud, 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, '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, 'push')
|
||||
|
||||
|
||||
class CmdDataStatus(CmdBase):
|
||||
|
||||
Reference in New Issue
Block a user