listpick 0.1.14.0__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.
Potentially problematic release.
This version of listpick might be problematic. Click here for more details.
- {listpick-0.1.14.0 → listpick-0.1.14.2}/CHANGELOG.md +8 -1
- {listpick-0.1.14.0/src/listpick.egg-info → listpick-0.1.14.2}/PKG-INFO +1 -1
- {listpick-0.1.14.0 → listpick-0.1.14.2}/TODO.md +15 -11
- {listpick-0.1.14.0 → listpick-0.1.14.2}/setup.py +1 -1
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick/listpick_app.py +174 -52
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick/ui/build_help.py +3 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick/ui/keys.py +9 -6
- {listpick-0.1.14.0 → listpick-0.1.14.2/src/listpick.egg-info}/PKG-INFO +1 -1
- {listpick-0.1.14.0 → listpick-0.1.14.2}/.gitignore +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/LICENSE.txt +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/README.md +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/assets/aria2tui_screenshot.png +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/assets/file_compare.png +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/assets/lpfman.png +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/listpick.py +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/requirements.txt +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/setup.cfg +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick/__init__.py +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick/__main__.py +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick/ui/__init__.py +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick/ui/footer.py +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick/ui/help_screen.py +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick/ui/input_field.py +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick/ui/pane_stuff.py +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick/ui/picker_colours.py +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick/utils/__init__.py +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick/utils/clipboard_operations.py +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick/utils/config.py +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick/utils/dump.py +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick/utils/filtering.py +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick/utils/generate_data.py +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick/utils/options_selectors.py +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick/utils/paste_operations.py +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick/utils/picker_log.py +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick/utils/search_and_filter_utils.py +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick/utils/searching.py +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick/utils/sorting.py +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick/utils/table_to_list_of_lists.py +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick/utils/utils.py +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick.egg-info/SOURCES.txt +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick.egg-info/dependency_links.txt +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick.egg-info/entry_points.txt +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick.egg-info/requires.txt +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/src/listpick.egg-info/top_level.txt +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/tests/kitty_control.sh +0 -0
- {listpick-0.1.14.0 → listpick-0.1.14.2}/tests/sorting_dates.csv +0 -0
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# CHANGELOG.md
|
|
2
|
-
|
|
2
|
+
Note that the changes between 0.1.11.0 and 1.1.12.0 are listed under 0.1.11
|
|
3
|
+
|
|
4
|
+
## [0.1.15] 2025-??-??
|
|
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.
|
|
8
|
+
|
|
9
|
+
## [0.1.14] 2025-08-20
|
|
3
10
|
- Fixed bug when cells are centred vertically.
|
|
4
11
|
- Added "level" keyword for highlight dictionary.
|
|
5
12
|
- l0: show highlight above base rows
|
|
@@ -9,17 +9,8 @@ ASAP
|
|
|
9
9
|
> - [ ] Make input field look better:
|
|
10
10
|
> - [ ] During input
|
|
11
11
|
> - [ ] While being displayed.
|
|
12
|
-
> - [ ]
|
|
13
|
-
>
|
|
14
|
-
> - [x] Open multiple files with file_picker
|
|
15
|
-
> - [x] Switch between 'open' files
|
|
16
|
-
> - [ ] Handle unsaved files.
|
|
17
|
-
> - [x] Remember state when switching between files.
|
|
18
|
-
> - [x] Selections
|
|
19
|
-
> - [ ] Add support in the alternate footers
|
|
20
|
-
> - [x] Handle files with multiple sheets.
|
|
21
|
-
> - [ ] Add support in the alternate footers
|
|
22
|
-
> - [ ] Support opening multiple files from the command line.
|
|
12
|
+
> - [ ] Add keys for next page, next sheet, info
|
|
13
|
+
> - [ ] Sort out what to do when the width of the columns is less than the terminal.
|
|
23
14
|
|
|
24
15
|
|
|
25
16
|
|
|
@@ -276,6 +267,19 @@ ASAP
|
|
|
276
267
|
> - [ ] Add row selection using 'V'--select all cells in a row.
|
|
277
268
|
> - [ ] Add option for those who don't use a nerdfont.
|
|
278
269
|
> - [ ] refreshing symbol, pin cursor symbol,
|
|
270
|
+
> - [x] Add info page.
|
|
271
|
+
> - [ ] Handle multiple files
|
|
272
|
+
> - [x] Display 'open' files in footer
|
|
273
|
+
> - [x] Open multiple files with file_picker
|
|
274
|
+
> - [x] Switch between 'open' files
|
|
275
|
+
> - [ ] Handle unsaved files.
|
|
276
|
+
> - [x] Remember state when switching between files.
|
|
277
|
+
> - [x] Selections
|
|
278
|
+
> - [ ] Add support in the alternate footers
|
|
279
|
+
> - [ ] Add symbol in footer list to show if file has been edited or is unsaved
|
|
280
|
+
> - [x] Handle files with multiple sheets.
|
|
281
|
+
> - [ ] Add support in the alternate footers
|
|
282
|
+
> - [x] Support opening multiple files from the command line.
|
|
279
283
|
|
|
280
284
|
> [!Bug] Bugs
|
|
281
285
|
> - [ ] fix resizing when input field active
|
|
@@ -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.
|
|
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.",
|
|
@@ -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,
|
|
@@ -1487,46 +1489,18 @@ class Picker:
|
|
|
1487
1489
|
elif setting == "unicode":
|
|
1488
1490
|
self.unicode_char_width = not self.unicode_char_width
|
|
1489
1491
|
elif setting == "file_next":
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
self.loaded_file_index = (self.loaded_file_index + 1) % len(self.loaded_files)
|
|
1496
|
-
self.loaded_file = self.loaded_files[self.loaded_file_index]
|
|
1497
|
-
|
|
1498
|
-
# If we already have a loaded state for this file
|
|
1499
|
-
if self.loaded_file_states[self.loaded_file_index]:
|
|
1500
|
-
self.set_function_data(self.loaded_file_states[self.loaded_file_index])
|
|
1501
|
-
else:
|
|
1502
|
-
self.set_function_data({}, reset_absent_variables=True)
|
|
1503
|
-
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)
|
|
1504
1497
|
|
|
1505
1498
|
elif setting == "sheet_next":
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
# Cache sheet state
|
|
1513
|
-
self.sheet_states[self.sheet_index] = self.get_function_data()
|
|
1514
|
-
self.sheet_index = (self.sheet_index + 1) % len(self.sheets)
|
|
1515
|
-
self.sheet_name = self.sheets[self.sheet_index]
|
|
1516
|
-
|
|
1517
|
-
# If we already have a loaded state for this file
|
|
1518
|
-
if self.sheet_states[self.sheet_index]:
|
|
1519
|
-
self.set_function_data(self.sheet_states[self.sheet_index])
|
|
1520
|
-
else:
|
|
1521
|
-
function_data = {
|
|
1522
|
-
"sheet_index": self.sheet_index,
|
|
1523
|
-
"sheet_name": self.sheet_name,
|
|
1524
|
-
"sheet_states":self.sheet_states,
|
|
1525
|
-
"sheets": self.sheets,
|
|
1526
|
-
}
|
|
1527
|
-
self.set_function_data(function_data, reset_absent_variables=True)
|
|
1528
|
-
self.load_sheet(self.loaded_file, sheet_number=self.sheet_index)
|
|
1529
|
-
|
|
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)
|
|
1530
1504
|
|
|
1531
1505
|
elif setting.startswith("ft"):
|
|
1532
1506
|
if len(setting) > 2 and setting[2:].isnumeric():
|
|
@@ -2097,7 +2071,50 @@ class Picker:
|
|
|
2097
2071
|
|
|
2098
2072
|
self.initialise_variables()
|
|
2099
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()
|
|
2100
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
|
+
|
|
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)
|
|
2101
2118
|
|
|
2102
2119
|
|
|
2103
2120
|
|
|
@@ -2227,6 +2244,110 @@ class Picker:
|
|
|
2227
2244
|
}
|
|
2228
2245
|
OptionPicker = Picker(self.stdscr, **help_data)
|
|
2229
2246
|
s, o, f = OptionPicker.run()
|
|
2247
|
+
self.draw_screen(self.indexed_items, self.highlights)
|
|
2248
|
+
|
|
2249
|
+
if self.check_key("info", key, self.keys_dict):
|
|
2250
|
+
self.logger.info(f"key_function help")
|
|
2251
|
+
self.stdscr.clear()
|
|
2252
|
+
self.stdscr.refresh()
|
|
2253
|
+
import importlib.metadata as metadata
|
|
2254
|
+
version = metadata.version('listpick')
|
|
2255
|
+
|
|
2256
|
+
info_items = [
|
|
2257
|
+
[" Listpick info:", "-*"*30],
|
|
2258
|
+
["",""],
|
|
2259
|
+
["listpick version", f"{version}"],
|
|
2260
|
+
|
|
2261
|
+
["",""],
|
|
2262
|
+
[" Global:", "-*"*30],
|
|
2263
|
+
["",""],
|
|
2264
|
+
["current_file", self.loaded_file],
|
|
2265
|
+
["loaded_files", repr(self.loaded_files)],
|
|
2266
|
+
["auto_refresh", f"{repr(self.auto_refresh)}"],
|
|
2267
|
+
["timer", f"{repr(self.timer)}"],
|
|
2268
|
+
["pin_cursor", f"{repr(self.pin_cursor)}"],
|
|
2269
|
+
["cwd", f"{os.getcwd()}"],
|
|
2270
|
+
["Picker memory", f"{format_size(sys.getsizeof(self))}"],
|
|
2271
|
+
["debug", f"{repr(self.debug)}"],
|
|
2272
|
+
["debug level", f"{repr(self.debug_level)}"],
|
|
2273
|
+
|
|
2274
|
+
["",""],
|
|
2275
|
+
[" Current File:", "-*"*30],
|
|
2276
|
+
["",""],
|
|
2277
|
+
["row/row count", f"{self.cursor_pos}/{len(self.indexed_items)}"],
|
|
2278
|
+
["total rows", f"{len(self.items)}"],
|
|
2279
|
+
["selections", f"{self.selected_cells_by_row}"],
|
|
2280
|
+
["current_sheet", self.sheet_name],
|
|
2281
|
+
["sheets", repr(self.sheets)],
|
|
2282
|
+
["current column/column_count", f"{self.selected_column}/{len(self.column_widths)}"],
|
|
2283
|
+
["hidden columns", f"{self.hidden_columns}"],
|
|
2284
|
+
["sort column", f"{self.sort_column}"],
|
|
2285
|
+
["sort method", f"{self.SORT_METHODS[self.columns_sort_method[self.sort_column]]}"],
|
|
2286
|
+
["sort order", f"{'Descending' if self.sort_reverse[self.sort_column] else 'Ascending'}"],
|
|
2287
|
+
["id_column", f"{self.id_column}"],
|
|
2288
|
+
|
|
2289
|
+
["",""],
|
|
2290
|
+
[" Display options:", "-*"*30],
|
|
2291
|
+
["",""],
|
|
2292
|
+
["show_header", str(self.show_header)],
|
|
2293
|
+
["show_footer", repr(self.show_footer)],
|
|
2294
|
+
["show_row_header", repr(self.show_row_header)],
|
|
2295
|
+
["max_column_width", str(self.max_column_width)],
|
|
2296
|
+
["colour_theme_number", str(self.colour_theme_number)],
|
|
2297
|
+
["top_gap", str(self.top_gap)],
|
|
2298
|
+
["highlight_full_row", repr(self.highlight_full_row)],
|
|
2299
|
+
["cell_cursor", repr(self.cell_cursor)],
|
|
2300
|
+
["items_per_page", repr(self.items_per_page)],
|
|
2301
|
+
["paginate", repr(self.paginate)],
|
|
2302
|
+
["display_modes", repr(self.display_modes)],
|
|
2303
|
+
["footer_style", repr(self.footer_style)],
|
|
2304
|
+
["unicode_char_width", repr(self.unicode_char_width)],
|
|
2305
|
+
["centre_in_terminal", repr(self.centre_in_terminal)],
|
|
2306
|
+
["centre_in_cols", repr(self.centre_in_cols)],
|
|
2307
|
+
["centre_in_terminal_vertical", repr(self.centre_in_terminal_vertical)],
|
|
2308
|
+
]
|
|
2309
|
+
|
|
2310
|
+
data = self.get_function_data()
|
|
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'])}"
|
|
2320
|
+
info_items += [
|
|
2321
|
+
["",""],
|
|
2322
|
+
[" get_function_data():", "-*"*30],
|
|
2323
|
+
["",""],
|
|
2324
|
+
["show_header", str(self.show_header)],
|
|
2325
|
+
]
|
|
2326
|
+
info_items += [[key, repr(value)] for key, value in data.items()]
|
|
2327
|
+
info_header = ["Option", "Value"]
|
|
2328
|
+
info_data = {
|
|
2329
|
+
"items": info_items,
|
|
2330
|
+
"header": info_header,
|
|
2331
|
+
"title": f"{self.title} Info",
|
|
2332
|
+
"colours_start": self.help_colours_start,
|
|
2333
|
+
"colours": help_colours,
|
|
2334
|
+
"show_footer": True,
|
|
2335
|
+
"max_selected": 1,
|
|
2336
|
+
"keys_dict": help_keys,
|
|
2337
|
+
"disabled_keys": [ord('?'), ord('v'), ord('V'), ord('m'), ord('M'), ord('l'), curses.KEY_ENTER, ord('\n')],
|
|
2338
|
+
"highlight_full_row": True,
|
|
2339
|
+
"top_gap": 0,
|
|
2340
|
+
"paginate": self.paginate,
|
|
2341
|
+
"centre_in_terminal": False,
|
|
2342
|
+
"centre_in_terminal_vertical": True,
|
|
2343
|
+
"hidden_columns": [],
|
|
2344
|
+
"reset_colours": False,
|
|
2345
|
+
|
|
2346
|
+
}
|
|
2347
|
+
OptionPicker = Picker(self.stdscr, **info_data)
|
|
2348
|
+
s, o, f = OptionPicker.run()
|
|
2349
|
+
|
|
2350
|
+
self.draw_screen(self.indexed_items, self.highlights)
|
|
2230
2351
|
|
|
2231
2352
|
elif self.check_key("exit", key, self.keys_dict):
|
|
2232
2353
|
self.stdscr.clear()
|
|
@@ -2247,6 +2368,7 @@ class Picker:
|
|
|
2247
2368
|
else:
|
|
2248
2369
|
self.set_function_data({}, reset_absent_variables=True)
|
|
2249
2370
|
self.load_file(self.loaded_file)
|
|
2371
|
+
self.draw_screen(self.indexed_items, self.highlights)
|
|
2250
2372
|
|
|
2251
2373
|
elif self.check_key("full_exit", key, self.keys_dict):
|
|
2252
2374
|
close_curses(self.stdscr)
|
|
@@ -2300,6 +2422,10 @@ class Picker:
|
|
|
2300
2422
|
options += [["rh", "Toggle row header"]]
|
|
2301
2423
|
options += [["modes", "Toggle modes"]]
|
|
2302
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."]]
|
|
2303
2429
|
options += [["unicode", "Toggle b/w using len and wcwidth to calculate char width."]]
|
|
2304
2430
|
options += [[f"s{i}", f"Select col. {i}"] for i in range(len(self.items[0]))]
|
|
2305
2431
|
options += [[f"!{i}", f"Toggle col. {i}"] for i in range(len(self.items[0]))]
|
|
@@ -2926,14 +3052,10 @@ class Picker:
|
|
|
2926
3052
|
# Re-sort self.items after applying filter
|
|
2927
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
|
|
2928
3054
|
elif self.check_key("file_next", key, self.keys_dict):
|
|
2929
|
-
|
|
2930
|
-
self.loaded_file_index = (self.loaded_file_index + 1) % len(self.loaded_files)
|
|
2931
|
-
self.loaded_file = self.loaded_files[self.loaded_file_index]
|
|
3055
|
+
self.switch_file(increment=1)
|
|
2932
3056
|
|
|
2933
3057
|
elif self.check_key("file_prev", key, self.keys_dict):
|
|
2934
|
-
|
|
2935
|
-
self.loaded_file_index = (self.loaded_file_index - 1) % len(self.loaded_files)
|
|
2936
|
-
self.loaded_file = self.loaded_files[self.loaded_file_index]
|
|
3058
|
+
self.switch_file(increment=-1)
|
|
2937
3059
|
|
|
2938
3060
|
elif self.check_key("pipe_input", key, self.keys_dict):
|
|
2939
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')],
|
|
@@ -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')
|
|
51
|
-
"continue_search_backward": [ord('N')
|
|
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,9 @@ picker_keys = {
|
|
|
80
80
|
"add_column_after": [ord('+')],
|
|
81
81
|
# "add_row_before": [ord('=')],
|
|
82
82
|
"add_row_after": [ord('=')],
|
|
83
|
+
"info": [ord('i')],
|
|
84
|
+
"file_next": [ord('}')],
|
|
85
|
+
"file_prev": [ord('{')],
|
|
83
86
|
}
|
|
84
87
|
|
|
85
88
|
|
|
@@ -106,8 +109,8 @@ help_keys = {
|
|
|
106
109
|
"search_input": [ord('/')],
|
|
107
110
|
"settings_input": [ord('`')],
|
|
108
111
|
"settings_options": [ord('~')],
|
|
109
|
-
"continue_search_forward": [ord('n')
|
|
110
|
-
"continue_search_backward": [ord('N')
|
|
112
|
+
"continue_search_forward": [ord('n')],
|
|
113
|
+
"continue_search_backward": [ord('N')],
|
|
111
114
|
"cancel": [27], # Escape key
|
|
112
115
|
"col_select": [ord('0'), ord('1'), ord('2'), ord('3'), ord('4'), ord('5'), ord('6'), ord('7'), ord('8'), ord('9')],
|
|
113
116
|
"col_select_next": [ord('>')],
|
|
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
|