1
|
|
|
from typing import Iterable |
|
|
|
|
2
|
|
|
|
3
|
|
|
from pocketutils.misc.klgists import logger |
4
|
|
|
from colorama import Fore, Style |
|
|
|
|
5
|
|
|
|
6
|
|
|
def warn_user(*lines: str): |
|
|
|
|
7
|
|
|
print() |
|
|
|
|
8
|
|
|
warn_thin(*lines) |
|
|
|
|
9
|
|
|
print() |
|
|
|
|
10
|
|
|
def warn_thin(*lines: str): |
|
|
|
|
11
|
|
|
print_to_user(['', *lines, ''], Fore.RED) |
|
|
|
|
12
|
|
|
|
13
|
|
|
def notify_user(*lines: str): |
|
|
|
|
14
|
|
|
print() |
|
|
|
|
15
|
|
|
notify_thin(*lines) |
|
|
|
|
16
|
|
|
print() |
|
|
|
|
17
|
|
|
def notify_thin(*lines: str): |
|
|
|
|
18
|
|
|
print_to_user(['', *lines, ''], Fore.BLUE) |
|
|
|
|
19
|
|
|
|
20
|
|
|
def success_to_user(*lines: str): |
|
|
|
|
21
|
|
|
print() |
|
|
|
|
22
|
|
|
success_to_user_thin(*lines) |
|
|
|
|
23
|
|
|
print() |
|
|
|
|
24
|
|
|
def success_to_user_thin(*lines: str): |
|
|
|
|
25
|
|
|
print_to_user(['', *lines, ''], Fore.GREEN) |
|
|
|
|
26
|
|
|
|
27
|
|
|
def concern_to_user(*lines: str): |
|
|
|
|
28
|
|
|
print() |
|
|
|
|
29
|
|
|
concern_to_user_thin(*lines) |
|
|
|
|
30
|
|
|
print() |
|
|
|
|
31
|
|
|
def concern_to_user_thin(*lines: str): |
|
|
|
|
32
|
|
|
print_to_user(['', *lines, ''], Fore.MAGENTA) |
|
|
|
|
33
|
|
|
|
34
|
|
|
def notify_user_light(*lines: str): |
|
|
|
|
35
|
|
|
print() |
|
|
|
|
36
|
|
|
notify_light_thin(*lines) |
|
|
|
|
37
|
|
|
print() |
|
|
|
|
38
|
|
|
def notify_light_thin(*lines: str): |
|
|
|
|
39
|
|
|
print_to_user(['', *lines, ''], Style.BRIGHT, sides='') |
|
|
|
|
40
|
|
|
|
41
|
|
|
def header_to_user(*lines: str): |
|
|
|
|
42
|
|
|
print_to_user(lines, Style.BRIGHT) |
|
|
|
|
43
|
|
|
|
44
|
|
|
def print_to_user(lines: Iterable[str], color: int, top: str='_', bottom: str='_', sides: str='', line_length: int=100): |
|
|
|
|
45
|
|
|
def cl(text: str): print(str(color) + sides + text.center(line_length - 2*len(sides)) + sides) |
|
|
|
|
46
|
|
|
print(str(color) + top * line_length) |
|
|
|
|
47
|
|
|
logger.debug(top * line_length) |
|
|
|
|
48
|
|
|
for line in lines: |
|
|
|
|
49
|
|
|
logger.debug(line) |
|
|
|
|
50
|
|
|
cl(line) |
|
|
|
|
51
|
|
|
print(str(color) + bottom * line_length) |
|
|
|
|
52
|
|
|
logger.debug(bottom * line_length) |
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|