listpick 0.1.14.1__tar.gz → 0.1.14.2__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.
Files changed (46) hide show
  1. {listpick-0.1.14.1 → listpick-0.1.14.2}/CHANGELOG.md +2 -0
  2. {listpick-0.1.14.1/src/listpick.egg-info → listpick-0.1.14.2}/PKG-INFO +1 -1
  3. {listpick-0.1.14.1 → listpick-0.1.14.2}/setup.py +1 -1
  4. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick/listpick_app.py +68 -51
  5. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick/ui/build_help.py +3 -0
  6. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick/ui/keys.py +4 -2
  7. {listpick-0.1.14.1 → listpick-0.1.14.2/src/listpick.egg-info}/PKG-INFO +1 -1
  8. {listpick-0.1.14.1 → listpick-0.1.14.2}/.gitignore +0 -0
  9. {listpick-0.1.14.1 → listpick-0.1.14.2}/LICENSE.txt +0 -0
  10. {listpick-0.1.14.1 → listpick-0.1.14.2}/README.md +0 -0
  11. {listpick-0.1.14.1 → listpick-0.1.14.2}/TODO.md +0 -0
  12. {listpick-0.1.14.1 → listpick-0.1.14.2}/assets/aria2tui_screenshot.png +0 -0
  13. {listpick-0.1.14.1 → listpick-0.1.14.2}/assets/file_compare.png +0 -0
  14. {listpick-0.1.14.1 → listpick-0.1.14.2}/assets/lpfman.png +0 -0
  15. {listpick-0.1.14.1 → listpick-0.1.14.2}/listpick.py +0 -0
  16. {listpick-0.1.14.1 → listpick-0.1.14.2}/requirements.txt +0 -0
  17. {listpick-0.1.14.1 → listpick-0.1.14.2}/setup.cfg +0 -0
  18. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick/__init__.py +0 -0
  19. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick/__main__.py +0 -0
  20. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick/ui/__init__.py +0 -0
  21. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick/ui/footer.py +0 -0
  22. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick/ui/help_screen.py +0 -0
  23. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick/ui/input_field.py +0 -0
  24. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick/ui/pane_stuff.py +0 -0
  25. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick/ui/picker_colours.py +0 -0
  26. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick/utils/__init__.py +0 -0
  27. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick/utils/clipboard_operations.py +0 -0
  28. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick/utils/config.py +0 -0
  29. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick/utils/dump.py +0 -0
  30. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick/utils/filtering.py +0 -0
  31. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick/utils/generate_data.py +0 -0
  32. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick/utils/options_selectors.py +0 -0
  33. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick/utils/paste_operations.py +0 -0
  34. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick/utils/picker_log.py +0 -0
  35. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick/utils/search_and_filter_utils.py +0 -0
  36. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick/utils/searching.py +0 -0
  37. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick/utils/sorting.py +0 -0
  38. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick/utils/table_to_list_of_lists.py +0 -0
  39. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick/utils/utils.py +0 -0
  40. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick.egg-info/SOURCES.txt +0 -0
  41. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick.egg-info/dependency_links.txt +0 -0
  42. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick.egg-info/entry_points.txt +0 -0
  43. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick.egg-info/requires.txt +0 -0
  44. {listpick-0.1.14.1 → listpick-0.1.14.2}/src/listpick.egg-info/top_level.txt +0 -0
  45. {listpick-0.1.14.1 → listpick-0.1.14.2}/tests/kitty_control.sh +0 -0
  46. {listpick-0.1.14.1 → listpick-0.1.14.2}/tests/sorting_dates.csv +0 -0
@@ -3,6 +3,8 @@ Note that the changes between 0.1.11.0 and 1.1.12.0 are listed under 0.1.11
3
3
 
4
4
  ## [0.1.15] 2025-??-??
5
5
  - Added info screen to display all information on the running Picker.
6
+ - Added keys for file_next and file_prev
7
+ - Added __sizeof__() function for the Picker class.
6
8
 
7
9
  ## [0.1.14] 2025-08-20
8
10
  - Fixed bug when cells are centred vertically.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: listpick
3
- Version: 0.1.14.1
3
+ Version: 0.1.14.2
4
4
  Summary: Listpick is a powerful TUI data tool for creating TUI apps or viewing/comparing tabulated data.
5
5
  Home-page: https://github.com/grimandgreedy/listpick
6
6
  Author: Grim
@@ -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.14.1",
19
+ version = "0.1.14.2",
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.",
@@ -1489,46 +1489,18 @@ class Picker:
1489
1489
  elif setting == "unicode":
1490
1490
  self.unicode_char_width = not self.unicode_char_width
1491
1491
  elif setting == "file_next":
1492
- if len(self.loaded_files) > 1:
1493
- self.command_stack.append(Command("setting", self.user_settings))
1494
- # Cache file state
1495
- self.loaded_file_states[self.loaded_file_index] = self.get_function_data()
1496
-
1497
- self.loaded_file_index = (self.loaded_file_index + 1) % len(self.loaded_files)
1498
- self.loaded_file = self.loaded_files[self.loaded_file_index]
1499
-
1500
- # If we already have a loaded state for this file
1501
- if self.loaded_file_states[self.loaded_file_index]:
1502
- self.set_function_data(self.loaded_file_states[self.loaded_file_index])
1503
- else:
1504
- self.set_function_data({}, reset_absent_variables=True)
1505
- self.load_file(self.loaded_file)
1492
+ self.command_stack.append(Command("setting", self.user_settings))
1493
+ self.switch_file(increment=1)
1494
+ elif setting == "file_prev":
1495
+ self.command_stack.append(Command("setting", self.user_settings))
1496
+ self.switch_file(increment=-1)
1506
1497
 
1507
1498
  elif setting == "sheet_next":
1508
- if not os.path.exists(self.loaded_file):
1509
- self.notification(self.stdscr, message=f"File {repr(self.loaded_file)} not found.")
1510
- return None
1511
- if len(self.sheets) > 1:
1512
- self.command_stack.append(Command("setting", self.user_settings))
1513
-
1514
- # Cache sheet state
1515
- self.sheet_states[self.sheet_index] = self.get_function_data()
1516
- self.sheet_index = (self.sheet_index + 1) % len(self.sheets)
1517
- self.sheet_name = self.sheets[self.sheet_index]
1518
-
1519
- # If we already have a loaded state for this file
1520
- if self.sheet_states[self.sheet_index]:
1521
- self.set_function_data(self.sheet_states[self.sheet_index])
1522
- else:
1523
- function_data = {
1524
- "sheet_index": self.sheet_index,
1525
- "sheet_name": self.sheet_name,
1526
- "sheet_states":self.sheet_states,
1527
- "sheets": self.sheets,
1528
- }
1529
- self.set_function_data(function_data, reset_absent_variables=True)
1530
- self.load_sheet(self.loaded_file, sheet_number=self.sheet_index)
1531
-
1499
+ self.command_stack.append(Command("setting", self.user_settings))
1500
+ self.switch_sheet(increment=1)
1501
+ elif setting == "sheet_prev":
1502
+ self.command_stack.append(Command("setting", self.user_settings))
1503
+ self.switch_sheet(increment=-1)
1532
1504
 
1533
1505
  elif setting.startswith("ft"):
1534
1506
  if len(setting) > 2 and setting[2:].isnumeric():
@@ -2099,7 +2071,50 @@ class Picker:
2099
2071
 
2100
2072
  self.initialise_variables()
2101
2073
 
2074
+ def switch_file(self, increment=1) -> None:
2075
+ """ Go to the next file. """
2076
+ if len(self.loaded_files) <= 1:
2077
+ return None
2078
+
2079
+ # Cache file state
2080
+ self.loaded_file_states[self.loaded_file_index] = self.get_function_data()
2081
+
2082
+ self.loaded_file_index = (self.loaded_file_index + increment) % len(self.loaded_files)
2083
+ self.loaded_file = self.loaded_files[self.loaded_file_index]
2084
+
2085
+ # If we already have a loaded state for this file
2086
+ if self.loaded_file_states[self.loaded_file_index]:
2087
+ self.set_function_data(self.loaded_file_states[self.loaded_file_index])
2088
+ else:
2089
+ self.set_function_data({}, reset_absent_variables=True)
2090
+ self.load_file(self.loaded_file)
2091
+
2092
+
2093
+ def switch_sheet(self, increment=1) -> None:
2094
+ if not os.path.exists(self.loaded_file):
2095
+ self.notification(self.stdscr, message=f"File {repr(self.loaded_file)} not found.")
2096
+ return None
2097
+ if len(self.sheets) <= 1:
2098
+ return None
2099
+
2100
+ # Cache sheet state
2101
+ self.sheet_states[self.sheet_index] = self.get_function_data()
2102
2102
 
2103
+ self.sheet_index = (self.sheet_index + increment) % len(self.sheets)
2104
+ self.sheet_name = self.sheets[self.sheet_index]
2105
+
2106
+ # If we already have a loaded state for this file
2107
+ if self.sheet_states[self.sheet_index]:
2108
+ self.set_function_data(self.sheet_states[self.sheet_index])
2109
+ else:
2110
+ function_data = {
2111
+ "sheet_index": self.sheet_index,
2112
+ "sheet_name": self.sheet_name,
2113
+ "sheet_states":self.sheet_states,
2114
+ "sheets": self.sheets,
2115
+ }
2116
+ self.set_function_data(function_data, reset_absent_variables=True)
2117
+ self.load_sheet(self.loaded_file, sheet_number=self.sheet_index)
2103
2118
 
2104
2119
 
2105
2120
 
@@ -2293,13 +2308,15 @@ class Picker:
2293
2308
  ]
2294
2309
 
2295
2310
  data = self.get_function_data()
2296
- del data["indexed_items"]
2297
- del data["selections"]
2298
- del data["selected_cells_by_row"]
2299
- del data["cell_selections"]
2300
- del data["items"]
2301
- del data["require_option"]
2302
- del data["option_functions"]
2311
+ data["indexed_items"] = f"[...] length = {len(data['indexed_items'])}"
2312
+ data["selections"] = f"[...] length = {len(data['selections'])}"
2313
+ data["selected_cells_by_row"] = f"[...] length = {len(data['selected_cells_by_row'])}"
2314
+ data["cell_selections"] = f"[...] length = {len(data['cell_selections'])}"
2315
+ data["items"] = f"[...] length = {len(data['items'])}"
2316
+ data["require_option"] = f"[...] length = {len(data['require_option'])}"
2317
+ data["option_functions"] = f"[...] length = {len(data['option_functions'])}"
2318
+ data["loaded_file_states"] = f"[...] length = {len(data['loaded_file_states'])}"
2319
+ data["sheet_states"] = f"[...] length = {len(data['sheet_states'])}"
2303
2320
  info_items += [
2304
2321
  ["",""],
2305
2322
  [" get_function_data():", "-*"*30],
@@ -2405,6 +2422,10 @@ class Picker:
2405
2422
  options += [["rh", "Toggle row header"]]
2406
2423
  options += [["modes", "Toggle modes"]]
2407
2424
  options += [["ft", "Cycle through footer styles (accepts ft#)"]]
2425
+ options += [["file_next", "Go to the next open file."]]
2426
+ options += [["file_prev", "Go to the previous open file."]]
2427
+ options += [["sheet_next", "Go to the next sheet."]]
2428
+ options += [["sheet_prev", "Go to the previous sheet."]]
2408
2429
  options += [["unicode", "Toggle b/w using len and wcwidth to calculate char width."]]
2409
2430
  options += [[f"s{i}", f"Select col. {i}"] for i in range(len(self.items[0]))]
2410
2431
  options += [[f"!{i}", f"Toggle col. {i}"] for i in range(len(self.items[0]))]
@@ -3031,14 +3052,10 @@ class Picker:
3031
3052
  # Re-sort self.items after applying filter
3032
3053
  sort_items(self.indexed_items, sort_method=self.columns_sort_method[self.sort_column], sort_column=self.sort_column, sort_reverse=self.sort_reverse[self.sort_column]) # Re-sort self.items based on new column
3033
3054
  elif self.check_key("file_next", key, self.keys_dict):
3034
- if len(self.loaded_files):
3035
- self.loaded_file_index = (self.loaded_file_index + 1) % len(self.loaded_files)
3036
- self.loaded_file = self.loaded_files[self.loaded_file_index]
3055
+ self.switch_file(increment=1)
3037
3056
 
3038
3057
  elif self.check_key("file_prev", key, self.keys_dict):
3039
- if len(self.loaded_files):
3040
- self.loaded_file_index = (self.loaded_file_index - 1) % len(self.loaded_files)
3041
- self.loaded_file = self.loaded_files[self.loaded_file_index]
3058
+ self.switch_file(increment=-1)
3042
3059
 
3043
3060
  elif self.check_key("pipe_input", key, self.keys_dict):
3044
3061
  self.logger.info(f"key_function pipe_input")
@@ -116,6 +116,9 @@ def build_help_rows(keys_dict: dict) -> list[list[str]]:
116
116
  "add_row_before": "Insert row before cursor.",
117
117
  "add_column_after": "Insert column after cursor.",
118
118
  "add_row_after": "Insert row after cursor.",
119
+ "info": "Display info screen.",
120
+ "file_next": "Go to the next open file.",
121
+ "file_prev": "Go to the previous open file.",
119
122
  }
120
123
  sections = {
121
124
  "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" ],
@@ -15,8 +15,8 @@ picker_keys = {
15
15
  "help": [ord('?')],
16
16
  "exit": [ord('q')],
17
17
  "full_exit": [3], # Ctrl+c
18
- "move_column_left": [ord('{')],
19
- "move_column_right": [ord('}')],
18
+ # "move_column_left": [ord('{')],
19
+ # "move_column_right": [ord('}')],
20
20
  "cursor_down": [ord('j'), curses.KEY_DOWN],
21
21
  "cursor_up": [ord('k'), curses.KEY_UP],
22
22
  "half_page_up": [ord('u')],
@@ -81,6 +81,8 @@ picker_keys = {
81
81
  # "add_row_before": [ord('=')],
82
82
  "add_row_after": [ord('=')],
83
83
  "info": [ord('i')],
84
+ "file_next": [ord('}')],
85
+ "file_prev": [ord('{')],
84
86
  }
85
87
 
86
88
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: listpick
3
- Version: 0.1.14.1
3
+ Version: 0.1.14.2
4
4
  Summary: Listpick is a powerful TUI data tool for creating TUI apps or viewing/comparing tabulated data.
5
5
  Home-page: https://github.com/grimandgreedy/listpick
6
6
  Author: Grim
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes