mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-06 07:18:28 +01:00
dvc: fix misc dvc stuff
Please don't merge pull requests that don't pass our checks. Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
+6
-7
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
|
||||
from dvc.command.base import CmdBase, DvcLock
|
||||
from dvc.command.common.base import CmdBase
|
||||
from dvc.logger import Logger
|
||||
from dvc.state_file import StateFile
|
||||
from dvc.command.run import CommandFile
|
||||
@@ -49,9 +49,8 @@ class CmdAdd(CmdBase):
|
||||
Logger.debug('State file "{}" was created'.format(data_item.state.relative))
|
||||
|
||||
def run(self):
|
||||
with DvcLock(self.is_locker, self.git):
|
||||
targets = self.collect_targets(self.parsed_args.input)
|
||||
self.add_files(targets)
|
||||
self.create_state_files(targets)
|
||||
msg = 'DVC add: {}'.format(str(self.parsed_args.input))
|
||||
self.commit_if_needed(msg)
|
||||
targets = self.collect_targets(self.parsed_args.input)
|
||||
self.add_files(targets)
|
||||
self.create_state_files(targets)
|
||||
msg = 'DVC add: {}'.format(str(self.parsed_args.input))
|
||||
self.commit_if_needed(msg)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import os
|
||||
import copy
|
||||
|
||||
from dvc.command.base import DvcLock
|
||||
from dvc.command.run import CmdRun, CommandFile
|
||||
from dvc.logger import Logger
|
||||
from dvc.exceptions import DvcException
|
||||
|
||||
+8
-10
@@ -70,17 +70,15 @@ class CmdRun(CmdBase):
|
||||
super(CmdRun, self).__init__(settings)
|
||||
|
||||
def run(self):
|
||||
with DvcLock(self.is_locker, self.git):
|
||||
cmd = ' '.join(self.parsed_args.command)
|
||||
try:
|
||||
command = CommandFile.load(cmd)
|
||||
#FIXME OLOLO don't forget to overwrite with cmdline args
|
||||
except Exception as exc:
|
||||
Logger.debug("Failed to load {}: {}".format(cmd, str(exc)))
|
||||
command = CommandFile(cmd, self.parsed_args.out, self.parsed_args.deps, self.parsed_args.lock, None)
|
||||
cmd = ' '.join(self.parsed_args.command)
|
||||
try:
|
||||
command = CommandFile.load(cmd)
|
||||
except Exception as exc:
|
||||
Logger.debug("Failed to load {}: {}".format(cmd, str(exc)))
|
||||
command = CommandFile(cmd, self.parsed_args.out, self.parsed_args.deps, self.parsed_args.lock, None)
|
||||
|
||||
self.run_command(self.settings, command)
|
||||
return self.commit_if_needed('DVC run: {}'.format(command.cmd))
|
||||
self.run_command(self.settings, command)
|
||||
return self.commit_if_needed('DVC run: {}'.format(command.cmd))
|
||||
|
||||
@staticmethod
|
||||
def run_command(settings, command):
|
||||
|
||||
+9
-9
@@ -35,15 +35,15 @@ class ConfigI(object):
|
||||
self._cloud = cloud
|
||||
self._conf_parser = conf_parser
|
||||
|
||||
# @classmethod
|
||||
# def CACHE_DIR(self):
|
||||
# """ Directory with cached data files """
|
||||
# return os.path.join(self.CONFIG_DIR, self.CACHE_DIR_NAME)
|
||||
#
|
||||
# @classmethod
|
||||
# def STATE_DIR(self):
|
||||
# """ Directory with state files """
|
||||
# return os.path.join(self.CONFIG_DIR, self.STATE_DIR_NAME)
|
||||
@property
|
||||
def cache_dir(self):
|
||||
""" Directory with cached data files """
|
||||
return self.CACHE_DIR
|
||||
|
||||
@property
|
||||
def state_dir(self):
|
||||
""" Directory with state files """
|
||||
return self.STATE_DIR
|
||||
|
||||
@property
|
||||
def cloud(self):
|
||||
|
||||
Reference in New Issue
Block a user