listpick 0.1.14.1__py3-none-any.whl → 0.1.14.3__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 CHANGED
@@ -716,6 +716,9 @@ class Picker:
716
716
  self.stdscr.erase()
717
717
 
718
718
  h, w = self.stdscr.getmaxyx()
719
+ # The height of the footer may need to be adjusted if the file changes.
720
+ self.footer.adjust_sizes(h,w)
721
+ self.calculate_section_sizes()
719
722
 
720
723
  # Test if the terminal is of a sufficient size to display the picker
721
724
  if not self.test_screen_size(): return None
@@ -742,7 +745,7 @@ class Picker:
742
745
  visible_columns_total_width = sum(visible_column_widths) + len(self.separator)*(len(visible_column_widths)-1)
743
746
 
744
747
  # Determine the number of items_per_page, top_size and bottom_size
745
- self.calculate_section_sizes()
748
+ # self.calculate_section_sizes()
746
749
 
747
750
  # top_space = self.top_gap
748
751
 
@@ -1225,6 +1228,9 @@ class Picker:
1225
1228
  "top_gap",
1226
1229
  "unicode_char_width",
1227
1230
  "show_row_header",
1231
+ "centre_in_terminal_vertical",
1232
+ "centre_in_cols",
1233
+ "centre_in_terminal",
1228
1234
  ]
1229
1235
 
1230
1236
  for var in variables:
@@ -1430,20 +1436,26 @@ class Picker:
1430
1436
  self.auto_refresh = not self.auto_refresh
1431
1437
  elif setting[1] == "h":
1432
1438
  self.highlights_hide = not self.highlights_hide
1439
+ elif setting.isnumeric():
1440
+ self.cursor_pos = max(0, min(int(setting), len(self.indexed_items)-1))
1441
+ elif setting.startswith("col") and setting[3:].isnumeric():
1442
+ col = int(setting[3:])
1443
+ if 0 <= col < len(self.column_widths):
1444
+ self.selected_column = col
1433
1445
 
1434
1446
  elif setting in ["nhl", "nohl", "nohighlights"]:
1435
1447
  # highlights = [highlight for highlight in highlights if "type" not in highlight or highlight["type"] != "search" ]
1436
1448
 
1437
1449
  self.highlights_hide = not self.highlights_hide
1438
- # elif setting[0] == "s":
1439
- # if 0 <= int(setting[1:]) < len(self.items[0]):
1440
- # self.sort_column = int(setting[1:])
1441
- # if len(self.indexed_items):
1442
- # current_pos = self.indexed_items[self.cursor_pos][0]
1443
- # 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 items based on new column
1444
- # if len(self.indexed_items):
1445
- # new_pos = [row[0] for row in self.indexed_items].index(current_pos)
1446
- # self.cursor_pos = new_pos
1450
+ elif setting.startswith("s") and setting[1:].isnumeric():
1451
+ if 0 <= int(setting[1:]) < len(self.items[0]):
1452
+ self.sort_column = int(setting[1:])
1453
+ if len(self.indexed_items):
1454
+ current_pos = self.indexed_items[self.cursor_pos][0]
1455
+ 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 items based on new column
1456
+ if len(self.indexed_items):
1457
+ new_pos = [row[0] for row in self.indexed_items].index(current_pos)
1458
+ self.cursor_pos = new_pos
1447
1459
  elif setting == "ct":
1448
1460
  self.centre_in_terminal = not self.centre_in_terminal
1449
1461
  elif setting == "cc":
@@ -1489,50 +1501,23 @@ class Picker:
1489
1501
  elif setting == "unicode":
1490
1502
  self.unicode_char_width = not self.unicode_char_width
1491
1503
  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)
1504
+ self.command_stack.append(Command("setting", self.user_settings))
1505
+ self.switch_file(increment=1)
1506
+ elif setting == "file_prev":
1507
+ self.command_stack.append(Command("setting", self.user_settings))
1508
+ self.switch_file(increment=-1)
1509
+ # self.draw_screen(self.indexed_items, self.highlights)
1510
+ # self.stdscr.refresh()
1506
1511
 
1507
1512
  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
-
1513
+ self.command_stack.append(Command("setting", self.user_settings))
1514
+ self.switch_sheet(increment=1)
1515
+ elif setting == "sheet_prev":
1516
+ self.command_stack.append(Command("setting", self.user_settings))
1517
+ self.switch_sheet(increment=-1)
1532
1518
 
1533
1519
  elif setting.startswith("ft"):
1534
1520
  if len(setting) > 2 and setting[2:].isnumeric():
1535
-
1536
1521
  num = int(setting[2:])
1537
1522
  self.footer_style = max(len(self.footer_options)-1, num)
1538
1523
  self.footer = self.footer_options[self.footer_style]
@@ -2099,7 +2084,50 @@ class Picker:
2099
2084
 
2100
2085
  self.initialise_variables()
2101
2086
 
2087
+ def switch_file(self, increment=1) -> None:
2088
+ """ Go to the next file. """
2089
+ if len(self.loaded_files) <= 1:
2090
+ return None
2091
+
2092
+ # Cache file state
2093
+ self.loaded_file_states[self.loaded_file_index] = self.get_function_data()
2102
2094
 
2095
+ self.loaded_file_index = (self.loaded_file_index + increment) % len(self.loaded_files)
2096
+ self.loaded_file = self.loaded_files[self.loaded_file_index]
2097
+
2098
+ # If we already have a loaded state for this file
2099
+ if self.loaded_file_states[self.loaded_file_index]:
2100
+ self.set_function_data(self.loaded_file_states[self.loaded_file_index])
2101
+ else:
2102
+ self.set_function_data({}, reset_absent_variables=True)
2103
+ self.load_file(self.loaded_file)
2104
+
2105
+
2106
+ def switch_sheet(self, increment=1) -> None:
2107
+ if not os.path.exists(self.loaded_file):
2108
+ self.notification(self.stdscr, message=f"File {repr(self.loaded_file)} not found.")
2109
+ return None
2110
+ if len(self.sheets) <= 1:
2111
+ return None
2112
+
2113
+ # Cache sheet state
2114
+ self.sheet_states[self.sheet_index] = self.get_function_data()
2115
+
2116
+ self.sheet_index = (self.sheet_index + increment) % len(self.sheets)
2117
+ self.sheet_name = self.sheets[self.sheet_index]
2118
+
2119
+ # If we already have a loaded state for this file
2120
+ if self.sheet_states[self.sheet_index]:
2121
+ self.set_function_data(self.sheet_states[self.sheet_index])
2122
+ else:
2123
+ function_data = {
2124
+ "sheet_index": self.sheet_index,
2125
+ "sheet_name": self.sheet_name,
2126
+ "sheet_states":self.sheet_states,
2127
+ "sheets": self.sheets,
2128
+ }
2129
+ self.set_function_data(function_data, reset_absent_variables=True)
2130
+ self.load_sheet(self.loaded_file, sheet_number=self.sheet_index)
2103
2131
 
2104
2132
 
2105
2133
 
@@ -2239,12 +2267,12 @@ class Picker:
2239
2267
  version = metadata.version('listpick')
2240
2268
 
2241
2269
  info_items = [
2242
- [" Listpick info:", "-*"*30],
2270
+ [" Listpick info", "-*"*30],
2243
2271
  ["",""],
2244
2272
  ["listpick version", f"{version}"],
2245
2273
 
2246
2274
  ["",""],
2247
- [" Global:", "-*"*30],
2275
+ [" Global", "-*"*30],
2248
2276
  ["",""],
2249
2277
  ["current_file", self.loaded_file],
2250
2278
  ["loaded_files", repr(self.loaded_files)],
@@ -2257,11 +2285,12 @@ class Picker:
2257
2285
  ["debug level", f"{repr(self.debug_level)}"],
2258
2286
 
2259
2287
  ["",""],
2260
- [" Current File:", "-*"*30],
2288
+ [" Current File", "-*"*30],
2261
2289
  ["",""],
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}"],
2290
+ # ["row/row count", f"{self.cursor_pos}/{len(self.indexed_items)}"],
2291
+ ["Current row", f"{self.cursor_pos}/{len(self.indexed_items)}"],
2292
+ ["Total rows", f"{len(self.items)}"],
2293
+ ["Selection count", f"{self.selected_cells_by_row}"],
2265
2294
  ["current_sheet", self.sheet_name],
2266
2295
  ["sheets", repr(self.sheets)],
2267
2296
  ["current column/column_count", f"{self.selected_column}/{len(self.column_widths)}"],
@@ -2272,7 +2301,7 @@ class Picker:
2272
2301
  ["id_column", f"{self.id_column}"],
2273
2302
 
2274
2303
  ["",""],
2275
- [" Display options:", "-*"*30],
2304
+ [" Display options", "-*"*30],
2276
2305
  ["",""],
2277
2306
  ["show_header", str(self.show_header)],
2278
2307
  ["show_footer", repr(self.show_footer)],
@@ -2293,20 +2322,29 @@ class Picker:
2293
2322
  ]
2294
2323
 
2295
2324
  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"]
2325
+ data["indexed_items"] = f"[...] length = {len(data['indexed_items'])}"
2326
+ data["selections"] = f"[...] length = {len(data['selections'])}"
2327
+ data["selected_cells_by_row"] = f"[...] length = {len(data['selected_cells_by_row'])}"
2328
+ data["cell_selections"] = f"[...] length = {len(data['cell_selections'])}"
2329
+ data["items"] = f"[...] length = {len(data['items'])}"
2330
+ data["require_option"] = f"[...] length = {len(data['require_option'])}"
2331
+ data["option_functions"] = f"[...] length = {len(data['option_functions'])}"
2332
+ data["loaded_file_states"] = f"[...] length = {len(data['loaded_file_states'])}"
2333
+ data["sheet_states"] = f"[...] length = {len(data['sheet_states'])}"
2303
2334
  info_items += [
2304
2335
  ["",""],
2305
- [" get_function_data():", "-*"*30],
2336
+ [" get_function_data()", "-*"*30],
2306
2337
  ["",""],
2307
2338
  ["show_header", str(self.show_header)],
2308
2339
  ]
2309
2340
  info_items += [[key, repr(value)] for key, value in data.items()]
2341
+
2342
+
2343
+ for row in info_items:
2344
+ if row[1] == "-*"*30:
2345
+ continue
2346
+ row[0] = " " + row[0]
2347
+
2310
2348
  info_header = ["Option", "Value"]
2311
2349
  info_data = {
2312
2350
  "items": info_items,
@@ -2405,13 +2443,18 @@ class Picker:
2405
2443
  options += [["rh", "Toggle row header"]]
2406
2444
  options += [["modes", "Toggle modes"]]
2407
2445
  options += [["ft", "Cycle through footer styles (accepts ft#)"]]
2446
+ options += [["file_next", "Go to the next open file."]]
2447
+ options += [["file_prev", "Go to the previous open file."]]
2448
+ options += [["sheet_next", "Go to the next sheet."]]
2449
+ options += [["sheet_prev", "Go to the previous sheet."]]
2408
2450
  options += [["unicode", "Toggle b/w using len and wcwidth to calculate char width."]]
2409
- options += [[f"s{i}", f"Select col. {i}"] for i in range(len(self.items[0]))]
2410
- options += [[f"!{i}", f"Toggle col. {i}"] for i in range(len(self.items[0]))]
2411
2451
  options += [["ara", "Add empty row after cursor."]]
2412
2452
  options += [["arb", "Add empty row before the cursor."]]
2413
2453
  options += [["aca", "Add empty column after the selected column."]]
2414
2454
  options += [["acb", "Add empty column before the selected column."]]
2455
+ options += [[f"col{i}", f"Select column {i}"] for i in range(len(self.items[0]))]
2456
+ options += [[f"s{i}", f"Sort by column {i}"] for i in range(len(self.items[0]))]
2457
+ options += [[f"!{i}", f"Toggle visibility of column {i}"] for i in range(len(self.items[0]))]
2415
2458
 
2416
2459
 
2417
2460
  settings_options_header = ["Key", "Setting"]
@@ -3031,14 +3074,10 @@ class Picker:
3031
3074
  # Re-sort self.items after applying filter
3032
3075
  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
3076
  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]
3077
+ self.switch_file(increment=1)
3037
3078
 
3038
3079
  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]
3080
+ self.switch_file(increment=-1)
3042
3081
 
3043
3082
  elif self.check_key("pipe_input", key, self.keys_dict):
3044
3083
  self.logger.info(f"key_function pipe_input")
listpick/ui/build_help.py CHANGED
@@ -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" ],
listpick/ui/footer.py CHANGED
@@ -47,42 +47,51 @@ class StandardFooter(Footer):
47
47
  else: self.height = 2
48
48
  except:
49
49
  logger.error("Error encountered when running StandardFooter.get_state")
50
- def draw(self, h, w):
51
- state = self.get_state()
52
- # Fill background
53
50
 
51
+ self.footer_string_y = 0
52
+ self.picker_info_y = 1
53
+ self.sort_info_y = 2
54
+ self.sheets_y = 3
55
+ self.files_y = 4
56
+ def adjust_sizes(self, h, w):
57
+ state = self.get_state()
54
58
 
55
- sheets_y=-1
59
+ self.sheets_y=-1
56
60
  if state["footer_string"]:
57
-
58
-
59
- footer_string_y = h-1
60
- picker_info_y = h-3
61
- sort_info_y = h-2
61
+ self.footer_string_y = h-1
62
+ self.picker_info_y = h-3
63
+ self.sort_info_y = h-2
62
64
 
63
65
  self.height = 3
64
66
 
65
67
  else:
66
- picker_info_y = h-2
67
- sort_info_y = h-1
68
- footer_string_y = -1
68
+ self.picker_info_y = h-2
69
+ self.sort_info_y = h-1
70
+ self.footer_string_y = -1
69
71
  self.height = 2
70
72
 
71
73
  if len(state["sheets"]) > 1:
72
74
  self.height += 1
73
- picker_info_y -= 1
74
- sort_info_y -= 1
75
- footer_string_y -= 1
76
- sheets_y = h-1
75
+ self.picker_info_y -= 1
76
+ self.sort_info_y -= 1
77
+ self.footer_string_y -= 1
78
+ self.sheets_y = h-1
77
79
 
78
80
  if len(state["loaded_files"]) > 1 and state["loaded_file"] in state["loaded_files"]:
79
81
  self.height += 1
80
- picker_info_y -= 1
81
- sort_info_y -= 1
82
- footer_string_y -= 1
83
- sheets_y -= 1
82
+ self.picker_info_y -= 1
83
+ self.sort_info_y -= 1
84
+ self.footer_string_y -= 1
85
+ self.sheets_y -= 1
86
+
87
+ self.files_y = h-1
88
+
89
+ def draw(self, h, w):
90
+ state = self.get_state()
91
+ # Fill background
92
+
93
+ self.adjust_sizes(h, w)
84
94
 
85
- files_y = h-1
86
95
 
87
96
 
88
97
  for i in range(self.height):
@@ -101,18 +110,18 @@ class StandardFooter(Footer):
101
110
  current_file_x = sum((len(x) for x in files[:idx])) + idx*len(sep)
102
111
  current_file_str = state["loaded_file"].split("/")[-1]
103
112
  current_file_x_end = current_file_x + len(current_file_str) + 2
104
- self.stdscr.addstr(files_y, 0, ' '*(w-1), curses.color_pair(self.colours_start+4))
113
+ self.stdscr.addstr(self.files_y, 0, ' '*(w-1), curses.color_pair(self.colours_start+4))
105
114
  if current_file_x_end < w:
106
115
 
107
- self.stdscr.addstr(files_y, 0, f" {files_str}", curses.color_pair(self.colours_start+4))
116
+ self.stdscr.addstr(self.files_y, 0, f" {files_str}", curses.color_pair(self.colours_start+4))
108
117
 
109
- self.stdscr.addstr(files_y, current_file_x, f" {current_file_str}{sep[0]}", curses.color_pair(self.colours_start+4) | curses.A_REVERSE)
118
+ self.stdscr.addstr(self.files_y, current_file_x, f" {current_file_str}{sep[0]}", curses.color_pair(self.colours_start+4) | curses.A_REVERSE)
110
119
  else:
111
120
  files_str = sep.join(files)
112
121
  files_str = files_str[current_file_x_end-w:current_file_x_end][:w-2]
113
- self.stdscr.addstr(files_y, 0, f" {files_str}", curses.color_pair(self.colours_start+4))
122
+ self.stdscr.addstr(self.files_y, 0, f" {files_str}", curses.color_pair(self.colours_start+4))
114
123
 
115
- self.stdscr.addstr(files_y, w - (len(current_file_str)+3), f" {current_file_str}{sep[0]}", curses.color_pair(self.colours_start+4) | curses.A_REVERSE)
124
+ self.stdscr.addstr(self.files_y, w - (len(current_file_str)+3), f" {current_file_str}{sep[0]}", curses.color_pair(self.colours_start+4) | curses.A_REVERSE)
116
125
 
117
126
  if len(state["sheets"]) > 1:
118
127
 
@@ -127,18 +136,18 @@ class StandardFooter(Footer):
127
136
  current_sheet_x = sum((len(x) for x in sheets[:idx])) + idx*len(sep)
128
137
  current_sheet_str = state["sheet_name"].split("/")[-1]
129
138
  current_sheet_x_end = current_sheet_x + len(current_sheet_str) + 2
130
- self.stdscr.addstr(sheets_y, 0, ' '*(w-1), curses.color_pair(self.colours_start+4))
139
+ self.stdscr.addstr(self.sheets_y, 0, ' '*(w-1), curses.color_pair(self.colours_start+4))
131
140
  if current_sheet_x_end < w:
132
141
 
133
- self.stdscr.addstr(sheets_y, 0, f" {sheets_str}", curses.color_pair(self.colours_start+4))
142
+ self.stdscr.addstr(self.sheets_y, 0, f" {sheets_str}", curses.color_pair(self.colours_start+4))
134
143
 
135
- self.stdscr.addstr(sheets_y, current_sheet_x, f" {current_sheet_str}{sep[0]}", curses.color_pair(self.colours_start+4) | curses.A_REVERSE)
144
+ self.stdscr.addstr(self.sheets_y, current_sheet_x, f" {current_sheet_str}{sep[0]}", curses.color_pair(self.colours_start+4) | curses.A_REVERSE)
136
145
  else:
137
146
  sheets_str = sep.join(sheets)
138
147
  sheets_str = sheets_str[current_sheet_x_end-w:current_sheet_x_end][:w-2]
139
- self.stdscr.addstr(sheets_y, 0, f" {sheets_str}", curses.color_pair(self.colours_start+4))
148
+ self.stdscr.addstr(self.sheets_y, 0, f" {sheets_str}", curses.color_pair(self.colours_start+4))
140
149
 
141
- self.stdscr.addstr(sheets_y, w - (len(current_sheet_str)+3), f" {current_sheet_str}{sep[0]}", curses.color_pair(self.colours_start+4) | curses.A_REVERSE)
150
+ self.stdscr.addstr(self.sheets_y, w - (len(current_sheet_str)+3), f" {current_sheet_str}{sep[0]}", curses.color_pair(self.colours_start+4) | curses.A_REVERSE)
142
151
 
143
152
 
144
153
 
@@ -148,8 +157,8 @@ class StandardFooter(Footer):
148
157
 
149
158
  disp_string = f"{state["footer_string"][:footer_string_width]}"
150
159
  disp_string = f" {disp_string:>{footer_string_width-2}} "
151
- self.stdscr.addstr(footer_string_y, w-footer_string_width-1, " "*footer_string_width, curses.color_pair(self.colours_start+24))
152
- self.stdscr.addstr(footer_string_y, w-footer_string_width-1, f"{disp_string}", curses.color_pair(self.colours_start+24))
160
+ self.stdscr.addstr(self.footer_string_y, w-footer_string_width-1, " "*footer_string_width, curses.color_pair(self.colours_start+24))
161
+ self.stdscr.addstr(self.footer_string_y, w-footer_string_width-1, f"{disp_string}", curses.color_pair(self.colours_start+24))
153
162
 
154
163
 
155
164
 
@@ -177,7 +186,7 @@ class StandardFooter(Footer):
177
186
 
178
187
  # Maximum chars that should be displayed
179
188
  max_chars = min(len(cursor_disp_str)+2, w)
180
- self.stdscr.addstr(picker_info_y, w-max_chars, f"{cursor_disp_str:>{max_chars-2}} ", curses.color_pair(self.colours_start+20))
189
+ self.stdscr.addstr(self.picker_info_y, w-max_chars, f"{cursor_disp_str:>{max_chars-2}} ", curses.color_pair(self.colours_start+20))
181
190
 
182
191
 
183
192
  # Sort info
@@ -187,7 +196,7 @@ class StandardFooter(Footer):
187
196
  sort_order_info = "▼" if state["sort_reverse"][state['sort_column']] else "▲"
188
197
  sort_disp_str = f" Sort: ({sort_column_info}, {sort_method_info}, {sort_order_info}) "
189
198
  max_chars = min(len(sort_disp_str)+2, w)
190
- self.stdscr.addstr(sort_info_y, w-max_chars, f"{sort_disp_str:>{max_chars-1}}", curses.color_pair(self.colours_start+20))
199
+ self.stdscr.addstr(self.sort_info_y, w-max_chars, f"{sort_disp_str:>{max_chars-1}}", curses.color_pair(self.colours_start+20))
191
200
 
192
201
  self.stdscr.refresh()
193
202
 
@@ -205,6 +214,9 @@ class CompactFooter(Footer):
205
214
  self.get_state = get_state_function
206
215
  self.height = 1
207
216
 
217
+ def adjust_sizes(self, h, w):
218
+ pass
219
+
208
220
  def draw(self, h, w):
209
221
  state = self.get_state()
210
222
 
@@ -268,6 +280,10 @@ class NoFooter(Footer):
268
280
  self.colours_start = colours_start
269
281
  self.get_state = get_state_function
270
282
  self.height = 0
283
+
284
+ def adjust_sizes(self, h, w):
285
+ pass
286
+
271
287
  def draw(self, h, w):
272
288
  state = self.get_state()
273
289
 
listpick/ui/keys.py CHANGED
@@ -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.3
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=-QdN2nv3Aii_vJdt8ROOkL_v-mI2TNQi1q34f5tGAno,181819
3
+ listpick/listpick_app.py,sha256=APXKgeGp2bDDyXaFUr7HmswokpO6H6g8xt9KdMhM5jc,183558
4
4
  listpick/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- listpick/ui/build_help.py,sha256=_rVKKrX3HfFJtw-pyeNb2lQWbml4-AAw8sZIUYGn97Y,8731
6
- listpick/ui/footer.py,sha256=85sVZ6zvzZXSc0TwgvCHGuzGElp6KwUVzwzF5VQwLyY,14219
5
+ listpick/ui/build_help.py,sha256=8QtsRosIE2IMagRc_remzmwSWpCurFgLenLL7w1ly94,8949
6
+ listpick/ui/footer.py,sha256=eaGCJlUMuOyoVfBxbqDFBxF7b3w_FMUuzFO1_xWz7xY,14702
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=8LRO0CqX8tn6LM9irwSK7eA_Go-v0nBDztWtQKPFXUk,13042
9
+ listpick/ui/keys.py,sha256=944-no3lspUzC3oWt96Q_mY33fIrKOharXPskAMou2I,13162
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.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,,
26
+ listpick-0.1.14.3.dist-info/licenses/LICENSE.txt,sha256=2mP-MRHJptADDNE9VInMNg1tE-C6Qv93Z4CCQKrpg9w,1061
27
+ listpick-0.1.14.3.dist-info/METADATA,sha256=aCfS3JHtI7fj15zC7bn1iv1PHtAhpx-eP3bkMUZQWfU,8090
28
+ listpick-0.1.14.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
29
+ listpick-0.1.14.3.dist-info/entry_points.txt,sha256=-QCf_BKIkUz35Y9nkYpjZWs2Qg0KfRna2PAs5DnF6BE,43
30
+ listpick-0.1.14.3.dist-info/top_level.txt,sha256=5mtsGEz86rz3qQDe0D463gGjAfSp6A3EWg4J4AGYr-Q,9
31
+ listpick-0.1.14.3.dist-info/RECORD,,