def test_box(self): logger.box("message") output = ("+-----------------+\n" "| |\n" "| message |\n" "| |\n" "+-----------------+\n" "\n") self.assertEqual(self.stdout, output)
def test_box(self): logger.box('message') output = ('+-----------------+\n' '| |\n' '| message |\n' '| |\n' '+-----------------+\n' '\n') self.assertEqual(self.stdout, output)
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.box(message, border_color='yellow')
def _welcome_message(self): import colorama logger.box( "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') logger.info( "{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))