From df044c60ac78a2bfbcaf4130ac83e795c401fe93 Mon Sep 17 00:00:00 2001 From: "Mr. Outis" Date: Thu, 13 Dec 2018 21:58:16 -0600 Subject: [PATCH] rfc: Move welcome message to a private function --- dvc/project.py | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/dvc/project.py b/dvc/project.py index dce1ade24..fbd7fa9a0 100644 --- a/dvc/project.py +++ b/dvc/project.py @@ -106,7 +106,6 @@ class Project(object): Raises: KeyError: Raises an exception. """ - import colorama import shutil from dvc.scm import SCM, Base from dvc.config import Config @@ -136,19 +135,7 @@ class Project(object): logger.info('\nYou can now commit the changes to git.') - logger.info( - "\n" - "{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, - green=colorama.Fore.GREEN, - nc=colorama.Fore.RESET) - ) + proj._welcome_message() return proj @@ -1243,3 +1230,20 @@ class Project(object): for G in self.pipelines(): stages.extend(list(nx.get_node_attributes(G, 'stage').values())) return stages + + def _welcome_message(self): + import colorama + + self.logger.info( + "\n" + "{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, + green=colorama.Fore.GREEN, + nc=colorama.Fore.RESET) + )