dvc: use ' for dynamic output (through dvc/util/)

This commit is contained in:
Jorge Orpinel
2019-12-20 19:00:09 -07:00
parent 655fa956d4
commit 06822a060e
7 changed files with 21 additions and 19 deletions
+1 -1
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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}"
),
}
+3 -1
View File
@@ -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)