termcore 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. termcore/__init__.py +6 -0
  2. termcore/cli/__init__.py +3 -0
  3. termcore/cli/output.py +70 -0
  4. termcore/io/__init__.py +7 -0
  5. termcore/io/app_state_storage.py +185 -0
  6. termcore/io/database.py +655 -0
  7. termcore/io/errors.py +71 -0
  8. termcore/io/file.py +263 -0
  9. termcore/io/textfile.py +92 -0
  10. termcore/py.typed +0 -0
  11. termcore/tui/__init__.py +9 -0
  12. termcore/tui/custom_bindings.py +551 -0
  13. termcore/tui/custom_widgets/__init__.py +1 -0
  14. termcore/tui/custom_widgets/custom_checkbox.py +41 -0
  15. termcore/tui/custom_widgets/custom_data_table.py +247 -0
  16. termcore/tui/custom_widgets/custom_selection.py +80 -0
  17. termcore/tui/custom_widgets/multiline_footer.py +240 -0
  18. termcore/tui/question_screen.py +107 -0
  19. termcore/tui/theme_loader.py +495 -0
  20. termcore/tui/themes/__init__.py +2 -0
  21. termcore/tui/themes/classic-black-saturated/style.css +57 -0
  22. termcore/tui/themes/classic-black-saturated/theme.py +22 -0
  23. termcore/tui/themes/classic-black-v1/style.css +57 -0
  24. termcore/tui/themes/classic-black-v1/theme.py +22 -0
  25. termcore/tui/themes/classic-black-v2/style.css +57 -0
  26. termcore/tui/themes/classic-black-v2/theme.py +24 -0
  27. termcore/tui/themes/classic-blue/theme.py +21 -0
  28. termcore/tui/themes/compact-gray/style.tcss +175 -0
  29. termcore/tui/themes/compact-gray/theme.py +22 -0
  30. termcore/tui/themes/mnml-black/style.css +57 -0
  31. termcore/tui/themes/mnml-black/theme.py +21 -0
  32. termcore/tui/themes/mnml-deepblack/style.css +57 -0
  33. termcore/tui/themes/mnml-deepblack/theme.py +21 -0
  34. termcore/tui/themes/pure-amber/theme.py +18 -0
  35. termcore/tui/themes/pure-black/theme.py +18 -0
  36. termcore/tui/themes/pure-blue/theme.py +18 -0
  37. termcore/tui/themes/pure-green/theme.py +18 -0
  38. termcore/tui/themes/pure-sweet16/theme.py +20 -0
  39. termcore/tui/themes/xplore-black/theme.py +18 -0
  40. termcore/tui/themes/xplore-blue/theme.py +18 -0
  41. termcore/tui/themes/xplore-blue-muted/theme.py +18 -0
  42. termcore/tui/themes/xplore-teal/theme.py +18 -0
  43. termcore/util/__init__.py +10 -0
  44. termcore/util/datetime.py +173 -0
  45. termcore/util/debug.py +196 -0
  46. termcore/util/index.py +112 -0
  47. termcore/util/logger.py +36 -0
  48. termcore/util/singleton.py +46 -0
  49. termcore/util/string.py +263 -0
  50. termcore/util/validation.py +31 -0
  51. termcore/util/version.py +56 -0
  52. termcore-0.2.0.dist-info/METADATA +504 -0
  53. termcore-0.2.0.dist-info/RECORD +55 -0
  54. termcore-0.2.0.dist-info/WHEEL +4 -0
  55. termcore-0.2.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,57 @@
1
+ * {
2
+ scrollbar-background: $panel;
3
+ }
4
+
5
+ .text-area--cursor, .input--cursor {
6
+ color: #80e98c;
7
+ }
8
+
9
+ ToggleButton, CustomCheckbox {
10
+ background: $panel-lighten-2;
11
+ }
12
+
13
+ ToggleButton, SelectionList {
14
+ /* Not-selected items */
15
+ & > .toggle--button,
16
+ & > .selection-list--button, & > .selection-list--button-highlighted {
17
+ background: $secondary;
18
+ }
19
+
20
+ /* Selected items */
21
+ &.-on > .toggle--button,
22
+ & > .selection-list--button-selected,
23
+ & > .selection-list--button-selected-highlighted {
24
+ background: $success-muted !important;
25
+ color: $success !important;
26
+ }
27
+ }
28
+
29
+ RadioButton {
30
+ /* Not-selected items */
31
+ & > .toggle--button,
32
+ & > .selection-list--button, & > .selection-list--button-highlighted {
33
+ color: $secondary !important;
34
+ background: $secondary-muted !important;
35
+ }
36
+
37
+ /* Selected items */
38
+ &.-on > .toggle--button,
39
+ & > .selection-list--button-selected,
40
+ & > .selection-list--button-selected-highlighted {
41
+ background: $success-muted !important;
42
+ color: $success !important;
43
+ }
44
+ }
45
+
46
+ Switch {
47
+ & .switch--slider { color: $primary; background: $panel-darken-2 }
48
+ &.-on .switch--slider { color: $success }
49
+ &:hover {
50
+ & > .switch--slider { color: $primary-lighten-2 }
51
+ &.-on > .switch--slider { color: $success-lighten-2 }
52
+ }
53
+ }
54
+
55
+ Switch {
56
+ & .switch--slider { background: $secondary; }
57
+ }
@@ -0,0 +1,24 @@
1
+ from textual.theme import Theme
2
+
3
+ TEXTUAL_THEME = Theme(
4
+ name="classic-black-v2",
5
+ primary="#6D5498",
6
+ secondary="#5B5B5B",
7
+ accent="#A9B7C6",
8
+ foreground="#E5E5E5",
9
+ background="#101113",
10
+ surface="#1E2022",
11
+ panel="#242628",
12
+ boost="#016F60",
13
+ success="#A3C995",
14
+ warning="#E6C384",
15
+ error="#D67B76",
16
+ dark=True,
17
+ variables={
18
+ "block-hover-background": "#4F3D6E",
19
+ "cursor-line-background": "#6D80A6",
20
+ "footer-key-foreground": "#D2D05F",
21
+ "input-cursor-text-style": "reverse",
22
+ "datatable-hover-background": "green",
23
+ }
24
+ )
@@ -0,0 +1,21 @@
1
+ from textual.theme import Theme
2
+
3
+ TEXTUAL_THEME = Theme(
4
+ name="classic-blue",
5
+ primary="#81A1C1",
6
+ secondary="#3A5366",
7
+ accent="#81A1C1",
8
+ foreground="#e9e9e9",
9
+ background="#2E3440",
10
+ success="#A3BE8B",
11
+ warning="#EBCB8B",
12
+ error="#BF616A",
13
+ surface="#3B4252",
14
+ panel="#003768",
15
+ dark=True,
16
+ variables={
17
+ "block-cursor-text-style": "none",
18
+ "footer-key-foreground": "#88C0D0",
19
+ "input-selection-background": "#81a1c1 35%",
20
+ },
21
+ )
@@ -0,0 +1,175 @@
1
+ * {
2
+ scrollbar-background: $panel;
3
+ }
4
+
5
+ .text-area--cursor, .input--cursor {
6
+ color: #80e98c;
7
+ }
8
+
9
+ ToggleButton, CustomCheckbox {
10
+ background: $panel;
11
+ margin: 0;
12
+ }
13
+
14
+ ToggleButton, SelectionList {
15
+ /* Not-selected items */
16
+ & > .toggle--button,
17
+ & > .selection-list--button, & > .selection-list--button-highlighted {
18
+ background: $secondary;
19
+ }
20
+
21
+ /* Selected items */
22
+ &.-on > .toggle--button,
23
+ & > .selection-list--button-selected,
24
+ & > .selection-list--button-selected-highlighted {
25
+ background: $success-muted !important;
26
+ color: $success !important;
27
+ }
28
+ }
29
+
30
+ RadioButton {
31
+ /* Not-selected items */
32
+ & > .toggle--button,
33
+ & > .selection-list--button, & > .selection-list--button-highlighted {
34
+ color: $secondary !important;
35
+ background: $surface-lighten-1 !important;
36
+ }
37
+
38
+ /* Selected items */
39
+ &.-on > .toggle--button,
40
+ & > .selection-list--button-selected,
41
+ & > .selection-list--button-selected-highlighted {
42
+ background: $success-muted !important;
43
+ color: $success !important;
44
+ }
45
+ }
46
+
47
+ Switch {
48
+ margin: 0;
49
+ & .switch--slider { color: $primary; background: $secondary; }
50
+ &.-on .switch--slider { color: $success }
51
+ &:hover {
52
+ & > .switch--slider { color: $primary-lighten-2 }
53
+ &.-on > .switch--slider { color: $success-lighten-2 }
54
+ }
55
+ }
56
+
57
+ CustomCheckbox {
58
+ margin: 0;
59
+ }
60
+
61
+ Label.section-title {
62
+ # margin: 0 1 0 1;
63
+ }
64
+
65
+ Container.section {
66
+ background: $background-lighten-1;
67
+ border: none;
68
+ margin: 1 1 0 1;
69
+ padding: 1;
70
+ }
71
+
72
+ Button {
73
+ border: hidden;
74
+ padding: 0;
75
+ margin: 1;
76
+ height: auto;
77
+ }
78
+
79
+ Input, Select {
80
+ background: $surface;
81
+ border: hidden;
82
+ padding: 0;
83
+ margin: 0;
84
+ height: auto;
85
+ }
86
+
87
+ TextArea, RadioSet, SelectionList, CustomSelectionList {
88
+ background: $surface;
89
+ border: hidden;
90
+ padding: 0;
91
+ margin: 0;
92
+ height: 3;
93
+ }
94
+
95
+ RadioButton {
96
+ background: $surface;
97
+ }
98
+
99
+ Option {
100
+ color: red;
101
+ height: 1;
102
+ padding: 0;
103
+ border: hidden;
104
+ margin: 1;
105
+ }
106
+
107
+ Select SelectCurrent {
108
+ border: none;
109
+ padding: 0;
110
+ margin: 0;
111
+ height: 1;
112
+ }
113
+
114
+ Select SelectOverlay, Select SelectOverlay > .option-list--option {
115
+ border: hidden;
116
+ margin: 0 0 0 0;
117
+ padding: 0;
118
+ }
119
+
120
+ ListView, Tree, TabbedContent, DataTable, Placeholder {
121
+ margin: 0;
122
+ }
123
+
124
+ .example-section ProgressBar {
125
+ margin-bottom: 1;
126
+ }
127
+
128
+ Label.example-spacer {
129
+ display: none;
130
+ }
131
+
132
+ .margin-1 {
133
+ margin: 1;
134
+ }
135
+
136
+ .no-vertical-margin {
137
+ margin-top: 0;
138
+ margin-bottom: 0;
139
+ }
140
+
141
+ .example-input-caption {
142
+ display: block;
143
+ margin: 0 0 0 0;
144
+ }
145
+
146
+ Input.example-input {
147
+ margin: 0 0 1 0;
148
+ }
149
+
150
+ Select.example-input {
151
+ # margin: 0 1 1 1;
152
+ }
153
+
154
+ .example-section Button {
155
+ margin-right: 1;
156
+ }
157
+ .example-section Button:last-of-type {
158
+ margin-right: 0;
159
+ }
160
+
161
+ .example-section Switch, .example-section CustomCheckbox {
162
+ margin: 1 0 0 0 ;
163
+ }
164
+
165
+ .example-section Digits {
166
+ margin: 1 0 0 0;
167
+ }
168
+
169
+ # .example-section Rule {
170
+ # margin: 1 0 0 0;
171
+ # }
172
+
173
+ Static.example {
174
+ margin: 1 0;
175
+ }
@@ -0,0 +1,22 @@
1
+ from textual.theme import Theme
2
+
3
+ TEXTUAL_THEME = Theme(
4
+ name="compact-gray",
5
+ primary="#8BD3CD",
6
+ secondary="#646464",
7
+ accent="#A9B7C6",
8
+ foreground="#E5E5E5",
9
+ background="#151515",
10
+ surface="#3E3E3E",
11
+ panel="#101010",
12
+ boost="#444C5E",
13
+ success="#A3C995",
14
+ warning="#dfd483",
15
+ error="#D67B76",
16
+ dark=True,
17
+ variables={
18
+ "block-hover-background": "#335D48",
19
+ "footer-key-foreground": "#D2D05F",
20
+ "input-cursor-text-style": "reverse",
21
+ }
22
+ )
@@ -0,0 +1,57 @@
1
+ * {
2
+ scrollbar-background: $panel;
3
+ }
4
+
5
+ .text-area--cursor, .input--cursor {
6
+ color: #006aad;
7
+ }
8
+
9
+ ToggleButton, CustomCheckbox {
10
+ background: $panel-lighten-2;
11
+ }
12
+
13
+ ToggleButton, SelectionList {
14
+ /* Not-selected items */
15
+ & > .toggle--button,
16
+ & > .selection-list--button, & > .selection-list--button-highlighted {
17
+ background: $secondary;
18
+ }
19
+
20
+ /* Selected items */
21
+ &.-on > .toggle--button,
22
+ & > .selection-list--button-selected,
23
+ & > .selection-list--button-selected-highlighted {
24
+ background: $secondary !important;
25
+ color: $panel !important;
26
+ }
27
+ }
28
+
29
+ RadioButton {
30
+ /* Not-selected items */
31
+ & > .toggle--button,
32
+ & > .selection-list--button, & > .selection-list--button-highlighted {
33
+ color: $secondary !important;
34
+ background: $secondary-muted !important;
35
+ }
36
+
37
+ /* Selected items */
38
+ &.-on > .toggle--button,
39
+ & > .selection-list--button-selected,
40
+ & > .selection-list--button-selected-highlighted {
41
+ background: $secondary !important;
42
+ color: $panel !important;
43
+ }
44
+ }
45
+
46
+ Switch {
47
+ & .switch--slider { color: $primary; background: $panel-darken-2 }
48
+ &.-on .switch--slider { color: $panel }
49
+ &:hover {
50
+ & > .switch--slider { color: $primary-lighten-2 }
51
+ &.-on > .switch--slider { color: $secondary }
52
+ }
53
+ }
54
+
55
+ Switch {
56
+ & .switch--slider { background: $secondary; }
57
+ }
@@ -0,0 +1,21 @@
1
+ from textual.theme import Theme
2
+
3
+ TEXTUAL_THEME = Theme(
4
+ name="mnml-black",
5
+ primary="#C7C7C7",
6
+ secondary="#5B5B5B",
7
+ accent="#C5C5C5",
8
+ foreground="#E5E5E5",
9
+ background="#1A1A1A",
10
+ surface="#1C1C1C",
11
+ panel="#101112",
12
+ boost="#555555",
13
+ success="#A8C79D",
14
+ warning="#DFC89E",
15
+ error="#D67B76",
16
+ dark=True,
17
+ variables={
18
+ "footer-key-foreground": "#919191",
19
+ "input-cursor-text-style": "reverse",
20
+ }
21
+ )
@@ -0,0 +1,57 @@
1
+ * {
2
+ scrollbar-background: $panel;
3
+ }
4
+
5
+ .text-area--cursor, .input--cursor {
6
+ color: #006aad;
7
+ }
8
+
9
+ ToggleButton, CustomCheckbox {
10
+ background: $panel-lighten-2;
11
+ }
12
+
13
+ ToggleButton, SelectionList {
14
+ /* Not-selected items */
15
+ & > .toggle--button,
16
+ & > .selection-list--button, & > .selection-list--button-highlighted {
17
+ background: $secondary;
18
+ }
19
+
20
+ /* Selected items */
21
+ &.-on > .toggle--button,
22
+ & > .selection-list--button-selected,
23
+ & > .selection-list--button-selected-highlighted {
24
+ background: $secondary !important;
25
+ color: $panel !important;
26
+ }
27
+ }
28
+
29
+ RadioButton {
30
+ /* Not-selected items */
31
+ & > .toggle--button,
32
+ & > .selection-list--button, & > .selection-list--button-highlighted {
33
+ color: $secondary !important;
34
+ background: $secondary-muted !important;
35
+ }
36
+
37
+ /* Selected items */
38
+ &.-on > .toggle--button,
39
+ & > .selection-list--button-selected,
40
+ & > .selection-list--button-selected-highlighted {
41
+ background: $secondary !important;
42
+ color: $panel !important;
43
+ }
44
+ }
45
+
46
+ Switch {
47
+ & .switch--slider { color: $primary; background: $panel-darken-2 }
48
+ &.-on .switch--slider { color: $panel }
49
+ &:hover {
50
+ & > .switch--slider { color: $primary-lighten-2 }
51
+ &.-on > .switch--slider { color: $secondary }
52
+ }
53
+ }
54
+
55
+ Switch {
56
+ & .switch--slider { background: $secondary; }
57
+ }
@@ -0,0 +1,21 @@
1
+ from textual.theme import Theme
2
+
3
+ TEXTUAL_THEME = Theme(
4
+ name="mnml-deepblack",
5
+ primary="#C7C7C7",
6
+ secondary="#5B5B5B",
7
+ accent="#C5C5C5",
8
+ foreground="#E5E5E5",
9
+ background="#000000",
10
+ surface="#1C1C1C",
11
+ panel="#101112",
12
+ boost="#555555",
13
+ success="#50CE23",
14
+ warning="#f4e144",
15
+ error="#DF372F",
16
+ dark=True,
17
+ variables={
18
+ "footer-key-foreground": "#949494",
19
+ "input-cursor-text-style": "reverse",
20
+ }
21
+ )
@@ -0,0 +1,18 @@
1
+ from textual.theme import Theme
2
+
3
+ TEXTUAL_THEME = Theme(
4
+ name="pure-amber",
5
+ primary="#6B3200",
6
+ secondary="#734819",
7
+ accent="#F6BC29",
8
+ foreground="#FFB72D",
9
+ background="#291B0C",
10
+ surface="#554300",
11
+ panel="#1B1208",
12
+ success="#40FF76",
13
+ warning="#FFEE58",
14
+ error="#FF5252",
15
+ dark=True,
16
+ variables={
17
+ }
18
+ )
@@ -0,0 +1,18 @@
1
+ from textual.theme import Theme
2
+
3
+ TEXTUAL_THEME = Theme(
4
+ name="pure-black",
5
+ primary="#EF4FF7",
6
+ secondary="#8AFF82",
7
+ accent="#30F629",
8
+ foreground="#B3E5FC",
9
+ background="#000000",
10
+ surface="#085500",
11
+ panel="#083300",
12
+ success="#40FF76",
13
+ warning="#FFEE58",
14
+ error="#FF5252",
15
+ dark=True,
16
+ variables={
17
+ }
18
+ )
@@ -0,0 +1,18 @@
1
+ from textual.theme import Theme
2
+
3
+ TEXTUAL_THEME = Theme(
4
+ name="pure-blue",
5
+ primary="#4FC3F7",
6
+ secondary="#82B1FF",
7
+ accent="#29B6F6",
8
+ foreground="#B3E5FC",
9
+ background="#001F3F",
10
+ surface="#002B55",
11
+ panel="#001933",
12
+ success="#40FF76",
13
+ warning="#FFEE58",
14
+ error="#FF5252",
15
+ dark=True,
16
+ variables={
17
+ }
18
+ )
@@ -0,0 +1,18 @@
1
+ from textual.theme import Theme
2
+
3
+ TEXTUAL_THEME = Theme(
4
+ name="pure-green",
5
+ primary="#EF4FF7",
6
+ secondary="#8AFF82",
7
+ accent="#30F629",
8
+ foreground="#B3E5FC",
9
+ background="#003F0F",
10
+ surface="#085500",
11
+ panel="#083300",
12
+ success="#40FF76",
13
+ warning="#FFEE58",
14
+ error="#FF5252",
15
+ dark=True,
16
+ variables={
17
+ }
18
+ )
@@ -0,0 +1,20 @@
1
+ from textual.theme import Theme
2
+
3
+ # https://userpage.fu-berlin.de/mirjamk/htmlkurs/16farben.html
4
+ TEXTUAL_THEME = Theme(
5
+ name="pure-sweet16",
6
+ primary="black",
7
+ secondary="aqua",
8
+ accent="lime",
9
+ foreground="white",
10
+ background="navy",
11
+ surface="purple",
12
+ panel="black",
13
+ success="lime",
14
+ warning="yellow",
15
+ error="red",
16
+ dark=True,
17
+ variables={
18
+ "footer-key-foreground": "yellow",
19
+ }
20
+ )
@@ -0,0 +1,18 @@
1
+ from textual.theme import Theme
2
+
3
+ TEXTUAL_THEME = Theme(
4
+ name="xplore-black",
5
+ primary="#4C4C4C",
6
+ secondary="#b5a24d",
7
+ accent="#9684D8",
8
+ foreground="#e6e6e6",
9
+ background="#0f0f0f",
10
+ surface="#1b1b1b",
11
+ panel="#121212",
12
+ success="#a3be8c",
13
+ warning="#ebcb8b",
14
+ error="#bf616a",
15
+ dark=True,
16
+ variables={
17
+ }
18
+ )
@@ -0,0 +1,18 @@
1
+ from textual.theme import Theme
2
+
3
+ TEXTUAL_THEME = Theme(
4
+ name="xplore-blue",
5
+ primary="#0178D4",
6
+ secondary="#004578",
7
+ accent="#ffa62b",
8
+ foreground="#e9e9e9",
9
+ background="#121212",
10
+ success="#82E76E",
11
+ warning="#fcb552",
12
+ error="#ba3c5b",
13
+ surface="#213140",
14
+ panel="#003768",
15
+ dark=True,
16
+ variables={
17
+ }
18
+ )
@@ -0,0 +1,18 @@
1
+ from textual.theme import Theme
2
+
3
+ TEXTUAL_THEME = Theme(
4
+ name="xplore-blue-muted",
5
+ primary="#9BC3FF",
6
+ secondary="#004578",
7
+ accent="#e19f61",
8
+ foreground="#e9e9e9",
9
+ background="#121212",
10
+ success="#82E76E",
11
+ warning="#fcb552",
12
+ error="#ba3c5b",
13
+ surface="#2D4357",
14
+ panel="#033867",
15
+ dark=True,
16
+ variables={
17
+ }
18
+ )
@@ -0,0 +1,18 @@
1
+ from textual.theme import Theme
2
+
3
+ TEXTUAL_THEME = Theme(
4
+ name="xplore-teal",
5
+ primary="#7e568b",
6
+ secondary="#4a6965",
7
+ accent="#80cbc1",
8
+ foreground="#e9e9e9",
9
+ background="#1d1f21",
10
+ success="#A3D26E",
11
+ warning="#f0c674",
12
+ error="#CC6666",
13
+ surface="#3e5465",
14
+ panel="#2C353F",
15
+ dark=True,
16
+ variables={
17
+ }
18
+ )
@@ -0,0 +1,10 @@
1
+ """General utilities: dates, strings, indices and logging."""
2
+
3
+ from .datetime import *
4
+ from .debug import *
5
+ from .index import *
6
+ from .logger import *
7
+ from .singleton import *
8
+ from .string import *
9
+ from .validation import *
10
+ from .version import *