rfc: Move welcome message to a private function

This commit is contained in:
Mr. Outis
2018-12-14 10:45:58 -06:00
parent 286373f9c7
commit df044c60ac
+18 -14
View File
@@ -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)
)