listpick 0.1.14.10__py3-none-any.whl → 0.1.14.12__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.
Potentially problematic release.
This version of listpick might be problematic. Click here for more details.
- listpick/listpick_app.py +3 -8
- listpick/ui/build_help.py +63 -28
- listpick/ui/footer.py +3 -0
- listpick/ui/picker_colours.py +5 -0
- {listpick-0.1.14.10.dist-info → listpick-0.1.14.12.dist-info}/METADATA +1 -1
- {listpick-0.1.14.10.dist-info → listpick-0.1.14.12.dist-info}/RECORD +10 -10
- {listpick-0.1.14.10.dist-info → listpick-0.1.14.12.dist-info}/WHEEL +0 -0
- {listpick-0.1.14.10.dist-info → listpick-0.1.14.12.dist-info}/entry_points.txt +0 -0
- {listpick-0.1.14.10.dist-info → listpick-0.1.14.12.dist-info}/licenses/LICENSE.txt +0 -0
- {listpick-0.1.14.10.dist-info → listpick-0.1.14.12.dist-info}/top_level.txt +0 -0
listpick/listpick_app.py
CHANGED
|
@@ -188,7 +188,6 @@ class Picker:
|
|
|
188
188
|
sheet_index = 0,
|
|
189
189
|
sheet_states = [{}],
|
|
190
190
|
|
|
191
|
-
redraw_screen_accessory: Callable = lambda : None,
|
|
192
191
|
|
|
193
192
|
):
|
|
194
193
|
self.stdscr = stdscr
|
|
@@ -338,7 +337,6 @@ class Picker:
|
|
|
338
337
|
self.sheet_states = sheet_states
|
|
339
338
|
self.sheets = sheets
|
|
340
339
|
|
|
341
|
-
self.redraw_screen_accessory = redraw_screen_accessory
|
|
342
340
|
self.initialise_picker_state(reset_colours=self.reset_colours)
|
|
343
341
|
|
|
344
342
|
# Note: We have to set the footer after initialising the picker state so that the footer can use the get_function_data method
|
|
@@ -453,7 +451,7 @@ class Picker:
|
|
|
453
451
|
if reset_colours:
|
|
454
452
|
global COLOURS_SET
|
|
455
453
|
COLOURS_SET = False
|
|
456
|
-
colours_end = set_colours(pick=self.colour_theme_number, start=self.colours_start)
|
|
454
|
+
self.colours_end = set_colours(pick=self.colour_theme_number, start=self.colours_start)
|
|
457
455
|
if curses.COLORS >= 255 and curses.COLOR_PAIRS >= 150:
|
|
458
456
|
self.colours_start = self.colours_start
|
|
459
457
|
self.notification_colours_start = self.colours_start+50
|
|
@@ -752,7 +750,6 @@ class Picker:
|
|
|
752
750
|
def draw_screen_(self, indexed_items: list[Tuple[int, list[str]]], highlights: list[dict] = [{}], clear: bool = True) -> None:
|
|
753
751
|
""" Draw Picker screen. """
|
|
754
752
|
|
|
755
|
-
self.redraw_screen_accessory()
|
|
756
753
|
self.logger.debug("Draw screen.")
|
|
757
754
|
|
|
758
755
|
if clear:
|
|
@@ -1242,7 +1239,6 @@ class Picker:
|
|
|
1242
1239
|
"sheets": self.sheets,
|
|
1243
1240
|
"sheet_name": self.sheet_name,
|
|
1244
1241
|
"sheet_states": self.sheet_states,
|
|
1245
|
-
"redraw_screen_accessory": self.redraw_screen_accessory,
|
|
1246
1242
|
}
|
|
1247
1243
|
return function_data
|
|
1248
1244
|
|
|
@@ -1277,7 +1273,6 @@ class Picker:
|
|
|
1277
1273
|
"centre_in_terminal_vertical",
|
|
1278
1274
|
"centre_in_cols",
|
|
1279
1275
|
"centre_in_terminal",
|
|
1280
|
-
"redraw_screen_accessory",
|
|
1281
1276
|
]
|
|
1282
1277
|
|
|
1283
1278
|
for var in variables:
|
|
@@ -3452,7 +3447,7 @@ def set_colours(pick: int = 0, start: int = 0) -> Optional[int]:
|
|
|
3452
3447
|
curses.init_pair(start+24, colours['footer_string_fg'], colours['footer_string_bg'])
|
|
3453
3448
|
curses.init_pair(start+25, colours['selected_cell_fg'], colours['selected_cell_bg'])
|
|
3454
3449
|
curses.init_pair(start+26, colours['deselecting_cell_fg'], colours['deselecting_cell_bg'])
|
|
3455
|
-
except:
|
|
3450
|
+
except Exception as e:
|
|
3456
3451
|
pass
|
|
3457
3452
|
COLOURS_SET = True
|
|
3458
3453
|
return start+21
|
|
@@ -3603,7 +3598,7 @@ def main() -> None:
|
|
|
3603
3598
|
except:
|
|
3604
3599
|
pass
|
|
3605
3600
|
|
|
3606
|
-
function_data["colour_theme_number"] = 3
|
|
3601
|
+
# function_data["colour_theme_number"] = 3
|
|
3607
3602
|
# function_data["modes"] = [
|
|
3608
3603
|
# {
|
|
3609
3604
|
# 'filter': '',
|
listpick/ui/build_help.py
CHANGED
|
@@ -7,16 +7,18 @@ Author: GrimAndGreedy
|
|
|
7
7
|
License: MIT
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
-
from listpick.ui.keys import picker_keys
|
|
10
|
+
from listpick.ui.keys import picker_keys, notification_keys
|
|
11
11
|
import curses
|
|
12
12
|
import logging
|
|
13
|
+
from listpick.utils import keycodes
|
|
13
14
|
|
|
14
15
|
logger = logging.getLogger('picker_log')
|
|
15
16
|
|
|
16
|
-
def build_help_rows(keys_dict: dict) -> list[list[str]]:
|
|
17
|
+
def build_help_rows(keys_dict: dict, debug: bool = False) -> list[list[str]]:
|
|
17
18
|
""" Build help rows based on the keys_dict. """
|
|
18
19
|
|
|
19
20
|
logger.info(f"function: build_help_rows() (build_help.py)")
|
|
21
|
+
|
|
20
22
|
## Key names
|
|
21
23
|
special_keys = {
|
|
22
24
|
|
|
@@ -35,16 +37,35 @@ def build_help_rows(keys_dict: dict) -> list[list[str]]:
|
|
|
35
37
|
ord('\n'): "\n",
|
|
36
38
|
curses.KEY_DC: "Delete",
|
|
37
39
|
383: "Shift+Delete",
|
|
40
|
+
ord("\t"): "Tab",
|
|
41
|
+
curses.KEY_BACKSPACE: "Backspace",
|
|
42
|
+
keycodes.META_BS: "Alt+Backspace",
|
|
38
43
|
}
|
|
39
44
|
|
|
40
45
|
# Ctrl + [a-z]
|
|
41
46
|
for i in range(26):
|
|
42
47
|
special_keys[i+1] = f"Ctrl+{chr(ord('a')+i)}"
|
|
48
|
+
if i == 8:
|
|
49
|
+
special_keys[i+1] = f"Tab/Ctrl+{chr(ord('a')+i)}"
|
|
50
|
+
|
|
43
51
|
|
|
44
52
|
# F1-F12
|
|
45
53
|
for i in range(12):
|
|
46
54
|
special_keys[curses.KEY_F1+i] = f"F{i+1}"
|
|
47
55
|
|
|
56
|
+
# Alt+[a-z]
|
|
57
|
+
for i in range(26):
|
|
58
|
+
special_keys[keycodes.META_a +i] = f"Alt+{chr(ord('a')+i)}"
|
|
59
|
+
|
|
60
|
+
# Alt+[A-Z]
|
|
61
|
+
for i in range(26):
|
|
62
|
+
special_keys[keycodes.META_A +i] = f"Alt+{chr(ord('A')+i)}"
|
|
63
|
+
|
|
64
|
+
# Alt+[0-9]
|
|
65
|
+
for i in range(10):
|
|
66
|
+
special_keys[keycodes.META_0] = f"Alt+{i}"
|
|
67
|
+
|
|
68
|
+
|
|
48
69
|
## Key descriptions
|
|
49
70
|
help_descriptions = {
|
|
50
71
|
"refresh": "Refresh the screen.",
|
|
@@ -119,14 +140,16 @@ def build_help_rows(keys_dict: dict) -> list[list[str]]:
|
|
|
119
140
|
"info": "Display info screen.",
|
|
120
141
|
"file_next": "Go to the next open file.",
|
|
121
142
|
"file_prev": "Go to the previous open file.",
|
|
143
|
+
"sheet_next": "Go to the next sheet.",
|
|
144
|
+
"sheet_prev": "Go to the previous sheet.",
|
|
122
145
|
}
|
|
123
146
|
sections = {
|
|
124
147
|
"Navigation:": [ "cursor_down", "cursor_up", "half_page_up", "half_page_down", "page_up", "page_down", "cursor_bottom", "cursor_top", "five_up", "five_down", "scroll_right", "scroll_left", "scroll_far_right", "scroll_far_left" ],
|
|
125
148
|
"Selection:": [ "toggle_select", "select_all", "select_none", "visual_selection_toggle", "visual_deselection_toggle", "enter" ],
|
|
126
149
|
"UI:": [ "toggle_footer", "redraw_screen", "decrease_lines_per_page", "increase_lines_per_page", "increase_column_width", "decrease_column_width", "notification_toggle" ],
|
|
127
150
|
"Sort:": [ "cycle_sort_method", "cycle_sort_method_reverse", "cycle_sort_order", ] ,
|
|
128
|
-
"Data manipulation:": [ "delete", "delete_column", "edit", "edit_picker", "edit_ipython", "
|
|
129
|
-
"Filter and sort:": [ "filter_input", "search_input", "continue_search_forward", "continue_search_backward", ] ,
|
|
151
|
+
"Data manipulation:": [ "delete", "delete_column", "edit", "edit_picker", "edit_ipython", "add_column_before", "add_column_after", "add_row_before", "add_row_after"],
|
|
152
|
+
"Filter and sort:": [ "filter_input", "x", "search_input", "continue_search_forward", "continue_search_backward", ] ,
|
|
130
153
|
"Settings:": [ "settings_input", "settings_options" ],
|
|
131
154
|
"Cancel:": [ "opts_input", "opts_select", "mode_next", "mode_prev", "pipe_input", "reset_opts", "col_select", "col_select_next", "col_select_prev", "col_hide" ],
|
|
132
155
|
"Save, load, copy and paste:": [ "save", "load", "open", "copy", "paste" ],
|
|
@@ -148,36 +171,48 @@ def build_help_rows(keys_dict: dict) -> list[list[str]]:
|
|
|
148
171
|
section_rows = []
|
|
149
172
|
|
|
150
173
|
for operation in section_operations:
|
|
151
|
-
|
|
152
|
-
|
|
174
|
+
keys = []
|
|
175
|
+
if operation in keys_dict:
|
|
176
|
+
for key in keys_dict[operation]:
|
|
177
|
+
if key in special_keys:
|
|
178
|
+
keys.append(special_keys[key])
|
|
179
|
+
else:
|
|
180
|
+
try:
|
|
181
|
+
keys.append(chr(int(key)))
|
|
182
|
+
except Exception as e:
|
|
183
|
+
keys.append(f"keycode={key}")
|
|
184
|
+
if debug: print(f"Error chr({key}): {e}")
|
|
185
|
+
else:
|
|
186
|
+
if debug: print(f"Note that {operation} is not in the keys_dict")
|
|
187
|
+
continue
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
if operation in help_descriptions:
|
|
153
192
|
description = help_descriptions[operation]
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
193
|
+
else:
|
|
194
|
+
if debug: print(f"Operation={operation} has no description.")
|
|
195
|
+
description = "..."
|
|
196
|
+
|
|
197
|
+
row = [f" {str(keys)[1:-1]}", description]
|
|
198
|
+
section_rows.append(row)
|
|
158
199
|
if section_rows:
|
|
159
200
|
items.append([section_name, ""])
|
|
160
201
|
items += section_rows
|
|
161
202
|
items.append(["",""])
|
|
162
203
|
|
|
163
|
-
# [[key_name, key_function_description], ...]
|
|
164
|
-
# for val, keys in keys_dict.items():
|
|
165
|
-
# try:
|
|
166
|
-
# row = [[chr(int(key)) if key not in special_keys else special_keys[key] for key in keys], help_descriptions[val]]
|
|
167
|
-
# items.append(row)
|
|
168
|
-
# except:
|
|
169
|
-
# pass
|
|
170
|
-
|
|
171
204
|
return items
|
|
172
205
|
|
|
173
206
|
if __name__ == "__main__":
|
|
174
|
-
|
|
175
|
-
items = build_help_rows(
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
207
|
+
items = build_help_rows(picker_keys, debug=True)
|
|
208
|
+
items = build_help_rows(notification_keys, debug=True)
|
|
209
|
+
|
|
210
|
+
# from listpick.listpick_app import Picker, start_curses, close_curses
|
|
211
|
+
# stdscr = start_curses()
|
|
212
|
+
# x = Picker(
|
|
213
|
+
# stdscr,
|
|
214
|
+
# items=items
|
|
215
|
+
# )
|
|
216
|
+
# x.run()
|
|
217
|
+
#
|
|
218
|
+
# close_curses(stdscr)
|
listpick/ui/footer.py
CHANGED
listpick/ui/picker_colours.py
CHANGED
|
@@ -67,6 +67,8 @@ def get_colours(pick:int=0) -> Dict[str, int]:
|
|
|
67
67
|
'footer_string_fg': 253,
|
|
68
68
|
'selected_cell_bg': 237,
|
|
69
69
|
'selected_cell_fg': 253,
|
|
70
|
+
'deselecting_cell_bg': 162,
|
|
71
|
+
'deselecting_cell_fg': 253,
|
|
70
72
|
},
|
|
71
73
|
### (1) Black and white
|
|
72
74
|
{
|
|
@@ -286,6 +288,9 @@ def get_colours(pick:int=0) -> Dict[str, int]:
|
|
|
286
288
|
colour["paused_bg"] = colour["background"]
|
|
287
289
|
colour["paused_bg"] = colour["background"]
|
|
288
290
|
# colour["search_bg"] = colour["background"]
|
|
291
|
+
# tmp = colours[0]
|
|
292
|
+
# colours[0] = colours[2]
|
|
293
|
+
# colours[2] = tmp
|
|
289
294
|
if pick > len(colours) - 1:
|
|
290
295
|
return colours[0]
|
|
291
296
|
return colours[pick]
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
listpick/__init__.py,sha256=ExXc97-bibodH--wlwpQivl0zCNR5D1hvpvrf7OBofU,154
|
|
2
2
|
listpick/__main__.py,sha256=wkCjDdqw093W27yWwnlC3nG_sMRKaIad7hHHWy0RBgY,193
|
|
3
|
-
listpick/listpick_app.py,sha256=
|
|
3
|
+
listpick/listpick_app.py,sha256=w0G2R8XW3tM9MnTWITd4G_amoAbgRBIge1cjHi82RLc,187024
|
|
4
4
|
listpick/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
-
listpick/ui/build_help.py,sha256=
|
|
6
|
-
listpick/ui/footer.py,sha256=
|
|
5
|
+
listpick/ui/build_help.py,sha256=3cgthxOOBl9evsgea5gVtIacuwbL68_FmtyWyJK6Re8,10142
|
|
6
|
+
listpick/ui/footer.py,sha256=9oJm95pOCxMEoS7Y-77G3D3dPGK4NnsqPMEAtaOpJco,15087
|
|
7
7
|
listpick/ui/help_screen.py,sha256=zbfGIgb-IXtATpl4_Sx7nPbsnRXZ7eiMYlCKGS9EFmw,5608
|
|
8
8
|
listpick/ui/input_field.py,sha256=ylf3fiLXdAD4pueHWfzIrlwaRb9f5zm8f1UGkEPBxgM,30539
|
|
9
9
|
listpick/ui/keys.py,sha256=7ZhJfsSatpk-jwfXj_FvzgQsQdUoF7JkD5Mniu9XZ0o,13328
|
|
10
10
|
listpick/ui/pane_stuff.py,sha256=7GXa4UnV_7YmBv-baRi5moN51wYcuS4p0odl5C3m0Tc,169
|
|
11
|
-
listpick/ui/picker_colours.py,sha256=
|
|
11
|
+
listpick/ui/picker_colours.py,sha256=KUgcgbfSo3azPMRPtv4mNAdwrP0UFqjNbRYEZXnTF4M,11711
|
|
12
12
|
listpick/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
13
|
listpick/utils/clipboard_operations.py,sha256=ORdNm2kgGbfs51xJSvgJPERgoSmBgT11axuMkvSoP9A,3133
|
|
14
14
|
listpick/utils/config.py,sha256=MEnAZg2Rhfl38XofEIN0uoVAOY7I0ftc79Evk3fOiVw,1654
|
|
@@ -25,9 +25,9 @@ listpick/utils/sorting.py,sha256=WZZiVlVA3Zkcpwji3U5SNFlQ14zVEk3cZJtQirBkecQ,532
|
|
|
25
25
|
listpick/utils/table_to_list_of_lists.py,sha256=XBj7eGBDF15BRME-swnoXyOfZWxXCxrXp0pzsBfcJ5g,12224
|
|
26
26
|
listpick/utils/user_input.py,sha256=oyJZPAwA7UGAclPhdPL44tKnPIVNHWhX-tZEnCdBKC0,4318
|
|
27
27
|
listpick/utils/utils.py,sha256=McOl9uT3jh7l4TIWeSd8ZGjK_e7r0YZF0Gl20yI6fl0,13873
|
|
28
|
-
listpick-0.1.14.
|
|
29
|
-
listpick-0.1.14.
|
|
30
|
-
listpick-0.1.14.
|
|
31
|
-
listpick-0.1.14.
|
|
32
|
-
listpick-0.1.14.
|
|
33
|
-
listpick-0.1.14.
|
|
28
|
+
listpick-0.1.14.12.dist-info/licenses/LICENSE.txt,sha256=2mP-MRHJptADDNE9VInMNg1tE-C6Qv93Z4CCQKrpg9w,1061
|
|
29
|
+
listpick-0.1.14.12.dist-info/METADATA,sha256=96KlF5-CLZlyrw1h1eXDvMmLINB5iLB3WcR8X_-p-Ls,8091
|
|
30
|
+
listpick-0.1.14.12.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
31
|
+
listpick-0.1.14.12.dist-info/entry_points.txt,sha256=-QCf_BKIkUz35Y9nkYpjZWs2Qg0KfRna2PAs5DnF6BE,43
|
|
32
|
+
listpick-0.1.14.12.dist-info/top_level.txt,sha256=5mtsGEz86rz3qQDe0D463gGjAfSp6A3EWg4J4AGYr-Q,9
|
|
33
|
+
listpick-0.1.14.12.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|