Coverage for src/hods/tui/palette.py: 100.00%

Shortcuts on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

6 statements  

1"""hods - home directory synchronization. 

2 

3Copyright (C) 2016-2020 Mathias Stelzer <knoppo@rolln.de> 

4 

5hods is free software: you can redistribute it and/or modify 

6it under the terms of the GNU General Public License as published by 

7the Free Software Foundation, either version 3 of the License, or 

8(at your option) any later version. 

9 

10hods is distributed in the hope that it will be useful, 

11but WITHOUT ANY WARRANTY; without even the implied warranty of 

12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 

13GNU General Public License for more details. 

14 

15You should have received a copy of the GNU General Public License 

16along with this program. If not, see <http://www.gnu.org/licenses/>. 

17 

18 

19Global color palette for hods. 

20 

21Check docstrings in `urwid.display_common.BaseScreen` for usage: 

22>>> from urwid.display_common import BaseScreen 

23>>> BaseScreen.register_palette_entry 

24""" 

25 

26# name: ('fg-16', 'bg-16/8', 'mono', 'fg-256', 'bg-256') # noqa: E800 

27palette_dict = { 

28 

29 # general 

30 

31 'frame': ('black', 'light gray'), 

32 'frame header': ('dark cyan', 'light gray'), 

33 

34 'menu': 'frame', 

35 'menu focus': ('white', 'dark cyan'), 

36 'menu select': 'menu focus', 

37 'menu window': 'frame', 

38 

39 'body': ('white', 'black'), 

40 'body focus': ('white', 'black'), 

41 

42 'edit': 'body', 

43 'edit focus': ('white', 'dark cyan'), 

44 

45 'button': ('light cyan', 'black'), 

46 'button focus': ('white', 'dark cyan'), 

47 

48 'success': ('light green', 'black'), 

49 'success focus': ('white', 'dark green'), 

50 'success window': 'success focus', 

51 

52 'warning': ('yellow', 'black'), 

53 'warning focus': ('white', 'brown'), 

54 'warning window': 'warning focus', 

55 

56 'error': ('light red', 'black'), 

57 'error focus': ('white', 'dark red'), 

58 'error select': 'error focus', 

59 'error window': 'error focus', 

60 

61 'disabled': ('dark gray', 'black'), 

62 'disabled focus': ('dark gray', 'light gray'), 

63 'disabled select': 'disabled focus', 

64 

65 # config tree 

66 

67 'feature': ('light green', 'black'), 

68 'feature focus': ('white', 'dark cyan'), 

69 'feature select': ('white', 'dark green'), 

70 'feature window': 'feature select', 

71 

72 'source': ('light magenta', 'black'), 

73 'source focus': ('white', 'dark cyan'), 

74 'source select': ('white', 'dark magenta'), 

75 'source window': 'source select', 

76 

77 'directory': ('light blue', 'black'), 

78 'directory focus': ('white', 'dark blue'), 

79 'directory window': 'directory focus', 

80 

81 'file': ('white', 'black'), 

82 'file focus': ('black', 'light gray'), 

83 'file window': 'file focus', 

84 

85 'symlink': ('light cyan', 'black'), 

86 'symlink focus': ('black', 'dark cyan'), 

87 

88 'template': 'file', 

89 'template focus': 'file focus', 

90} 

91 

92PALETTE = [] 

93for key, colors in palette_dict.items(): 

94 if not isinstance(colors, tuple): 

95 colors = palette_dict[colors] 

96 PALETTE.append((key, *colors))