listpick 0.1.16.12__py3-none-any.whl → 0.1.16.14__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
@@ -24,7 +24,6 @@ import logging
24
24
  import copy
25
25
  import tempfile
26
26
  import queue
27
- from listpick.utils.generate_data_utils import ProcessSafePriorityQueue
28
27
 
29
28
  from listpick.pane.pane_utils import get_file_attributes
30
29
  from listpick.pane.left_pane_functions import *
@@ -1129,7 +1128,6 @@ class Picker:
1129
1128
  cell_value = truncate_to_display_width(cell_value, min(cell_width, cell_max_width), self.centre_in_cols, self.unicode_char_width)
1130
1129
  if wcswidth(cell_value) + cell_pos > self.term_w:
1131
1130
  cell_value = truncate_to_display_width(cell_value, self.term_w-cell_pos-10, self.centre_in_cols, self.unicode_char_width)
1132
-
1133
1131
  self.stdscr.addstr(y, cell_pos, cell_value, colour)
1134
1132
 
1135
1133
  # Part of the cell is on screen
@@ -1148,6 +1146,7 @@ class Picker:
1148
1146
  pass
1149
1147
 
1150
1148
 
1149
+
1151
1150
  def sort_highlights(highlights):
1152
1151
  """
1153
1152
  Sort highlights into lists based on their display level.
@@ -3139,29 +3138,29 @@ class Picker:
3139
3138
 
3140
3139
  elif self.check_key("settings_options", key, self.keys_dict):
3141
3140
  options = []
3141
+ options += [["cv", "Centre rows vertically"]]
3142
+ options += [["pc", "Pin cursor to row index during data refresh."]]
3143
+ options += [["ct", "Centre column-set in terminal"]]
3144
+ options += [["cc", "Centre values in cells"]]
3145
+ options += [["!r", "Toggle auto-refresh"]]
3146
+ options += [["th", "Cycle between themes. (accepts th#)"]]
3147
+ options += [["colsel", "Toggle columns."]]
3148
+ options += [["nohl", "Toggle highlights"]]
3149
+ options += [["footer", "Toggle footer"]]
3150
+ options += [["header", "Toggle header"]]
3151
+ options += [["rh", "Toggle row header"]]
3152
+ options += [["modes", "Toggle modes"]]
3153
+ options += [["ft", "Cycle through footer styles (accepts ft#)"]]
3154
+ options += [["file_next", "Go to the next open file."]]
3155
+ options += [["file_prev", "Go to the previous open file."]]
3156
+ options += [["sheet_next", "Go to the next sheet."]]
3157
+ options += [["sheet_prev", "Go to the previous sheet."]]
3158
+ options += [["unicode", "Toggle b/w using len and wcwidth to calculate char width."]]
3159
+ options += [["ara", "Add empty row after cursor."]]
3160
+ options += [["arb", "Add empty row before the cursor."]]
3161
+ options += [["aca", "Add empty column after the selected column."]]
3162
+ options += [["acb", "Add empty column before the selected column."]]
3142
3163
  if len(self.items) > 0:
3143
- options += [["cv", "Centre rows vertically"]]
3144
- options += [["pc", "Pin cursor to row index during data refresh."]]
3145
- options += [["ct", "Centre column-set in terminal"]]
3146
- options += [["cc", "Centre values in cells"]]
3147
- options += [["!r", "Toggle auto-refresh"]]
3148
- options += [["th", "Cycle between themes. (accepts th#)"]]
3149
- options += [["colsel", "Toggle columns."]]
3150
- options += [["nohl", "Toggle highlights"]]
3151
- options += [["footer", "Toggle footer"]]
3152
- options += [["header", "Toggle header"]]
3153
- options += [["rh", "Toggle row header"]]
3154
- options += [["modes", "Toggle modes"]]
3155
- options += [["ft", "Cycle through footer styles (accepts ft#)"]]
3156
- options += [["file_next", "Go to the next open file."]]
3157
- options += [["file_prev", "Go to the previous open file."]]
3158
- options += [["sheet_next", "Go to the next sheet."]]
3159
- options += [["sheet_prev", "Go to the previous sheet."]]
3160
- options += [["unicode", "Toggle b/w using len and wcwidth to calculate char width."]]
3161
- options += [["ara", "Add empty row after cursor."]]
3162
- options += [["arb", "Add empty row before the cursor."]]
3163
- options += [["aca", "Add empty column after the selected column."]]
3164
- options += [["acb", "Add empty column before the selected column."]]
3165
3164
  options += [[f"col{i}", f"Select column {i}"] for i in range(len(self.items[0]))]
3166
3165
  options += [[f"s{i}", f"Sort by column {i}"] for i in range(len(self.items[0]))]
3167
3166
  options += [[f"!{i}", f"Toggle visibility of column {i}"] for i in range(len(self.items[0]))]
@@ -3843,7 +3842,7 @@ class Picker:
3843
3842
  field_prefix=" Command: ",
3844
3843
  x=lambda:2,
3845
3844
  y=lambda: self.get_term_size()[0]-2,
3846
- literal=True,
3845
+ literal=False,
3847
3846
  max_length=field_end_f,
3848
3847
  registers=self.registers,
3849
3848
  refresh_screen_function=lambda: self.draw_screen(),
@@ -193,7 +193,6 @@ def input_field(
193
193
  match_word, left_ptr, right_ptr = get_partially_complete_word(usrtxt, cursor, [" ", "/", "="])
194
194
 
195
195
  if match_word in completions:
196
- # os.system(f"notify-send '{completions[0]}'")
197
196
  index = completions.index(match_word)
198
197
  if index == len(completions) - 1: index = -1
199
198
  completions_disp_str = str(completions[index:])[:max_field_length]
listpick/ui/keys.py CHANGED
@@ -249,11 +249,14 @@ edit_menu_keys = {
249
249
  "col_select_prev": [ord('<'), ord('h')],
250
250
  "col_hide": [ord('!'), ord('@'), ord('#'), ord('$'), ord('%'), ord('^'), ord('&'), ord('*'), ord('('), ord(')')],
251
251
  "edit": [ord('e')],
252
- "edit_picker": [ord('E')],
252
+ "edit_nvim": [ord('E')],
253
253
  "edit_ipython": [5], # Ctrl+e
254
254
  "copy": [ord('y')],
255
255
  "save": [19, ord('D')], # Ctrl+s
256
256
  "load": [ord('L'), 15], # Ctrl+o
257
257
  "open": [ord('O')],
258
258
  "toggle_footer": [ord('_')],
259
+ "visual_selection_toggle": [ord('v')],
260
+ "visual_deselection_toggle": [ord('V')],
261
+ "toggle_select": [ord(' ')],
259
262
  }
listpick/utils/utils.py CHANGED
@@ -103,7 +103,12 @@ def format_row(row: list[str], hidden_columns: list, column_widths: list[int], s
103
103
 
104
104
  def get_column_widths(items: list[list[str]], header: list[str]=[], max_column_width:int=70, number_columns:bool=True, max_total_width=-1, separator = " ", unicode_char_width: bool = True) -> list[int]:
105
105
  """ Calculate maximum width of each column with clipping. """
106
- if len(items) == 0: return [0]
106
+ if len(items) == 0 and len(header) == 0: return [0]
107
+ elif len(items) == 0:
108
+ header_widths = [wcswidth(f"{i}. {str(h)}") if number_columns else wcswidth(str(h)) for i, h in enumerate(header)]
109
+ col_widths = [min(max_column_width, header_widths[i]) for i in range(len(header))]
110
+ return col_widths
111
+
107
112
  assert len(items) > 0
108
113
  widths = [max(wcswidth(str(row[i])) for row in items) for i in range(len(items[0]))]
109
114
  # widths = [max(len(str(row[i])) for row in items) for i in range(len(items[0]))]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: listpick
3
- Version: 0.1.16.12
3
+ Version: 0.1.16.14
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,6 +1,6 @@
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=IECGLycdZb7YDXapnxHzj8wlaVHJJEKZk3m5I675UaM,222093
3
+ listpick/listpick_app.py,sha256=slBvAUGlMYDCVzlE-JX2OCOSfKWYj3VHAMaZKqXLhw4,221934
4
4
  listpick/pane/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  listpick/pane/get_data.py,sha256=l12mHIb6qoZWIfW5zZZY8K8EqNcyIcRiHgtRaM2CVGs,2735
6
6
  listpick/pane/left_pane_functions.py,sha256=SVIW4Ef8uNPBQRk4hL67mEFL3pfgChSFZSMRz06CVzw,5543
@@ -12,8 +12,8 @@ listpick/ui/build_help.py,sha256=WVxrMaZ94oY32ijb4A3NdxQYDySF_FvygYuqiTHNIsk,110
12
12
  listpick/ui/draw_screen.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  listpick/ui/footer.py,sha256=NcdH1uO_ma91m0qCczyQZ3zGrexfkiEnwDf5E4tHSMk,15089
14
14
  listpick/ui/help_screen.py,sha256=zbfGIgb-IXtATpl4_Sx7nPbsnRXZ7eiMYlCKGS9EFmw,5608
15
- listpick/ui/input_field.py,sha256=scJjvmSS0QqeDbCky7_0Zgt35Aki7gezRJkrQROlLg4,30034
16
- listpick/ui/keys.py,sha256=KtKWEQBlpyTFR9wHOaKMYyLwxZcsQR6jfXYQ0gZ9R5k,13906
15
+ listpick/ui/input_field.py,sha256=1GUuzMl7P-uw5ijYUOQONMhAzAKoYXRax0-332OroLE,29971
16
+ listpick/ui/keys.py,sha256=PN19jCQeXJCdmaP_FT--3TKFZ_8Iv71Pa_yGFp6H3FA,14062
17
17
  listpick/ui/picker_colours.py,sha256=PYWtJEbBCsiM-Gbm83vJiFoIwfKuJuP4SGKxpozszKY,15159
18
18
  listpick/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
19
  listpick/utils/clipboard_operations.py,sha256=ORdNm2kgGbfs51xJSvgJPERgoSmBgT11axuMkvSoP9A,3133
@@ -34,10 +34,10 @@ listpick/utils/searching.py,sha256=Xk5UIqamNHL2L90z3ACB_Giqdpi9iRKoAJ6pKaqaD7Q,3
34
34
  listpick/utils/sorting.py,sha256=WZZiVlVA3Zkcpwji3U5SNFlQ14zVEk3cZJtQirBkecQ,5329
35
35
  listpick/utils/table_to_list_of_lists.py,sha256=XBj7eGBDF15BRME-swnoXyOfZWxXCxrXp0pzsBfcJ5g,12224
36
36
  listpick/utils/user_input.py,sha256=L3ylI7nnuFM_TP1XKwpiKpxUSkNb2W5cr7mJjTmv_6E,4582
37
- listpick/utils/utils.py,sha256=jML0lWl1xxrN7olSBiXUWR2ZdcJMrb5FFcweEz7kDiA,13667
38
- listpick-0.1.16.12.dist-info/licenses/LICENSE.txt,sha256=2mP-MRHJptADDNE9VInMNg1tE-C6Qv93Z4CCQKrpg9w,1061
39
- listpick-0.1.16.12.dist-info/METADATA,sha256=wu45gw01F2Fj8jbnkMvi1J7B4ZYNgnThPg8XprikUsY,7144
40
- listpick-0.1.16.12.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
41
- listpick-0.1.16.12.dist-info/entry_points.txt,sha256=-QCf_BKIkUz35Y9nkYpjZWs2Qg0KfRna2PAs5DnF6BE,43
42
- listpick-0.1.16.12.dist-info/top_level.txt,sha256=5mtsGEz86rz3qQDe0D463gGjAfSp6A3EWg4J4AGYr-Q,9
43
- listpick-0.1.16.12.dist-info/RECORD,,
37
+ listpick/utils/utils.py,sha256=gwonigqPd8nSQBvN6lLDB68kwUzXqWALesZBja-cehU,13956
38
+ listpick-0.1.16.14.dist-info/licenses/LICENSE.txt,sha256=2mP-MRHJptADDNE9VInMNg1tE-C6Qv93Z4CCQKrpg9w,1061
39
+ listpick-0.1.16.14.dist-info/METADATA,sha256=M7_pPp0lXuVroWGZAA8dO06AKTia2LcbDDwZXpZdOfQ,7144
40
+ listpick-0.1.16.14.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
41
+ listpick-0.1.16.14.dist-info/entry_points.txt,sha256=-QCf_BKIkUz35Y9nkYpjZWs2Qg0KfRna2PAs5DnF6BE,43
42
+ listpick-0.1.16.14.dist-info/top_level.txt,sha256=5mtsGEz86rz3qQDe0D463gGjAfSp6A3EWg4J4AGYr-Q,9
43
+ listpick-0.1.16.14.dist-info/RECORD,,