listpick 0.1.13.49__tar.gz → 0.1.13.51__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 (56) hide show
  1. {listpick-0.1.13.49/src/listpick.egg-info → listpick-0.1.13.51}/PKG-INFO +1 -1
  2. {listpick-0.1.13.49 → listpick-0.1.13.51}/setup.py +1 -1
  3. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick/listpick_app.py +83 -40
  4. listpick-0.1.13.51/src/listpick/lpapp2.py +3152 -0
  5. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick/utils/utils.py +16 -15
  6. {listpick-0.1.13.49 → listpick-0.1.13.51/src/listpick.egg-info}/PKG-INFO +1 -1
  7. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick.egg-info/SOURCES.txt +1 -0
  8. {listpick-0.1.13.49 → listpick-0.1.13.51}/.gitignore +0 -0
  9. {listpick-0.1.13.49 → listpick-0.1.13.51}/CHANGELOG.md +0 -0
  10. {listpick-0.1.13.49 → listpick-0.1.13.51}/LICENSE.txt +0 -0
  11. {listpick-0.1.13.49 → listpick-0.1.13.51}/README.md +0 -0
  12. {listpick-0.1.13.49 → listpick-0.1.13.51}/TODO.md +0 -0
  13. {listpick-0.1.13.49 → listpick-0.1.13.51}/assets/aria2tui_screenshot.png +0 -0
  14. {listpick-0.1.13.49 → listpick-0.1.13.51}/assets/file_compare.png +0 -0
  15. {listpick-0.1.13.49 → listpick-0.1.13.51}/assets/lpfman.png +0 -0
  16. {listpick-0.1.13.49 → listpick-0.1.13.51}/examples/footer_string_example.py +0 -0
  17. {listpick-0.1.13.49 → listpick-0.1.13.51}/examples/input.toml +0 -0
  18. {listpick-0.1.13.49 → listpick-0.1.13.51}/examples/input.txt +0 -0
  19. {listpick-0.1.13.49 → listpick-0.1.13.51}/examples/list_files.toml +0 -0
  20. {listpick-0.1.13.49 → listpick-0.1.13.51}/examples/list_files_empty.toml +0 -0
  21. {listpick-0.1.13.49 → listpick-0.1.13.51}/examples/picker_example.py +0 -0
  22. {listpick-0.1.13.49 → listpick-0.1.13.51}/examples/setup.cfg +0 -0
  23. {listpick-0.1.13.49 → listpick-0.1.13.51}/examples/template.py +0 -0
  24. {listpick-0.1.13.49 → listpick-0.1.13.51}/examples/video_duplicates.toml +0 -0
  25. {listpick-0.1.13.49 → listpick-0.1.13.51}/listpick.py +0 -0
  26. {listpick-0.1.13.49 → listpick-0.1.13.51}/requirements.txt +0 -0
  27. {listpick-0.1.13.49 → listpick-0.1.13.51}/setup.cfg +0 -0
  28. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick/__init__.py +0 -0
  29. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick/__main__.py +0 -0
  30. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick/ui/__init__.py +0 -0
  31. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick/ui/build_help.py +0 -0
  32. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick/ui/footer.py +0 -0
  33. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick/ui/help_screen.py +0 -0
  34. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick/ui/input_field.py +0 -0
  35. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick/ui/keys.py +0 -0
  36. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick/ui/pane_stuff.py +0 -0
  37. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick/ui/picker_colours.py +0 -0
  38. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick/utils/__init__.py +0 -0
  39. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick/utils/clipboard_operations.py +0 -0
  40. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick/utils/config.py +0 -0
  41. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick/utils/dump.py +0 -0
  42. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick/utils/filtering.py +0 -0
  43. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick/utils/generate_data.py +0 -0
  44. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick/utils/options_selectors.py +0 -0
  45. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick/utils/paste_operations.py +0 -0
  46. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick/utils/picker_log.py +0 -0
  47. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick/utils/search_and_filter_utils.py +0 -0
  48. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick/utils/searching.py +0 -0
  49. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick/utils/sorting.py +0 -0
  50. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick/utils/table_to_list_of_lists.py +0 -0
  51. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick.egg-info/dependency_links.txt +0 -0
  52. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick.egg-info/entry_points.txt +0 -0
  53. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick.egg-info/requires.txt +0 -0
  54. {listpick-0.1.13.49 → listpick-0.1.13.51}/src/listpick.egg-info/top_level.txt +0 -0
  55. {listpick-0.1.13.49 → listpick-0.1.13.51}/tests/kitty_control.sh +0 -0
  56. {listpick-0.1.13.49 → listpick-0.1.13.51}/tests/sorting_dates.csv +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: listpick
3
- Version: 0.1.13.49
3
+ Version: 0.1.13.51
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.13.49",
19
+ version = "0.1.13.51",
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.",
@@ -260,7 +260,6 @@ class Picker:
260
260
  self.unicode_char_width = unicode_char_width
261
261
 
262
262
 
263
-
264
263
  self.colours_start = colours_start
265
264
  self.colours_end = colours_end
266
265
  self.reset_colours = reset_colours
@@ -314,8 +313,6 @@ class Picker:
314
313
  self.debug_level = debug_level
315
314
 
316
315
 
317
-
318
-
319
316
  self.initialise_picker_state(reset_colours=self.reset_colours)
320
317
 
321
318
 
@@ -387,7 +384,6 @@ class Picker:
387
384
  def initialise_picker_state(self, reset_colours=False) -> None:
388
385
  """ Initialise state variables for the picker. These are: debugging and colours. """
389
386
 
390
-
391
387
  if curses.has_colors() and self.colours != None:
392
388
  # raise Exception("Terminal does not support color")
393
389
  curses.start_color()
@@ -477,7 +473,6 @@ class Picker:
477
473
 
478
474
  if len(self.indexed_items) > 0 and len(self.indexed_items) >= self.cursor_pos and len(self.indexed_items[0][1]) >= self.id_column:
479
475
  self.cursor_pos_id = self.indexed_items[self.cursor_pos][1][self.id_column]
480
- self.cursor_pos_prev = self.cursor_pos
481
476
 
482
477
  self.items, self.header = self.refresh_function()
483
478
 
@@ -601,8 +596,8 @@ class Picker:
601
596
  else:
602
597
  self.cursor_pos = 0
603
598
 
604
- if self.display_infobox:
605
- self.infobox_picker = self.infobox(self.stdscr, self.infobox_items, self.infobox_title)
599
+ # if self.display_infobox:
600
+ # self.infobox_picker = self.infobox(self.stdscr, self.infobox_items, self.infobox_title)
606
601
 
607
602
 
608
603
  def move_column(self, direction: int) -> None:
@@ -999,14 +994,17 @@ class Picker:
999
994
 
1000
995
  ## Display infobox
1001
996
  if self.display_infobox:
1002
- # self.stdscr.refresh()
1003
- # self.infobox(self.stdscr, message=self.infobox_items, title=self.infobox_title)
1004
-
1005
- infobox_width, infobox_height = w//2, 3*h//5
1006
- infobox_x, infobox_y = w - (infobox_width + 4), 3
1007
- self.infobox_picker.stdscr.mvwin(infobox_y, infobox_x)
1008
- self.infobox_picker.stdscr.resize(infobox_height, infobox_width)
1009
- self.infobox_picker.run()
997
+ self.infobox(self.stdscr, message=self.infobox_items, title=self.infobox_title)
998
+ # self.stdscr.timeout(2000) # timeout is set to 50 in order to get the infobox to be displayed so here we reset it to 2000
999
+ # if self.display_infobox:
1000
+ # # self.stdscr.refresh()
1001
+ # # self.infobox(self.stdscr, message=self.infobox_items, title=self.infobox_title)
1002
+ #
1003
+ # infobox_width, infobox_height = w//2, 3*h//5
1004
+ # infobox_x, infobox_y = w - (infobox_width + 4), 3
1005
+ # self.infobox_picker.stdscr.mvwin(infobox_y, infobox_x)
1006
+ # self.infobox_picker.stdscr.resize(infobox_height, infobox_width)
1007
+ # self.infobox_picker.run()
1010
1008
  # self.infobox_picker.stdscr.noutrefresh()
1011
1009
  # else:
1012
1010
  # # self.stdscr.noutrefresh()
@@ -1019,7 +1017,50 @@ class Picker:
1019
1017
  # pass
1020
1018
 
1021
1019
 
1022
- def infobox(self, stdscr: curses.window, message: list =[], title: str ="Infobox", colours_end: int = 0, duration: int = 4):
1020
+ # def infobox___(self, stdscr: curses.window, message: list =[], title: str ="Infobox", colours_end: int = 0, duration: int = 4):
1021
+ # """ Display non-interactive infobox window. """
1022
+ #
1023
+ # self.logger.info(f"function: infobox()")
1024
+ # h, w = stdscr.getmaxyx()
1025
+ # notification_width, notification_height = w//2, 3*h//5
1026
+ # message_width = notification_width-5
1027
+ #
1028
+ # notification_x, notification_y = w-(notification_width+4), 3
1029
+ # if not message: message = "!!"
1030
+ # if isinstance(message, str):
1031
+ # submenu_items = [" "+message[i*message_width:(i+1)*message_width] for i in range(len(message)//message_width+1)]
1032
+ # else:
1033
+ # submenu_items = message
1034
+ #
1035
+ # notification_remap_keys = {
1036
+ # curses.KEY_RESIZE: curses.KEY_F5,
1037
+ # 27: ord('q')
1038
+ # }
1039
+ # if len(submenu_items) > notification_height - 2:
1040
+ # submenu_items = submenu_items[:notification_height-3] + [f"{'....':^{notification_width}}"]
1041
+ # # while True:
1042
+ # h, w = stdscr.getmaxyx()
1043
+ #
1044
+ # submenu_win = self.stdscr.derwin(notification_height, notification_width, 3, w - (notification_width+4))
1045
+ # infobox_data = {
1046
+ # "items": submenu_items,
1047
+ # "colours": notification_colours,
1048
+ # "colours_start": self.notification_colours_start,
1049
+ # "disabled_keys": [ord('z'), ord('c')],
1050
+ # "show_footer": False,
1051
+ # "top_gap": 0,
1052
+ # "key_remappings": notification_remap_keys,
1053
+ # "display_only": True,
1054
+ # "hidden_columns": [],
1055
+ # "title": title,
1056
+ # "reset_colours": False,
1057
+ # }
1058
+ # submenu_win.noutrefresh()
1059
+ # OptionPicker = Picker(submenu_win, **infobox_data)
1060
+ # return OptionPicker
1061
+
1062
+
1063
+ def infobox(self, stdscr: curses.window, message: str ="", title: str ="Infobox", colours_end: int = 0, duration: int = 4) -> curses.window:
1023
1064
  """ Display non-interactive infobox window. """
1024
1065
 
1025
1066
  self.logger.info(f"function: infobox()")
@@ -1027,7 +1068,6 @@ class Picker:
1027
1068
  notification_width, notification_height = w//2, 3*h//5
1028
1069
  message_width = notification_width-5
1029
1070
 
1030
- notification_x, notification_y = w-(notification_width+4), 3
1031
1071
  if not message: message = "!!"
1032
1072
  if isinstance(message, str):
1033
1073
  submenu_items = [" "+message[i*message_width:(i+1)*message_width] for i in range(len(message)//message_width+1)]
@@ -1040,27 +1080,29 @@ class Picker:
1040
1080
  }
1041
1081
  if len(submenu_items) > notification_height - 2:
1042
1082
  submenu_items = submenu_items[:notification_height-3] + [f"{'....':^{notification_width}}"]
1043
- # while True:
1044
- h, w = stdscr.getmaxyx()
1083
+ while True:
1084
+ h, w = stdscr.getmaxyx()
1045
1085
 
1046
- submenu_win = self.stdscr.derwin(notification_height, notification_width, 3, w - (notification_width+4))
1047
- infobox_data = {
1048
- "items": submenu_items,
1049
- "colours": notification_colours,
1050
- "colours_start": self.notification_colours_start,
1051
- "disabled_keys": [ord('z'), ord('c')],
1052
- "show_footer": False,
1053
- "top_gap": 0,
1054
- "key_remappings": notification_remap_keys,
1055
- "display_only": True,
1056
- "hidden_columns": [],
1057
- "title": title,
1058
- "reset_colours": False,
1059
- }
1060
- submenu_win.noutrefresh()
1061
- OptionPicker = Picker(submenu_win, **infobox_data)
1062
- return OptionPicker
1086
+ submenu_win = curses.newwin(notification_height, notification_width, 3, w - (notification_width+4))
1087
+ infobox_data = {
1088
+ "items": submenu_items,
1089
+ "colours": notification_colours,
1090
+ "colours_start": self.notification_colours_start,
1091
+ "disabled_keys": [ord('z'), ord('c')],
1092
+ "show_footer": False,
1093
+ "top_gap": 0,
1094
+ "key_remappings": notification_remap_keys,
1095
+ "display_only": True,
1096
+ "hidden_columns": [],
1097
+ "title": title,
1098
+ "reset_colours": False,
1099
+ }
1063
1100
 
1101
+ OptionPicker = Picker(submenu_win, **infobox_data)
1102
+ s, o, f = OptionPicker.run()
1103
+ if o != "refresh": break
1104
+
1105
+ return submenu_win
1064
1106
 
1065
1107
  def get_function_data(self) -> dict:
1066
1108
  self.logger.debug(f"function: get_function_data()")
@@ -1201,6 +1243,7 @@ class Picker:
1201
1243
  self.selections = {i:False for i in range(len(self.indexed_items))}
1202
1244
  self.cursor_pos = min(self.cursor_pos, len(self.indexed_items)-1)
1203
1245
  self.initialise_variables()
1246
+ self.draw_screen(self.indexed_items, self.highlights)
1204
1247
 
1205
1248
 
1206
1249
  def choose_option(
@@ -1713,6 +1756,7 @@ class Picker:
1713
1756
  return None
1714
1757
 
1715
1758
  except:
1759
+ self.draw_screen(self.indexed_items, self.highlights)
1716
1760
  self.notification(self.stdscr, message="Error pasting data.")
1717
1761
  return None
1718
1762
  if type(pasta) == type([]) and len(pasta) > 0 and type(pasta[0]) == type([]):
@@ -1985,6 +2029,7 @@ class Picker:
1985
2029
  initial_time = time.time()
1986
2030
 
1987
2031
  self.draw_screen(self.indexed_items, self.highlights, clear=False)
2032
+
1988
2033
  self.refreshing_data = False
1989
2034
  self.data_ready = False
1990
2035
 
@@ -2175,6 +2220,7 @@ class Picker:
2175
2220
  self.toggle_item(item_index)
2176
2221
 
2177
2222
  self.cell_selections[cell_index] = not self.cell_selections[cell_index]
2223
+ ## Set self.selected_cells_by_row
2178
2224
  # If any cells in the current row are selected
2179
2225
  if row in self.selected_cells_by_row:
2180
2226
  # If the current cell is selected then remove it
@@ -2193,7 +2239,6 @@ class Picker:
2193
2239
  else:
2194
2240
  self.selected_cells_by_row[row] = [col]
2195
2241
 
2196
-
2197
2242
  self.cursor_down()
2198
2243
  elif self.check_key("select_all", key, self.keys_dict): # Select all (m or ctrl-a)
2199
2244
  self.select_all()
@@ -2347,7 +2392,6 @@ class Picker:
2347
2392
  ## Scroll with column select
2348
2393
  rows = self.get_visible_rows()
2349
2394
  self.column_widths = get_column_widths(rows, header=self.header, max_column_width=self.max_column_width, number_columns=self.number_columns, max_total_width=w, unicode_char_width=self.unicode_char_width)
2350
-
2351
2395
  visible_column_widths = [c for i,c in enumerate(self.column_widths) if i not in self.hidden_columns]
2352
2396
  column_set_width = sum(visible_column_widths)+len(self.separator)*len(visible_column_widths)
2353
2397
  start_of_cell = sum(visible_column_widths[:self.selected_column])+len(self.separator)*self.selected_column
@@ -2362,7 +2406,7 @@ class Picker:
2362
2406
  self.leftmost_char = start_of_cell
2363
2407
 
2364
2408
  self.leftmost_char = max(0, min(column_set_width - display_width + 5, self.leftmost_char))
2365
- #
2409
+
2366
2410
  elif self.check_key("scroll_right", key, self.keys_dict):
2367
2411
  self.logger.info(f"key_function scroll_right")
2368
2412
  if len(self.indexed_items):
@@ -2370,7 +2414,6 @@ class Picker:
2370
2414
  if row_width-self.leftmost_char >= w-self.startx:
2371
2415
  self.leftmost_char = self.leftmost_char+5
2372
2416
 
2373
-
2374
2417
  elif self.check_key("scroll_left", key, self.keys_dict):
2375
2418
  self.logger.info(f"key_function scroll_left")
2376
2419
  self.leftmost_char = max(self.leftmost_char-5, 0)