listpick 0.1.15.3__py3-none-any.whl → 0.1.15.4__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
@@ -3195,14 +3195,21 @@ class Picker:
3195
3195
  if 'filter' in self.modes[prev_mode_index]:
3196
3196
  self.filter_query = self.filter_query.replace(self.modes[prev_mode_index]['filter'], '')
3197
3197
  self.filter_query = f"{self.filter_query.strip()} {val.strip()}".strip()
3198
- prev_index = self.indexed_items[self.cursor_pos][0] if len(self.indexed_items)>0 else 0
3198
+
3199
+ if len(self.indexed_items) == 0:
3200
+ prev_index = -1
3201
+ else:
3202
+ prev_index = self.indexed_items[self.cursor_pos][0] if len(self.indexed_items)>0 else 0
3199
3203
 
3200
3204
  self.indexed_items = filter_items(self.items, self.indexed_items, self.filter_query)
3201
- if prev_index in [x[0] for x in self.indexed_items]: new_index = [x[0] for x in self.indexed_items].index(prev_index)
3202
- else: new_index = 0
3205
+ if prev_index >= 0 and prev_index in [x[0] for x in self.indexed_items]:
3206
+ new_index = [x[0] for x in self.indexed_items].index(prev_index)
3207
+ else:
3208
+ new_index = 0
3203
3209
  self.cursor_pos = new_index
3204
3210
  # Re-sort self.items after applying filter
3205
- 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
3211
+ if len(self.items) and self.items != [[]]:
3212
+ 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
3206
3213
  elif self.check_key("mode_prev", key, self.keys_dict): # shift+tab key
3207
3214
  self.logger.info(f"key_function mode_prev")
3208
3215
  if len(self.modes):
@@ -3215,6 +3222,8 @@ class Picker:
3215
3222
  self.filter_query = self.filter_query.replace(self.modes[prev_mode_index]['filter'], '')
3216
3223
  self.filter_query = f"{self.filter_query.strip()} {val.strip()}".strip()
3217
3224
  prev_index = self.indexed_items[self.cursor_pos][0] if len(self.indexed_items)>0 else 0
3225
+
3226
+ # if len(self.items) and self.items != [[]]:
3218
3227
  self.indexed_items = filter_items(self.items, self.indexed_items, self.filter_query)
3219
3228
  if prev_index in [x[0] for x in self.indexed_items]: new_index = [x[0] for x in self.indexed_items].index(prev_index)
3220
3229
  else: new_index = 0
@@ -3711,21 +3720,21 @@ def main() -> None:
3711
3720
  pass
3712
3721
 
3713
3722
  # function_data["colour_theme_number"] = 3
3714
- # function_data["modes"] = [
3715
- # {
3716
- # 'filter': '',
3717
- # 'sort': 0,
3718
- # 'name': 'All',
3719
- # },
3720
- # {
3721
- # 'filter': '--2 miss',
3722
- # 'name': 'miss',
3723
- # },
3724
- # {
3725
- # 'filter': '--2 mp4',
3726
- # 'name': 'mp4',
3727
- # },
3728
- # ]
3723
+ function_data["modes"] = [
3724
+ {
3725
+ 'filter': '',
3726
+ 'sort': 0,
3727
+ 'name': 'All',
3728
+ },
3729
+ {
3730
+ 'filter': '--2 miss',
3731
+ 'name': 'miss',
3732
+ },
3733
+ {
3734
+ 'filter': '--2 mp4',
3735
+ 'name': 'mp4',
3736
+ },
3737
+ ]
3729
3738
  highlights = [
3730
3739
  {
3731
3740
  "field": 1,
@@ -34,6 +34,7 @@ def filter_items(items: list[list[str]], indexed_items: list[Tuple[int, list[str
34
34
  Returns indexed_items, which is a list of tuples; each tuple consists of the index and the data of the matching row in the original items list.
35
35
  """
36
36
  logger.info("function: filter_items (filtering.py)")
37
+ if items in [[], [[]]]: return []
37
38
 
38
39
 
39
40
  invert_filter = False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: listpick
3
- Version: 0.1.15.3
3
+ Version: 0.1.15.4
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=-Jnm8CtNGVX2tO5y5yVua_jlrx4md9Ub9uKh6B2FAvQ,193462
3
+ listpick/listpick_app.py,sha256=5TgVHIyR1ssENY9F8hD2AUbzsMICDaIgc5-n7ct2igY,193813
4
4
  listpick/pane/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  listpick/pane/get_data.py,sha256=21PTDXt9HP-4vZV4QUM8sidTqDEaKnKCDshl3-cSRCo,2255
6
6
  listpick/pane/pane_functions.py,sha256=7xynpd3HjZnt6s9W0ZsJlrmYvGCMstAI5OJ7EuQSzdg,3092
@@ -16,7 +16,7 @@ listpick/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  listpick/utils/clipboard_operations.py,sha256=ORdNm2kgGbfs51xJSvgJPERgoSmBgT11axuMkvSoP9A,3133
17
17
  listpick/utils/config.py,sha256=MEnAZg2Rhfl38XofEIN0uoVAOY7I0ftc79Evk3fOiVw,1654
18
18
  listpick/utils/dump.py,sha256=60YVIMNtBoYvWhmzfTJOsNGcetOvcCB3_T7yv-bYTPQ,3838
19
- listpick/utils/filtering.py,sha256=uS9sW0inmFvq0cIrwRC1BfuP8kjAD5IWWtls4jGB-70,1199
19
+ listpick/utils/filtering.py,sha256=59_YIEYRV0ovnjF4iyuShq276FMAx5gBD9m3mE9IqJg,1237
20
20
  listpick/utils/generate_data.py,sha256=7sv6JRhk0-Gcj4kOlkzx4qPNBJZ-GFWg9vM77GktzpI,3073
21
21
  listpick/utils/graphing.py,sha256=ugjAH8js_iH7hulg4SySxb_W_f8B6GhTaceN5i7DID4,6954
22
22
  listpick/utils/keycodes.py,sha256=ZGkw1-4szxPnP81wj80r92L6_neIOlBBjQltEieCwnk,2696
@@ -29,9 +29,9 @@ listpick/utils/sorting.py,sha256=WZZiVlVA3Zkcpwji3U5SNFlQ14zVEk3cZJtQirBkecQ,532
29
29
  listpick/utils/table_to_list_of_lists.py,sha256=XBj7eGBDF15BRME-swnoXyOfZWxXCxrXp0pzsBfcJ5g,12224
30
30
  listpick/utils/user_input.py,sha256=oyJZPAwA7UGAclPhdPL44tKnPIVNHWhX-tZEnCdBKC0,4318
31
31
  listpick/utils/utils.py,sha256=McOl9uT3jh7l4TIWeSd8ZGjK_e7r0YZF0Gl20yI6fl0,13873
32
- listpick-0.1.15.3.dist-info/licenses/LICENSE.txt,sha256=2mP-MRHJptADDNE9VInMNg1tE-C6Qv93Z4CCQKrpg9w,1061
33
- listpick-0.1.15.3.dist-info/METADATA,sha256=wnUaf3pU1_iLyTjpaXc5uXRRl8a8zLc51jdlhjf-gzI,8131
34
- listpick-0.1.15.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
35
- listpick-0.1.15.3.dist-info/entry_points.txt,sha256=-QCf_BKIkUz35Y9nkYpjZWs2Qg0KfRna2PAs5DnF6BE,43
36
- listpick-0.1.15.3.dist-info/top_level.txt,sha256=5mtsGEz86rz3qQDe0D463gGjAfSp6A3EWg4J4AGYr-Q,9
37
- listpick-0.1.15.3.dist-info/RECORD,,
32
+ listpick-0.1.15.4.dist-info/licenses/LICENSE.txt,sha256=2mP-MRHJptADDNE9VInMNg1tE-C6Qv93Z4CCQKrpg9w,1061
33
+ listpick-0.1.15.4.dist-info/METADATA,sha256=k72_XlnzWvZSrL-6V68XRy8WbkhxdJfy7NQQ8DaRIcU,8131
34
+ listpick-0.1.15.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
35
+ listpick-0.1.15.4.dist-info/entry_points.txt,sha256=-QCf_BKIkUz35Y9nkYpjZWs2Qg0KfRna2PAs5DnF6BE,43
36
+ listpick-0.1.15.4.dist-info/top_level.txt,sha256=5mtsGEz86rz3qQDe0D463gGjAfSp6A3EWg4J4AGYr-Q,9
37
+ listpick-0.1.15.4.dist-info/RECORD,,