mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-13 15:28:27 +01:00
Merge pull request #2986 from jorgeorpinel/output/format/single-quotes
dvc: use ' to mark dynamic command output, et al.
This commit is contained in:
+3
-1
@@ -164,4 +164,6 @@ def _find_or_create_user_id():
|
||||
return user_id
|
||||
|
||||
except LockError:
|
||||
logger.debug("Failed to acquire {lockfile}".format(lockfile=lockfile))
|
||||
logger.debug(
|
||||
"Failed to acquire '{lockfile}'".format(lockfile=lockfile)
|
||||
)
|
||||
|
||||
@@ -20,7 +20,7 @@ class CmdRemove(CmdBase):
|
||||
if self.args.force:
|
||||
return False
|
||||
|
||||
msg = "Are you sure you want to remove {} with its outputs?".format(
|
||||
msg = "Are you sure you want to remove '{}' with its outputs?".format(
|
||||
target
|
||||
)
|
||||
|
||||
@@ -38,7 +38,7 @@ class CmdRemove(CmdBase):
|
||||
outs_only = self._is_outs_only(target)
|
||||
self.repo.remove(target, outs_only=outs_only)
|
||||
except DvcException:
|
||||
logger.exception("failed to remove {}".format(target))
|
||||
logger.exception("failed to remove '{}'".format(target))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ def Choices(*choices):
|
||||
*choices: pass allowed values as arguments, or pass a list or
|
||||
tuple as a single argument
|
||||
"""
|
||||
return Any(*choices, msg="expected one of {}".format(",".join(choices)))
|
||||
return Any(*choices, msg="expected one of {}".format(", ".join(choices)))
|
||||
|
||||
|
||||
class Config(object): # pylint: disable=too-many-instance-attributes
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ class RemoteCmdError(DvcException):
|
||||
|
||||
class RemoteActionNotImplemented(DvcException):
|
||||
def __init__(self, action, scheme):
|
||||
m = "{} is not supported by {} remote".format(action, scheme)
|
||||
m = "{} is not supported for {} remotes".format(action, scheme)
|
||||
super(RemoteActionNotImplemented, self).__init__(m)
|
||||
|
||||
|
||||
|
||||
+3
-3
@@ -69,9 +69,9 @@ class RemoteOSS(RemoteBASE):
|
||||
def oss_service(self):
|
||||
import oss2
|
||||
|
||||
logger.debug("URL {}".format(self.path_info))
|
||||
logger.debug("key id {}".format(self.key_id))
|
||||
logger.debug("key secret {}".format(self.key_secret))
|
||||
logger.debug("URL: {}".format(self.path_info))
|
||||
logger.debug("key id: {}".format(self.key_id))
|
||||
logger.debug("key secret: {}".format(self.key_secret))
|
||||
|
||||
auth = oss2.Auth(self.key_id, self.key_secret)
|
||||
bucket = oss2.Bucket(auth, self.endpoint, self.path_info.bucket)
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ def add(repo, targets, recursive=False, no_commit=False, fname=None):
|
||||
"You are adding a large directory '{target}' recursively,"
|
||||
" consider tracking it as a whole instead.\n"
|
||||
"{purple}HINT:{nc} Remove the generated DVC-file and then"
|
||||
" run {cyan}dvc add {target}{nc}".format(
|
||||
" run `{cyan}dvc add {target}{nc}`".format(
|
||||
purple=colorama.Fore.MAGENTA,
|
||||
cyan=colorama.Fore.CYAN,
|
||||
nc=colorama.Style.RESET_ALL,
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ logger = logging.getLogger(__name__)
|
||||
def _do_gc(typ, func, clist):
|
||||
removed = func(clist)
|
||||
if not removed:
|
||||
logger.info("No unused {} cache to remove.".format(typ))
|
||||
logger.info("No unused '{}' cache to remove.".format(typ))
|
||||
|
||||
|
||||
@locked
|
||||
|
||||
+2
-2
@@ -116,7 +116,7 @@ class MissingDep(DvcException):
|
||||
else:
|
||||
dep = "dependency"
|
||||
|
||||
msg = "missing {}: {}".format(dep, ", ".join(map(str, deps)))
|
||||
msg = "missing '{}': {}".format(dep, ", ".join(map(str, deps)))
|
||||
super(MissingDep, self).__init__(msg)
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ class MissingDataSource(DvcException):
|
||||
if len(missing_files) > 1:
|
||||
source += "s"
|
||||
|
||||
msg = "missing data {}: {}".format(source, ", ".join(missing_files))
|
||||
msg = "missing data '{}': {}".format(source, ", ".join(missing_files))
|
||||
super(MissingDataSource, self).__init__(msg)
|
||||
|
||||
|
||||
|
||||
+10
-10
@@ -124,12 +124,13 @@ class Updater(object): # pragma: no cover
|
||||
|
||||
def _get_update_instructions(self):
|
||||
instructions = {
|
||||
"pip": "Run {yellow}pip{reset} install dvc {blue}--upgrade{reset}",
|
||||
"rpm": "Run {yellow}yum{reset} update dvc",
|
||||
"brew": "Run {yellow}brew{reset} upgrade dvc",
|
||||
"pip": "Run `{yellow}pip{reset} install dvc "
|
||||
"{blue}--upgrade{reset}`",
|
||||
"rpm": "Run `{yellow}yum{reset} update dvc`",
|
||||
"brew": "Run `{yellow}brew{reset} upgrade dvc`",
|
||||
"deb": (
|
||||
"Run {yellow}apt-get{reset} install"
|
||||
" {blue}--only-upgrade{reset} dvc"
|
||||
"Run `{yellow}apt-get{reset} install"
|
||||
" {blue}--only-upgrade{reset} dvc`"
|
||||
),
|
||||
"binary": (
|
||||
"To upgrade follow these steps:\n"
|
||||
@@ -137,12 +138,11 @@ class Updater(object): # pragma: no cover
|
||||
"2. Go to {blue}https://dvc.org{reset}\n"
|
||||
"3. Download and install new binary"
|
||||
),
|
||||
"conda": "Run {yellow}conda{reset} update dvc",
|
||||
"choco": "Run {yellow}choco{reset} upgrade dvc",
|
||||
"conda": "Run `{yellow}conda{reset} update dvc`",
|
||||
"choco": "Run `{yellow}choco{reset} upgrade dvc`",
|
||||
None: (
|
||||
"Find the latest release at\n{blue}"
|
||||
"https://github.com/iterative/dvc/releases/latest"
|
||||
"{reset}"
|
||||
"Find the latest release at\n"
|
||||
"{blue}https://github.com/iterative/dvc/releases/latest{reset}"
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,9 @@ def file_md5(fname):
|
||||
no_progress_bar = True
|
||||
if size >= LARGE_FILE_SIZE:
|
||||
no_progress_bar = False
|
||||
msg = "Computing md5 for a large file {}. This is only done once."
|
||||
msg = (
|
||||
"Computing md5 for a large file '{}'. This is only done once."
|
||||
)
|
||||
logger.info(msg.format(relpath(fname)))
|
||||
name = relpath(fname)
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ class TestAddCmdDirectoryRecursive(TestDvc):
|
||||
"You are adding a large directory 'large-dir' recursively,"
|
||||
" consider tracking it as a whole instead.\n"
|
||||
"{purple}HINT:{nc} Remove the generated DVC-file and then"
|
||||
" run {cyan}dvc add large-dir{nc}".format(
|
||||
" run `{cyan}dvc add large-dir{nc}`".format(
|
||||
purple=colorama.Fore.MAGENTA,
|
||||
cyan=colorama.Fore.CYAN,
|
||||
nc=colorama.Style.RESET_ALL,
|
||||
|
||||
Reference in New Issue
Block a user