SAE Teensy ECU
IIT SAE Microcontroller programming
Loading...
Searching...
No Matches
text.py
1"""Text styling functions"""
2
3
4def error(text: str) -> str:
5 """Formats text as an error
6
7 Args:
8 text (str): The text to format
9
10 Returns:
11 str: Formatted Text
12 """
13 return f"\033[91m\033[1m\033[4m{text}\033[0m"
14
15
16def underline(text: str) -> str:
17 """Formats text as underlined
18
19 Args:
20 text (str): The text to format
21
22 Returns:
23 str: Formatted Text
24 """
25 return f"\033[4m{text}\033[0m"
26
27
28def header(text: str) -> str:
29 """Formats text as a header
30
31 Args:
32 text (str): The text to format
33
34 Returns:
35 str: Formatted Text
36 """
37 return f"\033[1m\033[4m{text}\033[0m"
38
39
40def warning(text: str) -> str:
41 """Formats text as a warning
42
43 Args:
44 text (str): The text to format
45
46 Returns:
47 str: Formatted Text
48 """
49 return f"\033[93m\033[1m{text}\033[0m"
50
51
52def yellow(text: str) -> str:
53 """Formats text to be yellow
54
55 Args:
56 text (str): The text to format
57
58 Returns:
59 str: Formatted Text
60 """
61 return f"\033[93m{text}\033[0m"
62
63
64def important(text: str) -> str:
65 """Formats text as important
66
67 Args:
68 text (str): The text to format
69
70 Returns:
71 str: Formatted Text
72 """
73 return f"\033[94m\033[1m{text}\033[0m"
74
75
76def really_important(text: str) -> str:
77 """Formats text as really important
78
79 Args:
80 text (str): The text to format
81
82 Returns:
83 str: Formatted Text
84 """
85 return f"\033[94m\033[1m\033[4m{text}\033[0m"
86
87
88def green(text: str) -> str:
89 """Formats text to be green
90
91 Args:
92 text (str): The text to format
93
94 Returns:
95 str: Formatted Text
96 """
97 return f"\033[92m{text}\033[0m"
98
99
100def red(text: str) -> str:
101 """Formats text to be red
102
103 Args:
104 text (str): The text to format
105
106 Returns:
107 str: Formatted Text
108 """
109 return f"\033[91m{text}\033[0m"
str important(str text)
Formats text as important.
Definition text.py:64
str red(str text)
Formats text to be red.
Definition text.py:100
str header(str text)
Formats text as a header.
Definition text.py:28
str warning(str text)
Formats text as a warning.
Definition text.py:40
str yellow(str text)
Formats text to be yellow.
Definition text.py:52
str underline(str text)
Formats text as underlined.
Definition text.py:16
str green(str text)
Formats text to be green.
Definition text.py:88
str really_important(str text)
Formats text as really important.
Definition text.py:76