listpick 0.1.14.0__py3-none-any.whl → 0.1.14.1__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.
listpick/listpick_app.py CHANGED
@@ -123,7 +123,7 @@ class Picker:
123
123
 
124
124
  paginate: bool =False,
125
125
  cancel_is_back: bool = False,
126
- mode_index: int =0,
126
+ mode_index: int = 0,
127
127
  modes: list[dict] = [],
128
128
  display_modes: bool =False,
129
129
  require_option: list=[],
@@ -162,10 +162,8 @@ class Picker:
162
162
 
163
163
  startup_notification:str = "",
164
164
 
165
- leftmost_column: int = 0,
166
165
  leftmost_char: int = 0,
167
166
 
168
-
169
167
  history_filter_and_search: list[str] = [],
170
168
  history_opts: list[str] = [],
171
169
  history_settings: list[str] = [],
@@ -299,7 +297,6 @@ class Picker:
299
297
 
300
298
  self.SORT_METHODS = SORT_METHODS
301
299
  self.command_stack = command_stack
302
- self.leftmost_column = leftmost_column
303
300
  self.leftmost_char = leftmost_char
304
301
 
305
302
 
@@ -321,8 +318,6 @@ class Picker:
321
318
  self.history_edits = history_edits
322
319
 
323
320
 
324
-
325
-
326
321
  self.debug = debug
327
322
  self.debug_level = debug_level
328
323
 
@@ -343,9 +338,17 @@ class Picker:
343
338
  # Note: We have to set the footer after initialising the picker state so that the footer can use the get_function_data method
344
339
  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)]
345
340
  self.footer = self.footer_options[self.footer_style]
341
+ self.__version__ = "1.0"
346
342
 
343
+ def __sizeof__(self):
347
344
 
348
-
345
+ size = super().__sizeof__()
346
+
347
+ # Add the size of each attribute directly owned by the object
348
+ for attr_name in dir(self):
349
+ if not attr_name.startswith('__') and not callable(getattr(self, attr_name)):
350
+ size += sys.getsizeof(getattr(self, attr_name))
351
+ return size
349
352
 
350
353
  def calculate_section_sizes(self):
351
354
  """
@@ -1170,7 +1173,6 @@ class Picker:
1170
1173
  "keys_dict": self.keys_dict,
1171
1174
  "cancel_is_back": self.cancel_is_back,
1172
1175
  "paginate": self.paginate,
1173
- "leftmost_column": self.leftmost_column,
1174
1176
  "leftmost_char": self.leftmost_char,
1175
1177
  "history_filter_and_search" : self.history_filter_and_search,
1176
1178
  "history_pipes" : self.history_pipes,
@@ -2227,6 +2229,108 @@ class Picker:
2227
2229
  }
2228
2230
  OptionPicker = Picker(self.stdscr, **help_data)
2229
2231
  s, o, f = OptionPicker.run()
2232
+ self.draw_screen(self.indexed_items, self.highlights)
2233
+
2234
+ if self.check_key("info", key, self.keys_dict):
2235
+ self.logger.info(f"key_function help")
2236
+ self.stdscr.clear()
2237
+ self.stdscr.refresh()
2238
+ import importlib.metadata as metadata
2239
+ version = metadata.version('listpick')
2240
+
2241
+ info_items = [
2242
+ [" Listpick info:", "-*"*30],
2243
+ ["",""],
2244
+ ["listpick version", f"{version}"],
2245
+
2246
+ ["",""],
2247
+ [" Global:", "-*"*30],
2248
+ ["",""],
2249
+ ["current_file", self.loaded_file],
2250
+ ["loaded_files", repr(self.loaded_files)],
2251
+ ["auto_refresh", f"{repr(self.auto_refresh)}"],
2252
+ ["timer", f"{repr(self.timer)}"],
2253
+ ["pin_cursor", f"{repr(self.pin_cursor)}"],
2254
+ ["cwd", f"{os.getcwd()}"],
2255
+ ["Picker memory", f"{format_size(sys.getsizeof(self))}"],
2256
+ ["debug", f"{repr(self.debug)}"],
2257
+ ["debug level", f"{repr(self.debug_level)}"],
2258
+
2259
+ ["",""],
2260
+ [" Current File:", "-*"*30],
2261
+ ["",""],
2262
+ ["row/row count", f"{self.cursor_pos}/{len(self.indexed_items)}"],
2263
+ ["total rows", f"{len(self.items)}"],
2264
+ ["selections", f"{self.selected_cells_by_row}"],
2265
+ ["current_sheet", self.sheet_name],
2266
+ ["sheets", repr(self.sheets)],
2267
+ ["current column/column_count", f"{self.selected_column}/{len(self.column_widths)}"],
2268
+ ["hidden columns", f"{self.hidden_columns}"],
2269
+ ["sort column", f"{self.sort_column}"],
2270
+ ["sort method", f"{self.SORT_METHODS[self.columns_sort_method[self.sort_column]]}"],
2271
+ ["sort order", f"{'Descending' if self.sort_reverse[self.sort_column] else 'Ascending'}"],
2272
+ ["id_column", f"{self.id_column}"],
2273
+
2274
+ ["",""],
2275
+ [" Display options:", "-*"*30],
2276
+ ["",""],
2277
+ ["show_header", str(self.show_header)],
2278
+ ["show_footer", repr(self.show_footer)],
2279
+ ["show_row_header", repr(self.show_row_header)],
2280
+ ["max_column_width", str(self.max_column_width)],
2281
+ ["colour_theme_number", str(self.colour_theme_number)],
2282
+ ["top_gap", str(self.top_gap)],
2283
+ ["highlight_full_row", repr(self.highlight_full_row)],
2284
+ ["cell_cursor", repr(self.cell_cursor)],
2285
+ ["items_per_page", repr(self.items_per_page)],
2286
+ ["paginate", repr(self.paginate)],
2287
+ ["display_modes", repr(self.display_modes)],
2288
+ ["footer_style", repr(self.footer_style)],
2289
+ ["unicode_char_width", repr(self.unicode_char_width)],
2290
+ ["centre_in_terminal", repr(self.centre_in_terminal)],
2291
+ ["centre_in_cols", repr(self.centre_in_cols)],
2292
+ ["centre_in_terminal_vertical", repr(self.centre_in_terminal_vertical)],
2293
+ ]
2294
+
2295
+ 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"]
2303
+ info_items += [
2304
+ ["",""],
2305
+ [" get_function_data():", "-*"*30],
2306
+ ["",""],
2307
+ ["show_header", str(self.show_header)],
2308
+ ]
2309
+ info_items += [[key, repr(value)] for key, value in data.items()]
2310
+ info_header = ["Option", "Value"]
2311
+ info_data = {
2312
+ "items": info_items,
2313
+ "header": info_header,
2314
+ "title": f"{self.title} Info",
2315
+ "colours_start": self.help_colours_start,
2316
+ "colours": help_colours,
2317
+ "show_footer": True,
2318
+ "max_selected": 1,
2319
+ "keys_dict": help_keys,
2320
+ "disabled_keys": [ord('?'), ord('v'), ord('V'), ord('m'), ord('M'), ord('l'), curses.KEY_ENTER, ord('\n')],
2321
+ "highlight_full_row": True,
2322
+ "top_gap": 0,
2323
+ "paginate": self.paginate,
2324
+ "centre_in_terminal": False,
2325
+ "centre_in_terminal_vertical": True,
2326
+ "hidden_columns": [],
2327
+ "reset_colours": False,
2328
+
2329
+ }
2330
+ OptionPicker = Picker(self.stdscr, **info_data)
2331
+ s, o, f = OptionPicker.run()
2332
+
2333
+ self.draw_screen(self.indexed_items, self.highlights)
2230
2334
 
2231
2335
  elif self.check_key("exit", key, self.keys_dict):
2232
2336
  self.stdscr.clear()
@@ -2247,6 +2351,7 @@ class Picker:
2247
2351
  else:
2248
2352
  self.set_function_data({}, reset_absent_variables=True)
2249
2353
  self.load_file(self.loaded_file)
2354
+ self.draw_screen(self.indexed_items, self.highlights)
2250
2355
 
2251
2356
  elif self.check_key("full_exit", key, self.keys_dict):
2252
2357
  close_curses(self.stdscr)
listpick/ui/keys.py CHANGED
@@ -47,8 +47,8 @@ picker_keys = {
47
47
  "search_input": [ord('/')],
48
48
  "settings_input": [ord('`')],
49
49
  "settings_options": [ord('~')],
50
- "continue_search_forward": [ord('n'), ord('i')],
51
- "continue_search_backward": [ord('N'), ord('I')],
50
+ "continue_search_forward": [ord('n')],
51
+ "continue_search_backward": [ord('N')],
52
52
  "cancel": [27], # Escape key
53
53
  "opts_input": [ord(':')],
54
54
  "opts_select": [ord('o')],
@@ -80,6 +80,7 @@ picker_keys = {
80
80
  "add_column_after": [ord('+')],
81
81
  # "add_row_before": [ord('=')],
82
82
  "add_row_after": [ord('=')],
83
+ "info": [ord('i')],
83
84
  }
84
85
 
85
86
 
@@ -106,8 +107,8 @@ help_keys = {
106
107
  "search_input": [ord('/')],
107
108
  "settings_input": [ord('`')],
108
109
  "settings_options": [ord('~')],
109
- "continue_search_forward": [ord('n'), ord('i')],
110
- "continue_search_backward": [ord('N'), ord('I')],
110
+ "continue_search_forward": [ord('n')],
111
+ "continue_search_backward": [ord('N')],
111
112
  "cancel": [27], # Escape key
112
113
  "col_select": [ord('0'), ord('1'), ord('2'), ord('3'), ord('4'), ord('5'), ord('6'), ord('7'), ord('8'), ord('9')],
113
114
  "col_select_next": [ord('>')],
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: listpick
3
- Version: 0.1.14.0
3
+ Version: 0.1.14.1
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
@@ -1,12 +1,12 @@
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=3nGXMVky_jftqWbzSLTkW6GAm0_lCKaJGe_WBTAo5xU,176388
3
+ listpick/listpick_app.py,sha256=-QdN2nv3Aii_vJdt8ROOkL_v-mI2TNQi1q34f5tGAno,181819
4
4
  listpick/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  listpick/ui/build_help.py,sha256=_rVKKrX3HfFJtw-pyeNb2lQWbml4-AAw8sZIUYGn97Y,8731
6
6
  listpick/ui/footer.py,sha256=85sVZ6zvzZXSc0TwgvCHGuzGElp6KwUVzwzF5VQwLyY,14219
7
7
  listpick/ui/help_screen.py,sha256=zbfGIgb-IXtATpl4_Sx7nPbsnRXZ7eiMYlCKGS9EFmw,5608
8
8
  listpick/ui/input_field.py,sha256=eyoWHoApdZybjfXcp7Eth7xwb-C-856ZVnq5j_Q3Ojs,30412
9
- listpick/ui/keys.py,sha256=TzaadgBP_rC7jbp--RFJZDOkHd0EB4K1wToDTiVs6CI,13029
9
+ listpick/ui/keys.py,sha256=8LRO0CqX8tn6LM9irwSK7eA_Go-v0nBDztWtQKPFXUk,13042
10
10
  listpick/ui/pane_stuff.py,sha256=7GXa4UnV_7YmBv-baRi5moN51wYcuS4p0odl5C3m0Tc,169
11
11
  listpick/ui/picker_colours.py,sha256=FLOzvkq83orrN2bL0Mw-6RugWOZyuwUjQCrUFMUnKGY,11563
12
12
  listpick/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -23,9 +23,9 @@ listpick/utils/searching.py,sha256=Xk5UIqamNHL2L90z3ACB_Giqdpi9iRKoAJ6pKaqaD7Q,3
23
23
  listpick/utils/sorting.py,sha256=WZZiVlVA3Zkcpwji3U5SNFlQ14zVEk3cZJtQirBkecQ,5329
24
24
  listpick/utils/table_to_list_of_lists.py,sha256=Ox_4OWtZcFp5XWcItlMqE6_Q27YiJz7M9w23Y9vfzYQ,7604
25
25
  listpick/utils/utils.py,sha256=McOl9uT3jh7l4TIWeSd8ZGjK_e7r0YZF0Gl20yI6fl0,13873
26
- listpick-0.1.14.0.dist-info/licenses/LICENSE.txt,sha256=2mP-MRHJptADDNE9VInMNg1tE-C6Qv93Z4CCQKrpg9w,1061
27
- listpick-0.1.14.0.dist-info/METADATA,sha256=NDlbmPlgFWGV9V3UmkIyhSYXY71kjhp3GKvUkxzOPRE,8090
28
- listpick-0.1.14.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
29
- listpick-0.1.14.0.dist-info/entry_points.txt,sha256=-QCf_BKIkUz35Y9nkYpjZWs2Qg0KfRna2PAs5DnF6BE,43
30
- listpick-0.1.14.0.dist-info/top_level.txt,sha256=5mtsGEz86rz3qQDe0D463gGjAfSp6A3EWg4J4AGYr-Q,9
31
- listpick-0.1.14.0.dist-info/RECORD,,
26
+ listpick-0.1.14.1.dist-info/licenses/LICENSE.txt,sha256=2mP-MRHJptADDNE9VInMNg1tE-C6Qv93Z4CCQKrpg9w,1061
27
+ listpick-0.1.14.1.dist-info/METADATA,sha256=pEzvDtilAXf9X5luuKJXLfL25sHxBiaVAVrirREgt0I,8090
28
+ listpick-0.1.14.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
29
+ listpick-0.1.14.1.dist-info/entry_points.txt,sha256=-QCf_BKIkUz35Y9nkYpjZWs2Qg0KfRna2PAs5DnF6BE,43
30
+ listpick-0.1.14.1.dist-info/top_level.txt,sha256=5mtsGEz86rz3qQDe0D463gGjAfSp6A3EWg4J4AGYr-Q,9
31
+ listpick-0.1.14.1.dist-info/RECORD,,