def _welcome_message(): logger.info( boxify( "DVC has enabled anonymous aggregate usage analytics.\n" "Read the analytics documentation (and how to opt-out) here:\n" "{blue}https://dvc.org/doc/user-guide/analytics{nc}".format( blue=colorama.Fore.BLUE, nc=colorama.Fore.RESET ), border_color="red", ) ) msg = ( "{yellow}What's next?{nc}\n" "{yellow}------------{nc}\n" "- Check out the documentation: {blue}https://dvc.org/doc{nc}\n" "- Get help and share ideas: {blue}https://dvc.org/chat{nc}\n" "- Star us on GitHub: {blue}https://github.com/iterative/dvc{nc}" ).format( yellow=colorama.Fore.YELLOW, blue=colorama.Fore.BLUE, nc=colorama.Fore.RESET, ) logger.info(msg)
def test_boxify(self): expected = ("+-----------------+\n" "| |\n" "| message |\n" "| |\n" "+-----------------+\n") assert expected == utils.boxify("message")
def _notify(self): if not sys.stdout.isatty(): return message = ( "Update available {red}{current}{reset} -> {green}{latest}{reset}" + "\n" + self._get_update_instructions()).format( red=colorama.Fore.RED, reset=colorama.Fore.RESET, green=colorama.Fore.GREEN, yellow=colorama.Fore.YELLOW, blue=colorama.Fore.BLUE, current=self.current, latest=self.latest, ) logger.info(boxify(message, border_color="yellow"))
def _welcome_message(): from dvc.ui import ui if analytics.is_enabled(): ui.write( boxify( "DVC has enabled anonymous aggregate usage analytics.\n" "Read the analytics documentation (and how to opt-out) here:\n" + fmt_link("https://dvc.org/doc/user-guide/analytics"), border_color="red", )) msg = ( "{yellow}What's next?{nc}\n" "{yellow}------------{nc}\n" f"- Check out the documentation: {fmt_link('https://dvc.org/doc')}\n" f"- Get help and share ideas: {fmt_link('https://dvc.org/chat')}\n" f"- Star us on GitHub: {fmt_link('https://github.com/iterative/dvc')}" ).format(yellow=colorama.Fore.YELLOW, nc=colorama.Fore.RESET) ui.write(msg)