forked from bl4de/security-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconsole_output_beautifier.py
More file actions
35 lines (31 loc) · 1.05 KB
/
Copy pathconsole_output_beautifier.py
File metadata and controls
35 lines (31 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
class ConsoleOutputBeautifier:
"""This class defines properties and methods to manipulate console output"""
colors = {
"black": '\33[30m',
"white": '\33[37m',
"red": '\33[31m',
"green": '\33[32m',
"yellow": '\33[33m',
"blue": '\33[34m',
"magenta": '\33[35m',
"cyan": '\33[36m',
"grey": '\33[90m',
"lightblue": '\33[94'
}
characters = {
"endline": '\33[0m'
}
def __init__(self):
return None
@staticmethod
def getColor(color_name):
"""returns color identified by color_name or white as default value"""
if color_name in ConsoleOutputBeautifier.colors:
return ConsoleOutputBeautifier.colors[color_name]
return ConsoleOutputBeautifier.colors["white"]
@staticmethod
def getSpecialChar(char_name):
"""returns special character identified by char_name"""
if char_name in ConsoleOutputBeautifier.characters:
return ConsoleOutputBeautifier.characters[char_name]
return ""