listpick 0.1.13.26__py3-none-any.whl → 0.1.13.27__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
@@ -318,6 +318,7 @@ class Picker:
318
318
 
319
319
 
320
320
  # Note: We have to set the footer after initialising the picker state so that the footer can use the get_function_data method
321
+ self.get_function_data()
321
322
  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)]
322
323
  self.footer = self.footer_options[self.footer_style]
323
324
 
@@ -1188,7 +1189,6 @@ class Picker:
1188
1189
  self.selections = {i:False for i in range(len(self.indexed_items))}
1189
1190
  self.cursor_pos = min(self.cursor_pos, len(self.indexed_items)-1)
1190
1191
  self.initialise_variables()
1191
- self.draw_screen(self.indexed_items, self.highlights)
1192
1192
 
1193
1193
 
1194
1194
  def choose_option(
@@ -1486,7 +1486,6 @@ class Picker:
1486
1486
  """ Toggle selection of item at index. """
1487
1487
  self.logger.info(f"function: toggle_item()")
1488
1488
  self.selections[index] = not self.selections[index]
1489
- self.draw_screen(self.indexed_items, self.highlights)
1490
1489
 
1491
1490
  def select_all(self) -> None:
1492
1491
  """ Select all in indexed_items. """
@@ -1498,10 +1497,6 @@ class Picker:
1498
1497
  for row in range(len(self.indexed_items)):
1499
1498
  self.selected_cells_by_row[row] = list(range(len(self.indexed_items[row][1])))
1500
1499
 
1501
-
1502
-
1503
- self.draw_screen(self.indexed_items, self.highlights)
1504
-
1505
1500
  def deselect_all(self) -> None:
1506
1501
  """ Deselect all items in indexed_items. """
1507
1502
  self.logger.info(f"function: deselect_all()")
@@ -1510,7 +1505,6 @@ class Picker:
1510
1505
  for i in self.cell_selections.keys():
1511
1506
  self.cell_selections[i] = False
1512
1507
  self.selected_cells_by_row = {}
1513
- self.draw_screen(self.indexed_items, self.highlights)
1514
1508
 
1515
1509
  def handle_visual_selection(self, selecting:bool = True) -> None:
1516
1510
  """ Toggle visual selection or deselection. """
@@ -1554,8 +1548,6 @@ class Picker:
1554
1548
  self.end_selection = -1
1555
1549
  self.is_selecting = False
1556
1550
 
1557
- self.draw_screen(self.indexed_items, self.highlights)
1558
-
1559
1551
  elif self.is_deselecting:
1560
1552
  self.end_selection = self.indexed_items[self.cursor_pos][0]
1561
1553
  self.end_selection = self.cursor_pos
@@ -1587,7 +1579,6 @@ class Picker:
1587
1579
  self.start_selection = -1
1588
1580
  self.end_selection = -1
1589
1581
  self.is_deselecting = False
1590
- self.draw_screen(self.indexed_items, self.highlights)
1591
1582
 
1592
1583
  def cursor_down(self, count=1) -> bool:
1593
1584
  """ Move cursor down. """
@@ -1979,7 +1970,10 @@ class Picker:
1979
1970
 
1980
1971
  initial_time = time.time()
1981
1972
 
1982
- self.draw_screen(self.indexed_items, self.highlights, clear=False)
1973
+ try:
1974
+ self.draw_screen(self.indexed_items, self.highlights, clear=False)
1975
+ except:
1976
+ pass
1983
1977
 
1984
1978
  self.refreshing_data = False
1985
1979
  self.data_ready = False
@@ -2893,7 +2887,7 @@ class Picker:
2893
2887
  self.stdscr.clear()
2894
2888
  self.stdscr.refresh()
2895
2889
  self.initialise_variables()
2896
- self.draw_screen(self.indexed_items, self.highlights)
2890
+ # self.draw_screen(self.indexed_items, self.highlights)
2897
2891
 
2898
2892
 
2899
2893
 
@@ -3165,6 +3159,7 @@ def main() -> None:
3165
3159
  function_data["display_infobox"] = True
3166
3160
  function_data["infobox_items"] = [["1"], ["2"], ["3"]]
3167
3161
  function_data["infobox_title"] = "Title"
3162
+ function_data["footer_string"] = "Title"
3168
3163
 
3169
3164
 
3170
3165
  # function_data["debug"] = True
listpick/ui/footer.py CHANGED
@@ -50,6 +50,9 @@ class StandardFooter(Footer):
50
50
  def draw(self, h, w):
51
51
  state = self.get_state()
52
52
  # Fill background
53
+ if "footer_string" in state and state["footer_string"]: self.height = 3
54
+ else: self.height = 2
55
+
53
56
  for i in range(self.height):
54
57
  self.stdscr.addstr(h-self.height+i, 0, ' '*(w-1), curses.color_pair(self.colours_start+20))
55
58
 
@@ -63,19 +66,14 @@ class StandardFooter(Footer):
63
66
 
64
67
  picker_info_y = h-3
65
68
  sort_info_y = h-2
66
- self.height = 3
67
-
68
69
  else:
69
70
  picker_info_y = h-2
70
71
  sort_info_y = h-1
71
- ""
72
72
  select_mode = "C"
73
73
  if state["is_selecting"]: select_mode = "VS"
74
74
  elif state["is_deselecting"]: select_mode = "VDS"
75
75
  if state["pin_cursor"]: select_mode = f"{select_mode} "
76
76
  self.stdscr.addstr(h - 1, w-35, f"{select_mode:>33} ", curses.color_pair(self.colours_start+20))
77
- self.height = 2
78
-
79
77
 
80
78
  if state["filter_query"]:
81
79
  self.stdscr.addstr(h - 2, 2, f" Filter: {state['filter_query']} "[:w-40], curses.color_pair(self.colours_start+20) | curses.A_BOLD)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: listpick
3
- Version: 0.1.13.26
3
+ Version: 0.1.13.27
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,9 +1,9 @@
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=iskUM-xlwzBbS3Z-DIu0T5Ug_LL51PkmsxATnEiOpK8,164227
3
+ listpick/listpick_app.py,sha256=oSbKJFzg8gea8EMXmJa7_7UAoAXBZ7--Kt-yBui_RLk,164021
4
4
  listpick/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  listpick/ui/build_help.py,sha256=_rVKKrX3HfFJtw-pyeNb2lQWbml4-AAw8sZIUYGn97Y,8731
6
- listpick/ui/footer.py,sha256=s1L68MNmhWwbWRy0mn0ChmnE_dMQBAzNlTv917pyHE0,10673
6
+ listpick/ui/footer.py,sha256=4PO7gS-NSk6zfc2DAwSFPU6Ch_HYfu0L_57u93zfyjk,10711
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
9
  listpick/ui/keys.py,sha256=TzaadgBP_rC7jbp--RFJZDOkHd0EB4K1wToDTiVs6CI,13029
@@ -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=T-i-nV1p6g8UagdgUPKrhIGpKY_YXZDxf4xZzcPepNA,7635
25
25
  listpick/utils/utils.py,sha256=8nsjjTDQH13tHTU93YcKklLQ_uuMAz-rbDTmao83T4Q,12783
26
- listpick-0.1.13.26.dist-info/licenses/LICENSE.txt,sha256=2mP-MRHJptADDNE9VInMNg1tE-C6Qv93Z4CCQKrpg9w,1061
27
- listpick-0.1.13.26.dist-info/METADATA,sha256=L8tWg3cUCTyOklDM1hcrxlxX0rvwSdFjCmxF_fO4XBU,7988
28
- listpick-0.1.13.26.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
29
- listpick-0.1.13.26.dist-info/entry_points.txt,sha256=-QCf_BKIkUz35Y9nkYpjZWs2Qg0KfRna2PAs5DnF6BE,43
30
- listpick-0.1.13.26.dist-info/top_level.txt,sha256=5mtsGEz86rz3qQDe0D463gGjAfSp6A3EWg4J4AGYr-Q,9
31
- listpick-0.1.13.26.dist-info/RECORD,,
26
+ listpick-0.1.13.27.dist-info/licenses/LICENSE.txt,sha256=2mP-MRHJptADDNE9VInMNg1tE-C6Qv93Z4CCQKrpg9w,1061
27
+ listpick-0.1.13.27.dist-info/METADATA,sha256=n4VSEQvyg6jXBLT3Yp2ifBrUsEnMhKh_iW-WisQBuPg,7988
28
+ listpick-0.1.13.27.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
29
+ listpick-0.1.13.27.dist-info/entry_points.txt,sha256=-QCf_BKIkUz35Y9nkYpjZWs2Qg0KfRna2PAs5DnF6BE,43
30
+ listpick-0.1.13.27.dist-info/top_level.txt,sha256=5mtsGEz86rz3qQDe0D463gGjAfSp6A3EWg4J4AGYr-Q,9
31
+ listpick-0.1.13.27.dist-info/RECORD,,