1 # -*- coding: utf-8 -*-
3 # Copyright 2020 The Pigweed Authors
5 # Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 # use this file except in compliance with the License. You may obtain a copy of
9 # https://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 # License for the specific language governing permissions and limitations under
16 """Prints the env_setup banner for cmd.exe.
18 This is done from Python as activating colors and printing ASCII art are not
19 easy to do in cmd.exe. Activated colors also don't persist in the parent
23 from __future__ import print_function
29 from colors import Color, enable_colors # type: ignore
31 _PIGWEED_BANNER = u'''
32 ▒█████▄ █▓ ▄███▒ ▒█ ▒█ ░▓████▒ ░▓████▒ ▒▓████▄
33 ▒█░ █░ ░█▒ ██▒ ▀█▒ ▒█░ █ ▒█ ▒█ ▀ ▒█ ▀ ▒█ ▀█▌
34 ▒█▄▄▄█░ ░█▒ █▓░ ▄▄░ ▒█░ █ ▒█ ▒███ ▒███ ░█ █▌
35 ▒█▀ ░█░ ▓█ █▓ ░█░ █ ▒█ ▒█ ▄ ▒█ ▄ ░█ ▄█▌
36 ▒█ ░█░ ░▓███▀ ▒█▓▀▓█░ ░▓████▒ ░▓████▒ ▒▓████▀
40 def print_banner(bootstrap, no_shell_file):
41 """Print the Pigweed or project-specific banner"""
44 print(Color.green('\n WELCOME TO...'))
45 print(Color.magenta(_PIGWEED_BANNER))
49 Color.green('\n BOOTSTRAP! Bootstrap may take a few minutes; '
53 ' On Windows, this stage is extremely slow (~10 minutes).\n'))
57 '\n ACTIVATOR! This sets your console environment variables.\n'
61 print(Color.bold_red('Error!\n'))
63 Color.red(' Your Pigweed environment does not seem to be'
65 print(Color.red(' Run bootstrap.bat to perform initial setup.'))
71 """Parse command-line arguments."""
72 parser = argparse.ArgumentParser()
73 parser.add_argument('--bootstrap', action='store_true')
74 parser.add_argument('--no-shell-file', action='store_true')
75 return parser.parse_args()
79 """Script entry point."""
82 return print_banner(**vars(parse()))
85 if __name__ == '__main__':