eric6/ThirdParty/Pygments/pygments/console.py

changeset 7547
21b0534faebc
parent 6942
2602857055c5
child 7701
25f42e208e08
equal deleted inserted replaced
7546:bf5f777260a6 7547:21b0534faebc
3 pygments.console 3 pygments.console
4 ~~~~~~~~~~~~~~~~ 4 ~~~~~~~~~~~~~~~~
5 5
6 Format colored console output. 6 Format colored console output.
7 7
8 :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. 8 :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
9 :license: BSD, see LICENSE for details. 9 :license: BSD, see LICENSE for details.
10 """ 10 """
11 11
12 esc = "\x1b[" 12 esc = "\x1b["
13 13
20 codes["standout"] = esc + "03m" 20 codes["standout"] = esc + "03m"
21 codes["underline"] = esc + "04m" 21 codes["underline"] = esc + "04m"
22 codes["blink"] = esc + "05m" 22 codes["blink"] = esc + "05m"
23 codes["overline"] = esc + "06m" 23 codes["overline"] = esc + "06m"
24 24
25 dark_colors = ["black", "darkred", "darkgreen", "brown", "darkblue", 25 dark_colors = ["black", "red", "green", "yellow", "blue",
26 "purple", "teal", "lightgray"] 26 "magenta", "cyan", "gray"]
27 light_colors = ["darkgray", "red", "green", "yellow", "blue", 27 light_colors = ["brightblack", "brightred", "brightgreen", "brightyellow", "brightblue",
28 "fuchsia", "turquoise", "white"] 28 "brightmagenta", "brightcyan", "white"]
29 29
30 x = 30 30 x = 30
31 for d, l in zip(dark_colors, light_colors): 31 for d, l in zip(dark_colors, light_colors):
32 codes[d] = esc + "%im" % x 32 codes[d] = esc + "%im" % x
33 codes[l] = esc + "%i;01m" % x 33 codes[l] = esc + "%im" % (60 + x)
34 x += 1 34 x += 1
35 35
36 del d, l, x 36 del d, l, x
37 37
38 codes["darkteal"] = codes["turquoise"]
39 codes["darkyellow"] = codes["brown"]
40 codes["fuscia"] = codes["fuchsia"]
41 codes["white"] = codes["bold"] 38 codes["white"] = codes["bold"]
42 39
43 40
44 def reset_color(): 41 def reset_color():
45 return codes["reset"] 42 return codes["reset"]

eric ide

mercurial