mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-10 07:18:27 +01:00
+7
-8
@@ -1,5 +1,6 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import sys
|
||||
import argparse
|
||||
from multiprocessing import cpu_count
|
||||
|
||||
@@ -7,7 +8,7 @@ from dvc.command.init import CmdInit
|
||||
from dvc.command.remove import CmdRemove
|
||||
from dvc.command.run import CmdRun
|
||||
from dvc.command.repro import CmdRepro
|
||||
from dvc.command.data_sync import CmdDataSync, CmdDataPush, CmdDataPull, CmdDataStatus
|
||||
from dvc.command.data_sync import CmdDataPush, CmdDataPull, CmdDataStatus
|
||||
from dvc.command.lock import CmdLock
|
||||
from dvc.command.gc import CmdGC
|
||||
from dvc.command.import_file import CmdImportFile
|
||||
@@ -55,6 +56,11 @@ def parse_args(argv=None):
|
||||
dest='cmd',
|
||||
help='Use dvc CMD --help for command-specific help')
|
||||
|
||||
# NOTE: Workaround for bug in Python 3
|
||||
if sys.version_info[0] == 3:
|
||||
subparsers.required = True
|
||||
subparsers.dest = 'cmd'
|
||||
|
||||
# Init
|
||||
init_parser = subparsers.add_parser(
|
||||
'init',
|
||||
@@ -122,13 +128,6 @@ def parse_args(argv=None):
|
||||
default=cpu_count(),
|
||||
help='Number of jobs to run simultaneously.')
|
||||
|
||||
# Sync
|
||||
sync_parser = subparsers.add_parser(
|
||||
'sync',
|
||||
parents=[parent_sync_parser],
|
||||
help='Synchronize data file with cloud (cloud settings already setup.')
|
||||
sync_parser.set_defaults(func=CmdDataSync)
|
||||
|
||||
# Pull
|
||||
pull_parser = subparsers.add_parser(
|
||||
'pull',
|
||||
|
||||
@@ -3,14 +3,6 @@ from dvc.logger import Logger
|
||||
|
||||
import dvc.data_cloud as cloud
|
||||
|
||||
class CmdDataSync(CmdBase):
|
||||
def __init__(self, settings):
|
||||
super(CmdDataSync, self).__init__(settings)
|
||||
|
||||
def run(self):
|
||||
with DvcLock(self.is_locker, self.git):
|
||||
self.cloud.sync(self.parsed_args.targets, self.parsed_args.jobs)
|
||||
|
||||
|
||||
class CmdDataPull(CmdBase):
|
||||
def __init__(self, settings):
|
||||
|
||||
Reference in New Issue
Block a user