listpick 0.1.15.8__py3-none-any.whl → 0.1.15.10__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
@@ -690,6 +690,7 @@ class Picker:
690
690
  else:
691
691
  self.cursor_pos = 0
692
692
 
693
+ self.right_pane_index = max(0, min(self.right_pane_index, len(self.right_panes)-1))
693
694
 
694
695
 
695
696
 
@@ -1180,8 +1181,16 @@ class Picker:
1180
1181
  self.stdscr.addstr(self.term_h - 1, self.term_w-footer_string_width-1, f"{disp_string}", curses.color_pair(self.colours_start+24))
1181
1182
 
1182
1183
  if self.split_right and len(self.right_panes):
1184
+ # If we need to refresh the data then do so.
1185
+ if self.right_panes[self.right_pane_index]["auto_refresh"] and ((time.time() - self.initial_split_time) > self.right_panes[self.right_pane_index]["refresh_time"]):
1186
+ get_data = self.right_panes[self.right_pane_index]["get_data"]
1187
+ data = self.right_panes[self.right_pane_index]["data"]
1188
+ self.right_panes[self.right_pane_index]["data"] = get_data(data, self.get_function_data())
1189
+ self.initial_split_time = time.time()
1190
+
1183
1191
  draw_pane = self.right_panes[self.right_pane_index]["display"]
1184
1192
  data = self.right_panes[self.right_pane_index]["data"]
1193
+
1185
1194
  draw_pane(
1186
1195
  self.stdscr,
1187
1196
  x = self.rows_w,
@@ -2316,6 +2325,7 @@ class Picker:
2316
2325
  def cycle_right_pane(self, increment=1):
2317
2326
  if len(self.right_panes) > 1:
2318
2327
  self.right_pane_index = (self.right_pane_index+1)%len(self.right_panes)
2328
+ self.initial_split_time = self.initial_split_time - self.right_panes[self.right_pane_index]["refresh_time"]
2319
2329
 
2320
2330
  def run(self) -> Tuple[list[int], str, dict]:
2321
2331
  """ Run the picker. """
@@ -2328,9 +2338,9 @@ class Picker:
2328
2338
 
2329
2339
  self.draw_screen(self.indexed_items, self.highlights)
2330
2340
 
2331
- initial_time = time.time()
2332
- initial_time_footer = time.time()-self.footer_timer
2333
- initial_split_time = time.time()-200
2341
+ self.initial_time = time.time()
2342
+ self.initial_time_footer = time.time()-self.footer_timer
2343
+ self.initial_split_time = time.time()-200
2334
2344
 
2335
2345
  if self.startup_notification:
2336
2346
  self.notification(self.stdscr, message=self.startup_notification)
@@ -2410,14 +2420,14 @@ class Picker:
2410
2420
  self.logger.debug(f"Data ready after refresh")
2411
2421
  self.initialise_variables()
2412
2422
 
2413
- initial_time = time.time()
2423
+ self.initial_time = time.time()
2414
2424
 
2415
2425
  self.draw_screen(self.indexed_items, self.highlights, clear=False)
2416
2426
 
2417
2427
  self.refreshing_data = False
2418
2428
  self.data_ready = False
2419
2429
 
2420
- elif self.check_key("refresh", key, self.keys_dict) or self.remapped_key(key, curses.KEY_F5, self.key_remappings) or (self.auto_refresh and (time.time() - initial_time) >= self.timer):
2430
+ elif self.check_key("refresh", key, self.keys_dict) or self.remapped_key(key, curses.KEY_F5, self.key_remappings) or (self.auto_refresh and (time.time() - self.initial_time) >= self.timer):
2421
2431
  self.logger.debug(f"Get new data (refresh).")
2422
2432
  self.stdscr.addstr(0,self.term_w-3,"  ", curses.color_pair(self.colours_start+21) | curses.A_BOLD)
2423
2433
  self.stdscr.refresh()
@@ -2431,30 +2441,30 @@ class Picker:
2431
2441
  return [], "refresh", function_data
2432
2442
 
2433
2443
  # Refresh data synchronously
2434
- # if self.check_key("refresh", key, self.keys_dict) or self.remapped_key(key, curses.KEY_F5, self.key_remappings) or (self.auto_refresh and (time.time() - initial_time) > self.timer):
2444
+ # if self.check_key("refresh", key, self.keys_dict) or self.remapped_key(key, curses.KEY_F5, self.key_remappings) or (self.auto_refresh and (time.time() - self.initial_time) > self.timer):
2435
2445
  # self.stdscr.addstr(0,w-3,"  ", curses.color_pair(self.colours_start+21) | curses.A_BOLD)
2436
2446
  # self.stdscr.refresh()
2437
2447
  # if self.get_new_data and self.refresh_function:
2438
2448
  # self.initialise_variables(get_data=True)
2439
2449
  #
2440
- # initial_time = time.time()
2450
+ # self.initial_time = time.time()
2441
2451
  # self.draw_screen(self.indexed_items, self.highlights, clear=False)
2442
2452
  # else:
2443
2453
  #
2444
2454
  # function_data = self.get_function_data()
2445
2455
  # return [], "refresh", function_data
2446
2456
 
2447
- if self.footer_string_auto_refresh and ((time.time() - initial_time_footer) > self.footer_timer):
2457
+ if self.footer_string_auto_refresh and ((time.time() - self.initial_time_footer) > self.footer_timer):
2448
2458
  self.logger.debug(f"footer_string_auto_refresh")
2449
2459
  self.footer_string = self.footer_string_refresh_function()
2450
- initial_time_footer = time.time()
2460
+ self.initial_time_footer = time.time()
2451
2461
  self.draw_screen(self.indexed_items, self.highlights)
2452
2462
 
2453
- if self.split_right and len(self.right_panes) and self.right_panes[self.right_pane_index]["auto_refresh"] and ((time.time() - initial_split_time) > self.right_panes[self.right_pane_index]["refresh_time"]):
2463
+ if self.split_right and len(self.right_panes) and self.right_panes[self.right_pane_index]["auto_refresh"] and ((time.time() - self.initial_split_time) > self.right_panes[self.right_pane_index]["refresh_time"]):
2454
2464
  get_data = self.right_panes[self.right_pane_index]["get_data"]
2455
2465
  data = self.right_panes[self.right_pane_index]["data"]
2456
2466
  self.right_panes[self.right_pane_index]["data"] = get_data(data, self.get_function_data())
2457
- initial_split_time = time.time()
2467
+ self.initial_split_time = time.time()
2458
2468
 
2459
2469
  if self.check_key("help", key, self.keys_dict):
2460
2470
  self.logger.info(f"key_function help")
@@ -3848,6 +3858,8 @@ def main() -> None:
3848
3858
  # function_data["debug_level"] = 1
3849
3859
 
3850
3860
  function_data["split_right"] = False
3861
+ function_data["right_pane_index"] = 3
3862
+
3851
3863
  function_data["right_panes"] = [
3852
3864
  # Graph or random numbers generated each second
3853
3865
  {
@@ -3883,7 +3895,7 @@ def main() -> None:
3883
3895
  "get_data": data_refresh_randint_title,
3884
3896
  "display": right_split_display_list,
3885
3897
  "data": ["Files", []],
3886
- "refresh_time": 0.1,
3898
+ "refresh_time": 2,
3887
3899
  },
3888
3900
  # Nopane
3889
3901
  {
@@ -3892,7 +3904,7 @@ def main() -> None:
3892
3904
  "get_data": lambda data, state: [],
3893
3905
  "display": lambda scr, x, y, w, h, state, row, cell, data: [],
3894
3906
  "data": ["Files", []],
3895
- "refresh_time": 0.1,
3907
+ "refresh_time": 1,
3896
3908
  },
3897
3909
  ]
3898
3910
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: listpick
3
- Version: 0.1.15.8
3
+ Version: 0.1.15.10
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=NAD1T5i2CDD_WOvHk5ZjJXRpdeN_76ZVRQA8cveK4hk,199678
3
+ listpick/listpick_app.py,sha256=ttUfM3x4q-3wAD8nPGQOUcA1b6gZWZ572OJKbGH2Ovc,200530
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=Hpc6wSFeiTmQTyO6n13muenarZMvzFw0OCmjJJy2lTY,3910
@@ -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=QptLnqT15Z3G7xoq-6Q8e4-aZRFClTdb3h0l42di11s,13810
32
- listpick-0.1.15.8.dist-info/licenses/LICENSE.txt,sha256=2mP-MRHJptADDNE9VInMNg1tE-C6Qv93Z4CCQKrpg9w,1061
33
- listpick-0.1.15.8.dist-info/METADATA,sha256=RQbxnHkBzede_XRsNo2USmf9wigm9AZI6ACLsw5ZJBQ,8131
34
- listpick-0.1.15.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
35
- listpick-0.1.15.8.dist-info/entry_points.txt,sha256=-QCf_BKIkUz35Y9nkYpjZWs2Qg0KfRna2PAs5DnF6BE,43
36
- listpick-0.1.15.8.dist-info/top_level.txt,sha256=5mtsGEz86rz3qQDe0D463gGjAfSp6A3EWg4J4AGYr-Q,9
37
- listpick-0.1.15.8.dist-info/RECORD,,
32
+ listpick-0.1.15.10.dist-info/licenses/LICENSE.txt,sha256=2mP-MRHJptADDNE9VInMNg1tE-C6Qv93Z4CCQKrpg9w,1061
33
+ listpick-0.1.15.10.dist-info/METADATA,sha256=FaUjvHk9A27z_fY8P14UrEYzrhCgsiMft5I1o_-qqEY,8132
34
+ listpick-0.1.15.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
35
+ listpick-0.1.15.10.dist-info/entry_points.txt,sha256=-QCf_BKIkUz35Y9nkYpjZWs2Qg0KfRna2PAs5DnF6BE,43
36
+ listpick-0.1.15.10.dist-info/top_level.txt,sha256=5mtsGEz86rz3qQDe0D463gGjAfSp6A3EWg4J4AGYr-Q,9
37
+ listpick-0.1.15.10.dist-info/RECORD,,