Show More
@@ -19,105 +19,111 b' try:' | |||||
19 | import curses |
|
19 | import curses | |
20 | # Mapping from effect name to terminfo attribute name (or raw code) or |
|
20 | # Mapping from effect name to terminfo attribute name (or raw code) or | |
21 | # color number. This will also force-load the curses module. |
|
21 | # color number. This will also force-load the curses module. | |
22 |
_terminfo_params = { |
|
22 | _terminfo_params = { | |
23 |
|
|
23 | 'none': (True, 'sgr0', ''), | |
24 |
|
|
24 | 'standout': (True, 'smso', ''), | |
25 |
|
|
25 | 'underline': (True, 'smul', ''), | |
26 |
|
|
26 | 'reverse': (True, 'rev', ''), | |
27 |
|
|
27 | 'inverse': (True, 'rev', ''), | |
28 |
|
|
28 | 'blink': (True, 'blink', ''), | |
29 |
|
|
29 | 'dim': (True, 'dim', ''), | |
30 |
|
|
30 | 'bold': (True, 'bold', ''), | |
31 |
|
|
31 | 'invisible': (True, 'invis', ''), | |
32 | 'black': (False, curses.COLOR_BLACK, ''), |
|
32 | 'italic': (True, 'sitm', ''), | |
33 |
|
|
33 | 'black': (False, curses.COLOR_BLACK, ''), | |
34 |
|
|
34 | 'red': (False, curses.COLOR_RED, ''), | |
35 |
|
|
35 | 'green': (False, curses.COLOR_GREEN, ''), | |
36 |
|
|
36 | 'yellow': (False, curses.COLOR_YELLOW, ''), | |
37 |
|
|
37 | 'blue': (False, curses.COLOR_BLUE, ''), | |
38 |
|
|
38 | 'magenta': (False, curses.COLOR_MAGENTA, ''), | |
39 |
|
|
39 | 'cyan': (False, curses.COLOR_CYAN, ''), | |
|
40 | 'white': (False, curses.COLOR_WHITE, ''), | |||
|
41 | } | |||
40 | except ImportError: |
|
42 | except ImportError: | |
41 | curses = None |
|
43 | curses = None | |
42 | _terminfo_params = {} |
|
44 | _terminfo_params = {} | |
43 |
|
45 | |||
44 | # start and stop parameters for effects |
|
46 | # start and stop parameters for effects | |
45 |
_effects = { |
|
47 | _effects = { | |
46 | 'black': 30, |
|
48 | 'none': 0, | |
47 | 'red': 31, |
|
49 | 'black': 30, | |
48 |
|
|
50 | 'red': 31, | |
49 | 'yellow': 33, |
|
51 | 'green': 32, | |
50 | 'blue': 34, |
|
52 | 'yellow': 33, | |
51 | 'magenta': 35, |
|
53 | 'blue': 34, | |
52 | 'cyan': 36, |
|
54 | 'magenta': 35, | |
53 | 'white': 37, |
|
55 | 'cyan': 36, | |
54 | 'bold': 1, |
|
56 | 'white': 37, | |
55 | 'italic': 3, |
|
57 | 'bold': 1, | |
56 | 'underline': 4, |
|
58 | 'italic': 3, | |
57 | 'inverse': 7, |
|
59 | 'underline': 4, | |
58 | 'dim': 2, |
|
60 | 'inverse': 7, | |
59 | 'black_background': 40, |
|
61 | 'dim': 2, | |
60 |
|
|
62 | 'black_background': 40, | |
61 |
|
|
63 | 'red_background': 41, | |
62 |
|
|
64 | 'green_background': 42, | |
63 |
|
|
65 | 'yellow_background': 43, | |
64 |
|
|
66 | 'blue_background': 44, | |
65 |
|
|
67 | 'purple_background': 45, | |
66 |
|
|
68 | 'cyan_background': 46, | |
|
69 | 'white_background': 47, | |||
|
70 | } | |||
67 |
|
71 | |||
68 | _styles = {'grep.match': 'red bold', |
|
72 | _styles = { | |
69 | 'grep.linenumber': 'green', |
|
73 | 'grep.match': 'red bold', | |
70 |
|
|
74 | 'grep.linenumber': 'green', | |
71 |
|
|
75 | 'grep.rev': 'green', | |
72 |
|
|
76 | 'grep.change': 'green', | |
73 |
|
|
77 | 'grep.sep': 'cyan', | |
74 |
|
|
78 | 'grep.filename': 'magenta', | |
75 |
|
|
79 | 'grep.user': 'magenta', | |
76 | 'bookmarks.active': 'green', |
|
80 | 'grep.date': 'magenta', | |
77 |
|
|
81 | 'bookmarks.active': 'green', | |
78 |
|
|
82 | 'branches.active': 'none', | |
79 | 'branches.current': 'green', |
|
83 | 'branches.closed': 'black bold', | |
80 |
|
|
84 | 'branches.current': 'green', | |
81 | 'diff.changed': 'white', |
|
85 | 'branches.inactive': 'none', | |
82 |
|
|
86 | 'diff.changed': 'white', | |
83 |
|
|
87 | 'diff.deleted': 'red', | |
84 |
|
|
88 | 'diff.diffline': 'bold', | |
85 |
|
|
89 | 'diff.extended': 'cyan bold', | |
86 |
|
|
90 | 'diff.file_a': 'red bold', | |
87 | 'diff.hunk': 'magenta', |
|
91 | 'diff.file_b': 'green bold', | |
88 |
|
|
92 | 'diff.hunk': 'magenta', | |
89 |
|
|
93 | 'diff.inserted': 'green', | |
90 | 'diff.trailingwhitespace': 'bold red_background', |
|
94 | 'diff.tab': '', | |
91 | 'changeset.public' : '', |
|
95 | 'diff.trailingwhitespace': 'bold red_background', | |
92 |
|
|
96 | 'changeset.public' : '', | |
93 |
|
|
97 | 'changeset.draft' : '', | |
94 | 'diffstat.deleted': 'red', |
|
98 | 'changeset.secret' : '', | |
95 |
|
|
99 | 'diffstat.deleted': 'red', | |
96 | 'histedit.remaining': 'red bold', |
|
100 | 'diffstat.inserted': 'green', | |
97 | 'ui.prompt': 'yellow', |
|
101 | 'histedit.remaining': 'red bold', | |
98 |
|
|
102 | 'ui.prompt': 'yellow', | |
99 | 'patchbomb.finalsummary': '', |
|
103 | 'log.changeset': 'yellow', | |
100 |
|
|
104 | 'patchbomb.finalsummary': '', | |
101 |
|
|
105 | 'patchbomb.from': 'magenta', | |
102 |
|
|
106 | 'patchbomb.to': 'cyan', | |
103 |
|
|
107 | 'patchbomb.subject': 'green', | |
104 | 'rebase.rebased': 'blue', |
|
108 | 'patchbomb.diffstats': '', | |
105 |
|
|
109 | 'rebase.rebased': 'blue', | |
106 |
|
|
110 | 'rebase.remaining': 'red bold', | |
107 |
|
|
111 | 'resolve.resolved': 'green bold', | |
108 | 'shelve.age': 'cyan', |
|
112 | 'resolve.unresolved': 'red bold', | |
109 |
|
|
113 | 'shelve.age': 'cyan', | |
110 |
|
|
114 | 'shelve.newest': 'green bold', | |
111 | 'status.added': 'green bold', |
|
115 | 'shelve.name': 'blue bold', | |
112 |
|
|
116 | 'status.added': 'green bold', | |
113 |
|
|
117 | 'status.clean': 'none', | |
114 |
|
|
118 | 'status.copied': 'none', | |
115 |
|
|
119 | 'status.deleted': 'cyan bold underline', | |
116 |
|
|
120 | 'status.ignored': 'black bold', | |
117 |
|
|
121 | 'status.modified': 'blue bold', | |
118 | 'status.unknown': 'magenta bold underline', |
|
122 | 'status.removed': 'red bold', | |
119 | 'tags.normal': 'green', |
|
123 | 'status.unknown': 'magenta bold underline', | |
120 | 'tags.local': 'black bold'} |
|
124 | 'tags.normal': 'green', | |
|
125 | 'tags.local': 'black bold', | |||
|
126 | } | |||
121 |
|
127 | |||
122 | def loadcolortable(ui, extname, colortable): |
|
128 | def loadcolortable(ui, extname, colortable): | |
123 | _styles.update(colortable) |
|
129 | _styles.update(colortable) |
General Comments 0
You need to be logged in to leave comments.
Login now