Last active
June 4, 2022 21:57
-
-
Save kkroesch/40e26a3a6033898a20d1 to your computer and use it in GitHub Desktop.
Color definitions for console output.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DOUBLE_LINE = '=' * 80 | |
OUTPUT_TEMPLATE = "{0:32}{1:>6}" | |
DEVICE_TEMPLATE = "{0:35}{1:22}{2:>12}" | |
CHECK_SIGN = u'✔'.encode('utf-8') | |
FAIL_SIGN = u'✘'.encode('utf-8') | |
class Colors: | |
""" Colors for console putput as ANSI code. | |
Example usage: | |
exit(Colors.ERROR.format('Error: API token not given.')) | |
print(Colors.OKGREEN.format("All went fine.") | |
""" | |
HEADER = '\033[95m{}\033[0m' | |
OKBLUE = '\033[94m{}\033[0m' | |
OKGREEN = '\033[92m{}\033[0m' | |
ERROR = '\033[91m{}\033[0m' | |
WARNING = '\033[93m{}\033[0m' | |
FAIL = '\033[91m{}\033[0m' | |
BOLD = '\033[1m{}\033[0m' | |
UNDERLINE = '\033[4m{}\033[0m' | |
ENDC = '\033[0m' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment