listpick 0.1.16.1__py3-none-any.whl → 0.1.16.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
@@ -1616,6 +1616,7 @@ class Picker:
1616
1616
  "split_right": False,
1617
1617
  "cell_cursor": False,
1618
1618
  "crosshair_cursor": False,
1619
+ "show_header": False,
1619
1620
 
1620
1621
  }
1621
1622
  OptionPicker = Picker(submenu_win, **notification_data)
listpick/ui/footer.py CHANGED
@@ -160,7 +160,7 @@ class StandardFooter(Footer):
160
160
  if state["footer_string"]:
161
161
  footer_string_width = min(w-1, len(state["footer_string"])+2)
162
162
 
163
- disp_string = f"{state["footer_string"][:footer_string_width]}"
163
+ disp_string = f"{state['footer_string'][:footer_string_width]}"
164
164
  disp_string = f" {disp_string:>{footer_string_width-2}} "
165
165
  self.stdscr.addstr(self.footer_string_y, w-footer_string_width-1, " "*footer_string_width, curses.color_pair(self.colours_start+24))
166
166
  self.stdscr.addstr(self.footer_string_y, w-footer_string_width-1, f"{disp_string}", curses.color_pair(self.colours_start+24))
@@ -259,7 +259,7 @@ class CompactFooter(Footer):
259
259
  if state["footer_string"]:
260
260
  footer_string_width = min(w-1, len(state["footer_string"])+2)
261
261
 
262
- disp_string = f"{state["footer_string"][:footer_string_width]}"
262
+ disp_string = f"{state['footer_string'][:footer_string_width]}"
263
263
  disp_string = f" {disp_string:>{footer_string_width-2}} "
264
264
  self.stdscr.addstr(h - 1, w-footer_string_width-1, " "*footer_string_width, curses.color_pair(self.colours_start+24))
265
265
  self.stdscr.addstr(h - 1, w-footer_string_width-1, f"{disp_string}", curses.color_pair(self.colours_start+24))
@@ -318,7 +318,7 @@ class NoFooter(Footer):
318
318
 
319
319
  if state["footer_string"]:
320
320
  footer_string_width = min(w-1, len(state["footer_string"])+2)
321
- disp_string = f"{state["footer_string"][:footer_string_width]}"
321
+ disp_string = f"{state['footer_string'][:footer_string_width]}"
322
322
  disp_string = f" {disp_string:>{footer_string_width-2}} "
323
323
  self.stdscr.addstr(h - 1, w-footer_string_width-1, " "*footer_string_width, curses.color_pair(self.colours_start+24))
324
324
  self.stdscr.addstr(h - 1, w-footer_string_width-1, f"{disp_string}", curses.color_pair(self.colours_start+24))
@@ -16,6 +16,7 @@ import logging
16
16
 
17
17
  logger = logging.getLogger('picker_log')
18
18
  import concurrent.futures
19
+ import re
19
20
 
20
21
  def generate_columns(funcs: list, files: list) -> list[list[str]]:
21
22
  """
@@ -79,7 +80,7 @@ def command_to_func(command: str) -> Callable:
79
80
  """
80
81
  logger.info("function: command_to_func (generate_data.py)")
81
82
 
82
- func = lambda arg: subprocess.run(command.format(repr(arg)), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).stdout.decode("utf-8")
83
+ func = lambda arg: subprocess.run(replace_braces(command, repr(arg)), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).stdout.decode("utf-8").strip()
83
84
  return func
84
85
 
85
86
  def load_environment(envs:dict):
@@ -91,6 +92,12 @@ def load_environment(envs:dict):
91
92
  if "cwd" in envs:
92
93
  os.chdir(os.path.expandvars(os.path.expanduser(envs["cwd"])))
93
94
 
95
+ def replace_braces(text, s):
96
+ text = re.sub(r'\{\{(.*?)\}\}', r'@@\1@@', text)
97
+ text = re.sub(r'\{\}', s, text)
98
+ text = re.sub(r'@@(.*?)@@', r'{{\1}}', text)
99
+ return text
100
+
94
101
 
95
102
  def read_toml(file_path) -> Tuple[dict, list, list]:
96
103
  """
@@ -25,6 +25,8 @@ import logging
25
25
  import threading
26
26
  from queue import PriorityQueue
27
27
  import time
28
+ import re
29
+ import shlex
28
30
 
29
31
  logger = logging.getLogger('picker_log')
30
32
 
@@ -84,7 +86,7 @@ def command_to_func(command: str) -> Callable:
84
86
  """
85
87
  logger.info("function: command_to_func (generate_data.py)")
86
88
 
87
- func = lambda arg: subprocess.run(command.format(repr(arg)), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).stdout.decode("utf-8").strip()
89
+ func = lambda arg: subprocess.run(replace_braces(command, arg), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).stdout.decode("utf-8").strip()
88
90
  return func
89
91
 
90
92
  def load_environment(envs:dict):
@@ -96,6 +98,11 @@ def load_environment(envs:dict):
96
98
  if "cwd" in envs:
97
99
  os.chdir(os.path.expandvars(os.path.expanduser(envs["cwd"])))
98
100
 
101
+ def replace_braces(text, s):
102
+ text = re.sub(r'\{\{(.*?)\}\}', r'@@\1@@', text)
103
+ text = re.sub(r'\{\}', shlex.quote(s), text)
104
+ text = re.sub(r'@@(.*?)@@', r'{{\1}}', text)
105
+ return text
99
106
 
100
107
  def read_toml(file_path) -> Tuple[dict, list, list]:
101
108
  """
listpick/utils/utils.py CHANGED
@@ -14,6 +14,7 @@ import tempfile
14
14
  import os
15
15
  from typing import Tuple, Dict
16
16
  import logging
17
+ import shlex
17
18
 
18
19
  logger = logging.getLogger('picker_log')
19
20
 
@@ -290,9 +291,7 @@ def openFiles(files: list[str]) -> str:
290
291
  apps[app] = [t]
291
292
 
292
293
  return apps
293
- for i in range(len(files)):
294
- if ' ' in files[i] and files[i][0] not in ["'", '"']:
295
- files[i] = repr(files[i])
294
+ files = [shlex.quote(file) for file in files]
296
295
 
297
296
  types = get_mime_types(files)
298
297
  apps = get_applications(types.keys())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: listpick
3
- Version: 0.1.16.1
3
+ Version: 0.1.16.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,13 +1,13 @@
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=qJIQ38NB0U3IdQbIV8BkzK5O1xRVJApo20TNe8DRS9g,203638
3
+ listpick/listpick_app.py,sha256=MDErM54fA_qvgMbo-IGovnUoDliBbaMSEGbHno-zhHA,203676
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/pane_functions.py,sha256=_dL9jHpd3sT0enL9H_bMcUsBlMELXdtP9dtKFSC2KPQ,5117
7
7
  listpick/pane/pane_utils.py,sha256=OEL4yBnBlIiHnT5bYtb3nQMn3WUR0vVH0gAGCtL1t0o,2539
8
8
  listpick/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  listpick/ui/build_help.py,sha256=IpN4tX4U8ET3icRoTlF389VqVjVcPAon617vgstlPAc,10750
10
- listpick/ui/footer.py,sha256=OH27JLGvvq9TlUsI30ODG6cHvjm7NTGSbXvF6lN1qiY,15089
10
+ listpick/ui/footer.py,sha256=NcdH1uO_ma91m0qCczyQZ3zGrexfkiEnwDf5E4tHSMk,15089
11
11
  listpick/ui/help_screen.py,sha256=zbfGIgb-IXtATpl4_Sx7nPbsnRXZ7eiMYlCKGS9EFmw,5608
12
12
  listpick/ui/input_field.py,sha256=ylf3fiLXdAD4pueHWfzIrlwaRb9f5zm8f1UGkEPBxgM,30539
13
13
  listpick/ui/keys.py,sha256=1NCsOPFxhNuVPbO5vflcArNZ1jbBBerPQ3oZUAZDyPs,13682
@@ -17,8 +17,8 @@ listpick/utils/clipboard_operations.py,sha256=ORdNm2kgGbfs51xJSvgJPERgoSmBgT11ax
17
17
  listpick/utils/config.py,sha256=MEnAZg2Rhfl38XofEIN0uoVAOY7I0ftc79Evk3fOiVw,1654
18
18
  listpick/utils/dump.py,sha256=60YVIMNtBoYvWhmzfTJOsNGcetOvcCB3_T7yv-bYTPQ,3838
19
19
  listpick/utils/filtering.py,sha256=59_YIEYRV0ovnjF4iyuShq276FMAx5gBD9m3mE9IqJg,1237
20
- listpick/utils/generate_data.py,sha256=YxkAPDkQnkeBmxQq8K7n6so-OUKC8DCPZqoqixYO2jw,4438
21
- listpick/utils/generate_data_multithreaded.py,sha256=AvAeejmDujwTAueLnl9giC2NKxhrOmk1IILVQgE5M-g,6305
20
+ listpick/utils/generate_data.py,sha256=TCGwDrN49Xx33AdURpQRGi6Xi2uwjt96rEeWWYS8mFE,4649
21
+ listpick/utils/generate_data_multithreaded.py,sha256=eWtv-gDdlTWwURKdg2cThrRI0I02JQNmQIr6q9GqtDc,6527
22
22
  listpick/utils/graphing.py,sha256=ugjAH8js_iH7hulg4SySxb_W_f8B6GhTaceN5i7DID4,6954
23
23
  listpick/utils/keycodes.py,sha256=ZGkw1-4szxPnP81wj80r92L6_neIOlBBjQltEieCwnk,2696
24
24
  listpick/utils/options_selectors.py,sha256=fQqTCAqRsrMhZwXUtsPBm47svkaUaeJqWsMW7Q4JTYY,3083
@@ -29,10 +29,10 @@ listpick/utils/searching.py,sha256=Xk5UIqamNHL2L90z3ACB_Giqdpi9iRKoAJ6pKaqaD7Q,3
29
29
  listpick/utils/sorting.py,sha256=WZZiVlVA3Zkcpwji3U5SNFlQ14zVEk3cZJtQirBkecQ,5329
30
30
  listpick/utils/table_to_list_of_lists.py,sha256=XBj7eGBDF15BRME-swnoXyOfZWxXCxrXp0pzsBfcJ5g,12224
31
31
  listpick/utils/user_input.py,sha256=oyJZPAwA7UGAclPhdPL44tKnPIVNHWhX-tZEnCdBKC0,4318
32
- listpick/utils/utils.py,sha256=QptLnqT15Z3G7xoq-6Q8e4-aZRFClTdb3h0l42di11s,13810
33
- listpick-0.1.16.1.dist-info/licenses/LICENSE.txt,sha256=2mP-MRHJptADDNE9VInMNg1tE-C6Qv93Z4CCQKrpg9w,1061
34
- listpick-0.1.16.1.dist-info/METADATA,sha256=hCLCmHHqyeHyeI9o9fRBiAFwRgrSNZ-GaD9kTENOnik,8128
35
- listpick-0.1.16.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
36
- listpick-0.1.16.1.dist-info/entry_points.txt,sha256=-QCf_BKIkUz35Y9nkYpjZWs2Qg0KfRna2PAs5DnF6BE,43
37
- listpick-0.1.16.1.dist-info/top_level.txt,sha256=5mtsGEz86rz3qQDe0D463gGjAfSp6A3EWg4J4AGYr-Q,9
38
- listpick-0.1.16.1.dist-info/RECORD,,
32
+ listpick/utils/utils.py,sha256=nsR6orCBQy3rTXrCweq8cV-RzRVU15v3J9NclPeAOJk,13741
33
+ listpick-0.1.16.4.dist-info/licenses/LICENSE.txt,sha256=2mP-MRHJptADDNE9VInMNg1tE-C6Qv93Z4CCQKrpg9w,1061
34
+ listpick-0.1.16.4.dist-info/METADATA,sha256=VwWPk2nx7z_mnZJz8ips6nLYm0_YZcIxP6Y8KLegyIA,8128
35
+ listpick-0.1.16.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
36
+ listpick-0.1.16.4.dist-info/entry_points.txt,sha256=-QCf_BKIkUz35Y9nkYpjZWs2Qg0KfRna2PAs5DnF6BE,43
37
+ listpick-0.1.16.4.dist-info/top_level.txt,sha256=5mtsGEz86rz3qQDe0D463gGjAfSp6A3EWg4J4AGYr-Q,9
38
+ listpick-0.1.16.4.dist-info/RECORD,,