aboutsummaryrefslogtreecommitdiff
path: root/pyfarbpracht.py
blob: bb5e0418cec71905c808e7d1b42ab7589345bfca (plain) (blame)
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
36
37
38
39
from os import linesep

# print with color support
def printc(color, msg, no_newline=False, enable_color=False):
    ret = str()
    if enable_color:
        ret += colored(color, msg)
    else:
        ret += msg
    if no_newline:
        end = ''
    else:
        end = linesep
    print(ret, end=end)
    return ret

# print with color support
def colored(color, msg):
    ret = str()
    c = 'default'
    if color == 'red':
        c = '31'
    elif color == 'green':
        c = '32'
    elif color == 'yellow':
        c = '33'
    elif color == 'blue':
        c = '34'
    elif color == 'magenta':
        c = '35'
    elif color == 'cyan':
        c = '36'
    if c is not 'default':
        # set color
        ret += '\033[0;' + c + 'm'
    ret += msg
    # reset color
    ret += '\033[0m'
    return ret
in each repos: see "about"-tab (if existing) for more details / README.
mailto contact at omeckman dot net
all timestamps in UTC (German winter time: UTC+01:00, summer time: UTC+02:00)
dark theme is a modded version of: https://gist.github.com/Yoplitein/f4b671a2ec70c9e743fa