listpick 0.1.13.26__tar.gz → 0.1.13.28__tar.gz
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.
- {listpick-0.1.13.26/src/listpick.egg-info → listpick-0.1.13.28}/PKG-INFO +1 -1
- {listpick-0.1.13.26 → listpick-0.1.13.28}/setup.py +1 -1
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick/listpick_app.py +13 -21
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick/ui/footer.py +3 -5
- {listpick-0.1.13.26 → listpick-0.1.13.28/src/listpick.egg-info}/PKG-INFO +1 -1
- {listpick-0.1.13.26 → listpick-0.1.13.28}/.gitignore +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/CHANGELOG.md +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/LICENSE.txt +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/README.md +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/TODO.md +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/assets/aria2tui_screenshot.png +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/assets/file_compare.png +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/assets/lpfman.png +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/examples/footer_string_example.py +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/examples/input.toml +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/examples/input.txt +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/examples/list_files.toml +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/examples/list_files_empty.toml +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/examples/picker_example.py +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/examples/setup.cfg +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/examples/template.py +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/examples/video_duplicates.toml +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/listpick.py +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/requirements.txt +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/setup.cfg +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick/__init__.py +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick/__main__.py +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick/ui/__init__.py +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick/ui/build_help.py +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick/ui/help_screen.py +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick/ui/input_field.py +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick/ui/keys.py +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick/ui/pane_stuff.py +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick/ui/picker_colours.py +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick/utils/__init__.py +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick/utils/clipboard_operations.py +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick/utils/config.py +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick/utils/dump.py +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick/utils/filtering.py +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick/utils/generate_data.py +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick/utils/options_selectors.py +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick/utils/paste_operations.py +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick/utils/picker_log.py +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick/utils/search_and_filter_utils.py +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick/utils/searching.py +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick/utils/sorting.py +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick/utils/table_to_list_of_lists.py +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick/utils/utils.py +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick.egg-info/SOURCES.txt +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick.egg-info/dependency_links.txt +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick.egg-info/entry_points.txt +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick.egg-info/requires.txt +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/src/listpick.egg-info/top_level.txt +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/tests/kitty_control.sh +0 -0
- {listpick-0.1.13.26 → listpick-0.1.13.28}/tests/sorting_dates.csv +0 -0
|
@@ -16,7 +16,7 @@ with open("README.md", "r", encoding = "utf-8") as fh:
|
|
|
16
16
|
|
|
17
17
|
setuptools.setup(
|
|
18
18
|
name = "listpick",
|
|
19
|
-
version = "0.1.13.
|
|
19
|
+
version = "0.1.13.28",
|
|
20
20
|
author = "Grim",
|
|
21
21
|
author_email = "grimandgreedy@protonmail.com",
|
|
22
22
|
description = "Listpick is a powerful TUI data tool for creating TUI apps or viewing/comparing tabulated data.",
|
|
@@ -318,6 +318,7 @@ class Picker:
|
|
|
318
318
|
|
|
319
319
|
|
|
320
320
|
# Note: We have to set the footer after initialising the picker state so that the footer can use the get_function_data method
|
|
321
|
+
self.get_function_data()
|
|
321
322
|
self.footer_options = [StandardFooter(self.stdscr, colours_start, self.get_function_data), CompactFooter(self.stdscr, colours_start, self.get_function_data), NoFooter(self.stdscr, colours_start, self.get_function_data)]
|
|
322
323
|
self.footer = self.footer_options[self.footer_style]
|
|
323
324
|
|
|
@@ -661,6 +662,12 @@ class Picker:
|
|
|
661
662
|
self.stdscr.refresh()
|
|
662
663
|
|
|
663
664
|
def draw_screen(self, indexed_items: list[Tuple[int, list[str]]], highlights: list[dict] = [{}], clear: bool = True) -> None:
|
|
665
|
+
try:
|
|
666
|
+
self.draw_screen(self.indexed_items, self.highlights)
|
|
667
|
+
except:
|
|
668
|
+
self.logger.warning(f"draw_screen function error")
|
|
669
|
+
pass
|
|
670
|
+
def draw_screen2(self, indexed_items: list[Tuple[int, list[str]]], highlights: list[dict] = [{}], clear: bool = True) -> None:
|
|
664
671
|
""" Draw Picker screen. """
|
|
665
672
|
self.logger.debug("Draw screen.")
|
|
666
673
|
|
|
@@ -1188,7 +1195,6 @@ class Picker:
|
|
|
1188
1195
|
self.selections = {i:False for i in range(len(self.indexed_items))}
|
|
1189
1196
|
self.cursor_pos = min(self.cursor_pos, len(self.indexed_items)-1)
|
|
1190
1197
|
self.initialise_variables()
|
|
1191
|
-
self.draw_screen(self.indexed_items, self.highlights)
|
|
1192
1198
|
|
|
1193
1199
|
|
|
1194
1200
|
def choose_option(
|
|
@@ -1486,7 +1492,6 @@ class Picker:
|
|
|
1486
1492
|
""" Toggle selection of item at index. """
|
|
1487
1493
|
self.logger.info(f"function: toggle_item()")
|
|
1488
1494
|
self.selections[index] = not self.selections[index]
|
|
1489
|
-
self.draw_screen(self.indexed_items, self.highlights)
|
|
1490
1495
|
|
|
1491
1496
|
def select_all(self) -> None:
|
|
1492
1497
|
""" Select all in indexed_items. """
|
|
@@ -1498,10 +1503,6 @@ class Picker:
|
|
|
1498
1503
|
for row in range(len(self.indexed_items)):
|
|
1499
1504
|
self.selected_cells_by_row[row] = list(range(len(self.indexed_items[row][1])))
|
|
1500
1505
|
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
self.draw_screen(self.indexed_items, self.highlights)
|
|
1504
|
-
|
|
1505
1506
|
def deselect_all(self) -> None:
|
|
1506
1507
|
""" Deselect all items in indexed_items. """
|
|
1507
1508
|
self.logger.info(f"function: deselect_all()")
|
|
@@ -1510,7 +1511,6 @@ class Picker:
|
|
|
1510
1511
|
for i in self.cell_selections.keys():
|
|
1511
1512
|
self.cell_selections[i] = False
|
|
1512
1513
|
self.selected_cells_by_row = {}
|
|
1513
|
-
self.draw_screen(self.indexed_items, self.highlights)
|
|
1514
1514
|
|
|
1515
1515
|
def handle_visual_selection(self, selecting:bool = True) -> None:
|
|
1516
1516
|
""" Toggle visual selection or deselection. """
|
|
@@ -1554,8 +1554,6 @@ class Picker:
|
|
|
1554
1554
|
self.end_selection = -1
|
|
1555
1555
|
self.is_selecting = False
|
|
1556
1556
|
|
|
1557
|
-
self.draw_screen(self.indexed_items, self.highlights)
|
|
1558
|
-
|
|
1559
1557
|
elif self.is_deselecting:
|
|
1560
1558
|
self.end_selection = self.indexed_items[self.cursor_pos][0]
|
|
1561
1559
|
self.end_selection = self.cursor_pos
|
|
@@ -1587,7 +1585,6 @@ class Picker:
|
|
|
1587
1585
|
self.start_selection = -1
|
|
1588
1586
|
self.end_selection = -1
|
|
1589
1587
|
self.is_deselecting = False
|
|
1590
|
-
self.draw_screen(self.indexed_items, self.highlights)
|
|
1591
1588
|
|
|
1592
1589
|
def cursor_down(self, count=1) -> bool:
|
|
1593
1590
|
""" Move cursor down. """
|
|
@@ -1979,7 +1976,10 @@ class Picker:
|
|
|
1979
1976
|
|
|
1980
1977
|
initial_time = time.time()
|
|
1981
1978
|
|
|
1982
|
-
|
|
1979
|
+
try:
|
|
1980
|
+
self.draw_screen(self.indexed_items, self.highlights, clear=False)
|
|
1981
|
+
except:
|
|
1982
|
+
pass
|
|
1983
1983
|
|
|
1984
1984
|
self.refreshing_data = False
|
|
1985
1985
|
self.data_ready = False
|
|
@@ -2015,7 +2015,6 @@ class Picker:
|
|
|
2015
2015
|
self.logger.debug(f"footer_string_auto_refresh")
|
|
2016
2016
|
self.footer_string = self.footer_string_refresh_function()
|
|
2017
2017
|
initial_time_footer = time.time()
|
|
2018
|
-
self.draw_screen(self.indexed_items, self.highlights)
|
|
2019
2018
|
|
|
2020
2019
|
if self.check_key("help", key, self.keys_dict):
|
|
2021
2020
|
self.logger.info(f"key_function help")
|
|
@@ -2474,34 +2473,28 @@ class Picker:
|
|
|
2474
2473
|
if self.max_column_width > 10:
|
|
2475
2474
|
self.max_column_width -= 10
|
|
2476
2475
|
# self.column_widths = get_column_widths(self.items, header=self.header, max_column_width=self.max_column_width, number_columns=self.number_columns, max_total_width=2)
|
|
2477
|
-
self.draw_screen(self.indexed_items, self.highlights)
|
|
2478
2476
|
elif self.check_key("increase_column_width", key, self.keys_dict):
|
|
2479
2477
|
self.logger.info(f"key_function increase_column_width")
|
|
2480
2478
|
if self.max_column_width < 1000:
|
|
2481
2479
|
self.max_column_width += 10
|
|
2482
2480
|
# self.column_widths = get_column_widths(self.items, header=self.header, max_column_width=self.max_column_width, number_columns=self.number_columns, max_total_width=w)
|
|
2483
|
-
self.draw_screen(self.indexed_items, self.highlights)
|
|
2484
2481
|
elif self.check_key("visual_selection_toggle", key, self.keys_dict):
|
|
2485
2482
|
self.logger.info(f"key_function visual_selection_toggle")
|
|
2486
2483
|
self.handle_visual_selection()
|
|
2487
|
-
self.draw_screen(self.indexed_items, self.highlights)
|
|
2488
2484
|
|
|
2489
2485
|
elif self.check_key("visual_deselection_toggle", key, self.keys_dict):
|
|
2490
2486
|
self.logger.info(f"key_function visual_deselection_toggle")
|
|
2491
2487
|
self.handle_visual_selection(selecting=False)
|
|
2492
|
-
self.draw_screen(self.indexed_items, self.highlights)
|
|
2493
2488
|
|
|
2494
2489
|
elif key == curses.KEY_RESIZE: # Terminal resize signal
|
|
2495
2490
|
|
|
2496
2491
|
self.calculate_section_sizes()
|
|
2497
2492
|
self.column_widths = get_column_widths(self.items, header=self.header, max_column_width=self.max_column_width, number_columns=self.number_columns, max_total_width=w)
|
|
2498
2493
|
|
|
2499
|
-
self.draw_screen(self.indexed_items, self.highlights)
|
|
2500
2494
|
|
|
2501
2495
|
|
|
2502
2496
|
elif self.check_key("filter_input", key, self.keys_dict):
|
|
2503
2497
|
self.logger.info(f"key_function filter_input")
|
|
2504
|
-
self.draw_screen(self.indexed_items, self.highlights)
|
|
2505
2498
|
usrtxt = f"{self.filter_query} " if self.filter_query else ""
|
|
2506
2499
|
field_end_f = lambda: self.stdscr.getmaxyx()[1]-38 if self.show_footer else lambda: self.stdscr.getmaxyx()[1]-3
|
|
2507
2500
|
if self.show_footer and self.footer.height >= 2: field_end_f = lambda: self.stdscr.getmaxyx()[1]-38
|
|
@@ -2546,7 +2539,6 @@ class Picker:
|
|
|
2546
2539
|
|
|
2547
2540
|
elif self.check_key("search_input", key, self.keys_dict):
|
|
2548
2541
|
self.logger.info(f"key_function search_input")
|
|
2549
|
-
self.draw_screen(self.indexed_items, self.highlights)
|
|
2550
2542
|
usrtxt = f"{self.search_query} " if self.search_query else ""
|
|
2551
2543
|
field_end_f = lambda: self.stdscr.getmaxyx()[1]-38 if self.show_footer else lambda: self.stdscr.getmaxyx()[1]-3
|
|
2552
2544
|
if self.show_footer and self.footer.height >= 3: field_end_f = lambda: self.stdscr.getmaxyx()[1]-38
|
|
@@ -2654,7 +2646,6 @@ class Picker:
|
|
|
2654
2646
|
# self.mode_index = 0
|
|
2655
2647
|
# self.highlights = [highlight for highlight in self.highlights if "type" not in highlight or highlight["type"] != "search" ]
|
|
2656
2648
|
# continue
|
|
2657
|
-
self.draw_screen(self.indexed_items, self.highlights)
|
|
2658
2649
|
|
|
2659
2650
|
elif self.check_key("opts_input", key, self.keys_dict):
|
|
2660
2651
|
self.logger.info(f"key_function opts_input")
|
|
@@ -2893,7 +2884,7 @@ class Picker:
|
|
|
2893
2884
|
self.stdscr.clear()
|
|
2894
2885
|
self.stdscr.refresh()
|
|
2895
2886
|
self.initialise_variables()
|
|
2896
|
-
self.draw_screen(self.indexed_items, self.highlights)
|
|
2887
|
+
# self.draw_screen(self.indexed_items, self.highlights)
|
|
2897
2888
|
|
|
2898
2889
|
|
|
2899
2890
|
|
|
@@ -3165,6 +3156,7 @@ def main() -> None:
|
|
|
3165
3156
|
function_data["display_infobox"] = True
|
|
3166
3157
|
function_data["infobox_items"] = [["1"], ["2"], ["3"]]
|
|
3167
3158
|
function_data["infobox_title"] = "Title"
|
|
3159
|
+
function_data["footer_string"] = "Title"
|
|
3168
3160
|
|
|
3169
3161
|
|
|
3170
3162
|
# function_data["debug"] = True
|
|
@@ -50,6 +50,9 @@ class StandardFooter(Footer):
|
|
|
50
50
|
def draw(self, h, w):
|
|
51
51
|
state = self.get_state()
|
|
52
52
|
# Fill background
|
|
53
|
+
if "footer_string" in state and state["footer_string"]: self.height = 3
|
|
54
|
+
else: self.height = 2
|
|
55
|
+
|
|
53
56
|
for i in range(self.height):
|
|
54
57
|
self.stdscr.addstr(h-self.height+i, 0, ' '*(w-1), curses.color_pair(self.colours_start+20))
|
|
55
58
|
|
|
@@ -63,19 +66,14 @@ class StandardFooter(Footer):
|
|
|
63
66
|
|
|
64
67
|
picker_info_y = h-3
|
|
65
68
|
sort_info_y = h-2
|
|
66
|
-
self.height = 3
|
|
67
|
-
|
|
68
69
|
else:
|
|
69
70
|
picker_info_y = h-2
|
|
70
71
|
sort_info_y = h-1
|
|
71
|
-
""
|
|
72
72
|
select_mode = "C"
|
|
73
73
|
if state["is_selecting"]: select_mode = "VS"
|
|
74
74
|
elif state["is_deselecting"]: select_mode = "VDS"
|
|
75
75
|
if state["pin_cursor"]: select_mode = f"{select_mode} "
|
|
76
76
|
self.stdscr.addstr(h - 1, w-35, f"{select_mode:>33} ", curses.color_pair(self.colours_start+20))
|
|
77
|
-
self.height = 2
|
|
78
|
-
|
|
79
77
|
|
|
80
78
|
if state["filter_query"]:
|
|
81
79
|
self.stdscr.addstr(h - 2, 2, f" Filter: {state['filter_query']} "[:w-40], curses.color_pair(self.colours_start+20) | curses.A_BOLD)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|