listpick 0.1.16.9__py3-none-any.whl → 0.1.16.10__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 +41 -8
- {listpick-0.1.16.9.dist-info → listpick-0.1.16.10.dist-info}/METADATA +1 -1
- {listpick-0.1.16.9.dist-info → listpick-0.1.16.10.dist-info}/RECORD +7 -7
- {listpick-0.1.16.9.dist-info → listpick-0.1.16.10.dist-info}/WHEEL +0 -0
- {listpick-0.1.16.9.dist-info → listpick-0.1.16.10.dist-info}/entry_points.txt +0 -0
- {listpick-0.1.16.9.dist-info → listpick-0.1.16.10.dist-info}/licenses/LICENSE.txt +0 -0
- {listpick-0.1.16.9.dist-info → listpick-0.1.16.10.dist-info}/top_level.txt +0 -0
listpick/listpick_app.py
CHANGED
|
@@ -96,6 +96,7 @@ class Picker:
|
|
|
96
96
|
options_list: list[str] = [],
|
|
97
97
|
user_settings : str = "",
|
|
98
98
|
separator : str = " ",
|
|
99
|
+
header_separator : str = " │",
|
|
99
100
|
search_query : str = "",
|
|
100
101
|
search_count : int = 0,
|
|
101
102
|
search_index : int = 0,
|
|
@@ -243,6 +244,7 @@ class Picker:
|
|
|
243
244
|
self.options_list = options_list
|
|
244
245
|
self.user_settings = user_settings
|
|
245
246
|
self.separator = separator
|
|
247
|
+
self.header_separator = header_separator
|
|
246
248
|
self.search_query = search_query
|
|
247
249
|
self.search_count = search_count
|
|
248
250
|
self.search_index = search_index
|
|
@@ -946,7 +948,7 @@ class Picker:
|
|
|
946
948
|
|
|
947
949
|
|
|
948
950
|
header_str += f"{col_str:^{self.column_widths[i]-len(number)}}"
|
|
949
|
-
header_str += self.
|
|
951
|
+
header_str += self.header_separator
|
|
950
952
|
header_str_w = min(self.rows_w-self.left_gutter_width, visible_columns_total_width+1, self.term_w-self.startx)
|
|
951
953
|
|
|
952
954
|
header_str = header_str[self.leftmost_char:]
|
|
@@ -2067,6 +2069,7 @@ class Picker:
|
|
|
2067
2069
|
if self.indexed_items[new_pos][0] in self.unselectable_indices: new_pos+=1
|
|
2068
2070
|
else: break
|
|
2069
2071
|
self.cursor_pos = new_pos
|
|
2072
|
+
self.ensure_no_overscroll()
|
|
2070
2073
|
return True
|
|
2071
2074
|
|
|
2072
2075
|
def cursor_up(self, count=1) -> bool:
|
|
@@ -2080,6 +2083,7 @@ class Picker:
|
|
|
2080
2083
|
elif new_pos in self.unselectable_indices: new_pos -= 1
|
|
2081
2084
|
else: break
|
|
2082
2085
|
self.cursor_pos = new_pos
|
|
2086
|
+
self.ensure_no_overscroll()
|
|
2083
2087
|
return True
|
|
2084
2088
|
|
|
2085
2089
|
def remapped_key(self, key: int, val: int, key_remappings: dict) -> bool:
|
|
@@ -2505,23 +2509,53 @@ class Picker:
|
|
|
2505
2509
|
self.split_right = not self.split_right
|
|
2506
2510
|
if self.right_panes[self.right_pane_index]["data"] in [[], None, {}]:
|
|
2507
2511
|
self.right_panes[self.right_pane_index]["data"] = self.right_panes[self.right_pane_index]["get_data"](self.right_panes[self.right_pane_index]["data"], self.get_function_data())
|
|
2512
|
+
self.ensure_no_overscroll()
|
|
2508
2513
|
|
|
2509
2514
|
def toggle_left_pane(self):
|
|
2510
2515
|
if len(self.left_panes):
|
|
2511
2516
|
self.split_left = not self.split_left
|
|
2512
2517
|
if self.left_panes[self.left_pane_index]["data"] in [[], None, {}]:
|
|
2513
2518
|
self.left_panes[self.left_pane_index]["data"] = self.left_panes[self.left_pane_index]["get_data"](self.left_panes[self.left_pane_index]["data"], self.get_function_data())
|
|
2519
|
+
self.ensure_no_overscroll()
|
|
2514
2520
|
|
|
2515
2521
|
|
|
2516
2522
|
def cycle_right_pane(self, increment=1):
|
|
2517
2523
|
if len(self.right_panes) > 1:
|
|
2518
2524
|
self.right_pane_index = (self.right_pane_index+1)%len(self.right_panes)
|
|
2519
2525
|
self.initial_right_split_time -= self.right_panes[self.right_pane_index]["refresh_time"]
|
|
2526
|
+
self.ensure_no_overscroll()
|
|
2520
2527
|
|
|
2521
2528
|
def cycle_left_pane(self, increment=1):
|
|
2522
2529
|
if len(self.left_panes) > 1:
|
|
2523
2530
|
self.left_pane_index = (self.left_pane_index+1)%len(self.left_panes)
|
|
2524
2531
|
self.initial_left_split_time -= self.left_panes[self.left_pane_index]["refresh_time"]
|
|
2532
|
+
self.ensure_no_overscroll()
|
|
2533
|
+
|
|
2534
|
+
def ensure_no_overscroll(self):
|
|
2535
|
+
"""
|
|
2536
|
+
Ensure that we haven't scrolled past the last column.
|
|
2537
|
+
|
|
2538
|
+
This check should be performed after:
|
|
2539
|
+
- Terminal resize event
|
|
2540
|
+
- Scrolling down - i.e., rows with potentially different widths come into view
|
|
2541
|
+
"""
|
|
2542
|
+
self.calculate_section_sizes()
|
|
2543
|
+
self.get_visible_rows()
|
|
2544
|
+
self.column_widths = get_column_widths(
|
|
2545
|
+
self.visible_rows,
|
|
2546
|
+
header=self.header,
|
|
2547
|
+
max_column_width=self.max_column_width,
|
|
2548
|
+
number_columns=self.number_columns,
|
|
2549
|
+
max_total_width=self.rows_w,
|
|
2550
|
+
unicode_char_width=self.unicode_char_width
|
|
2551
|
+
)
|
|
2552
|
+
|
|
2553
|
+
row_width = sum(self.column_widths) + len(self.separator)*(len(self.column_widths)-1)
|
|
2554
|
+
if row_width - self.leftmost_char < self.rows_w:
|
|
2555
|
+
if row_width <= self.rows_w - self.left_gutter_width:
|
|
2556
|
+
self.leftmost_char = 0
|
|
2557
|
+
else:
|
|
2558
|
+
self.leftmost_char = row_width - (self.rows_w - self.left_gutter_width) + 5
|
|
2525
2559
|
|
|
2526
2560
|
def run(self) -> Tuple[list[int], str, dict]:
|
|
2527
2561
|
""" Run the picker. """
|
|
@@ -2991,6 +3025,7 @@ class Picker:
|
|
|
2991
3025
|
self.selected_cells_by_row[row] = [col]
|
|
2992
3026
|
|
|
2993
3027
|
self.cursor_down()
|
|
3028
|
+
self.ensure_no_overscroll()
|
|
2994
3029
|
elif self.check_key("select_all", key, self.keys_dict): # Select all (m or ctrl-a)
|
|
2995
3030
|
self.select_all()
|
|
2996
3031
|
|
|
@@ -3005,6 +3040,7 @@ class Picker:
|
|
|
3005
3040
|
if new_pos < len(self.indexed_items):
|
|
3006
3041
|
self.cursor_pos = new_pos
|
|
3007
3042
|
|
|
3043
|
+
self.ensure_no_overscroll()
|
|
3008
3044
|
self.draw_screen()
|
|
3009
3045
|
|
|
3010
3046
|
elif self.check_key("cursor_bottom", key, self.keys_dict):
|
|
@@ -3014,6 +3050,7 @@ class Picker:
|
|
|
3014
3050
|
else: break
|
|
3015
3051
|
if new_pos < len(self.items) and new_pos >= 0:
|
|
3016
3052
|
self.cursor_pos = new_pos
|
|
3053
|
+
self.ensure_no_overscroll()
|
|
3017
3054
|
self.draw_screen()
|
|
3018
3055
|
# current_row = items_per_page - 1
|
|
3019
3056
|
# if current_page + 1 == (len(self.indexed_items) + items_per_page - 1) // items_per_page:
|
|
@@ -3138,6 +3175,7 @@ class Picker:
|
|
|
3138
3175
|
self.leftmost_char = end_of_cell - display_width
|
|
3139
3176
|
|
|
3140
3177
|
self.leftmost_char = max(0, min(column_set_width - display_width + 5, self.leftmost_char))
|
|
3178
|
+
self.ensure_no_overscroll()
|
|
3141
3179
|
|
|
3142
3180
|
elif self.check_key("col_select_prev", key, self.keys_dict):
|
|
3143
3181
|
if len(self.items) > 0 and len(self.items[0]) > 0:
|
|
@@ -3166,6 +3204,7 @@ class Picker:
|
|
|
3166
3204
|
self.leftmost_char = start_of_cell
|
|
3167
3205
|
|
|
3168
3206
|
self.leftmost_char = max(0, min(column_set_width - display_width + 5, self.leftmost_char))
|
|
3207
|
+
self.ensure_no_overscroll()
|
|
3169
3208
|
|
|
3170
3209
|
elif self.check_key("scroll_right", key, self.keys_dict):
|
|
3171
3210
|
self.logger.info(f"key_function scroll_right")
|
|
@@ -3317,14 +3356,8 @@ class Picker:
|
|
|
3317
3356
|
elif key == curses.KEY_RESIZE: # Terminal resize signal
|
|
3318
3357
|
|
|
3319
3358
|
self.calculate_section_sizes()
|
|
3320
|
-
self.
|
|
3359
|
+
self.ensure_no_overscroll()
|
|
3321
3360
|
|
|
3322
|
-
row_width = sum(self.column_widths) + len(self.separator)*(len(self.column_widths)-1)
|
|
3323
|
-
if row_width - self.leftmost_char < self.rows_w:
|
|
3324
|
-
if row_width <= self.rows_w - self.left_gutter_width:
|
|
3325
|
-
self.leftmost_char = 0
|
|
3326
|
-
else:
|
|
3327
|
-
self.leftmost_char = row_width - (self.rows_w - self.left_gutter_width) + 5
|
|
3328
3361
|
self.stdscr.clear()
|
|
3329
3362
|
self.stdscr.refresh()
|
|
3330
3363
|
self.draw_screen()
|
|
@@ -1,6 +1,6 @@
|
|
|
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=X8PYkBDVhP137M9w7IQAMz5A9dowh4p6bpWHRj8SNfM,213114
|
|
4
4
|
listpick/pane/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
listpick/pane/get_data.py,sha256=l12mHIb6qoZWIfW5zZZY8K8EqNcyIcRiHgtRaM2CVGs,2735
|
|
6
6
|
listpick/pane/left_pane_functions.py,sha256=SVIW4Ef8uNPBQRk4hL67mEFL3pfgChSFZSMRz06CVzw,5543
|
|
@@ -33,9 +33,9 @@ listpick/utils/sorting.py,sha256=WZZiVlVA3Zkcpwji3U5SNFlQ14zVEk3cZJtQirBkecQ,532
|
|
|
33
33
|
listpick/utils/table_to_list_of_lists.py,sha256=XBj7eGBDF15BRME-swnoXyOfZWxXCxrXp0pzsBfcJ5g,12224
|
|
34
34
|
listpick/utils/user_input.py,sha256=L3ylI7nnuFM_TP1XKwpiKpxUSkNb2W5cr7mJjTmv_6E,4582
|
|
35
35
|
listpick/utils/utils.py,sha256=nsR6orCBQy3rTXrCweq8cV-RzRVU15v3J9NclPeAOJk,13741
|
|
36
|
-
listpick-0.1.16.
|
|
37
|
-
listpick-0.1.16.
|
|
38
|
-
listpick-0.1.16.
|
|
39
|
-
listpick-0.1.16.
|
|
40
|
-
listpick-0.1.16.
|
|
41
|
-
listpick-0.1.16.
|
|
36
|
+
listpick-0.1.16.10.dist-info/licenses/LICENSE.txt,sha256=2mP-MRHJptADDNE9VInMNg1tE-C6Qv93Z4CCQKrpg9w,1061
|
|
37
|
+
listpick-0.1.16.10.dist-info/METADATA,sha256=g830mNna2Vn1PxyeN5DBSgWm8CQP0CPU4le48laOd48,8025
|
|
38
|
+
listpick-0.1.16.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
39
|
+
listpick-0.1.16.10.dist-info/entry_points.txt,sha256=-QCf_BKIkUz35Y9nkYpjZWs2Qg0KfRna2PAs5DnF6BE,43
|
|
40
|
+
listpick-0.1.16.10.dist-info/top_level.txt,sha256=5mtsGEz86rz3qQDe0D463gGjAfSp6A3EWg4J4AGYr-Q,9
|
|
41
|
+
listpick-0.1.16.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|