listpick 0.1.16.5__py3-none-any.whl → 0.1.16.7__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 +11 -2
- listpick/ui/input_field.py +1 -19
- {listpick-0.1.16.5.dist-info → listpick-0.1.16.7.dist-info}/METADATA +1 -1
- {listpick-0.1.16.5.dist-info → listpick-0.1.16.7.dist-info}/RECORD +8 -8
- {listpick-0.1.16.5.dist-info → listpick-0.1.16.7.dist-info}/WHEEL +0 -0
- {listpick-0.1.16.5.dist-info → listpick-0.1.16.7.dist-info}/entry_points.txt +0 -0
- {listpick-0.1.16.5.dist-info → listpick-0.1.16.7.dist-info}/licenses/LICENSE.txt +0 -0
- {listpick-0.1.16.5.dist-info → listpick-0.1.16.7.dist-info}/top_level.txt +0 -0
listpick/listpick_app.py
CHANGED
|
@@ -56,7 +56,7 @@ class Picker:
|
|
|
56
56
|
stdscr: curses.window,
|
|
57
57
|
items: list[list[str]] = [],
|
|
58
58
|
cursor_pos: int = 0,
|
|
59
|
-
colours: dict =
|
|
59
|
+
colours: dict = {},
|
|
60
60
|
colour_theme_number: int = 3,
|
|
61
61
|
max_selected: int = -1,
|
|
62
62
|
top_gap: int =0,
|
|
@@ -195,7 +195,7 @@ class Picker:
|
|
|
195
195
|
self.stdscr = stdscr
|
|
196
196
|
self.items = items
|
|
197
197
|
self.cursor_pos = cursor_pos
|
|
198
|
-
self.colours =
|
|
198
|
+
self.colours = get_colours(colour_theme_number)
|
|
199
199
|
self.colour_theme_number = colour_theme_number
|
|
200
200
|
self.max_selected = max_selected
|
|
201
201
|
self.top_gap = top_gap
|
|
@@ -352,6 +352,7 @@ class Picker:
|
|
|
352
352
|
# Note: We have to set the footer after initialising the picker state so that the footer can use the get_function_data method
|
|
353
353
|
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)]
|
|
354
354
|
self.footer = self.footer_options[self.footer_style]
|
|
355
|
+
self.footer.adjust_sizes(self.term_h, self.term_w)
|
|
355
356
|
|
|
356
357
|
|
|
357
358
|
|
|
@@ -385,6 +386,7 @@ class Picker:
|
|
|
385
386
|
global COLOURS_SET
|
|
386
387
|
COLOURS_SET = False
|
|
387
388
|
self.colours_end = set_colours(pick=config["general"]["colour_theme_number"], start=1)
|
|
389
|
+
self.colours = get_colours(config["general"]["colour_theme_number"])
|
|
388
390
|
|
|
389
391
|
self.logger.info(f"function: set_config()")
|
|
390
392
|
if "general" in config:
|
|
@@ -502,11 +504,14 @@ class Picker:
|
|
|
502
504
|
self.notification_colours_start = 0
|
|
503
505
|
self.help_colours_start = 0
|
|
504
506
|
|
|
507
|
+
self.colours = get_colours(self.colour_theme_number)
|
|
508
|
+
|
|
505
509
|
|
|
506
510
|
debug_levels = [logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR, logging.CRITICAL]
|
|
507
511
|
dbglvl = debug_levels[self.debug_level]
|
|
508
512
|
self.logger = setup_logger(name="picker_log", log_file="picker.log", log_enabled=self.debug, level =dbglvl)
|
|
509
513
|
self.logger.info(f"Initialiasing Picker.")
|
|
514
|
+
self.update_term_size()
|
|
510
515
|
# self.notification(self.stdscr, message=repr(self.logger))
|
|
511
516
|
|
|
512
517
|
|
|
@@ -1808,6 +1813,7 @@ class Picker:
|
|
|
1808
1813
|
set_colours(self.colour_theme_number)
|
|
1809
1814
|
self.draw_screen()
|
|
1810
1815
|
self.notification(self.stdscr, message=f"Theme {self.colour_theme_number} applied.")
|
|
1816
|
+
self.colours = get_colours(self.colour_theme_number)
|
|
1811
1817
|
|
|
1812
1818
|
else:
|
|
1813
1819
|
self.user_settings = ""
|
|
@@ -2394,6 +2400,9 @@ class Picker:
|
|
|
2394
2400
|
self.logger.info(f"function: run()")
|
|
2395
2401
|
|
|
2396
2402
|
if self.get_footer_string_startup and self.footer_string_refresh_function != None:
|
|
2403
|
+
self.footer_string = " "
|
|
2404
|
+
self.footer.adjust_sizes(self.term_h, self.term_w)
|
|
2405
|
+
self.draw_screen()
|
|
2397
2406
|
self.footer_string = self.footer_string_refresh_function()
|
|
2398
2407
|
|
|
2399
2408
|
self.initialise_variables(get_data=self.get_data_startup)
|
listpick/ui/input_field.py
CHANGED
|
@@ -16,27 +16,9 @@ from datetime import datetime
|
|
|
16
16
|
import logging
|
|
17
17
|
|
|
18
18
|
logger = logging.getLogger('picker_log')
|
|
19
|
-
import select
|
|
20
|
-
import tty
|
|
21
19
|
from listpick.utils.user_input import get_char, open_tty
|
|
22
20
|
from listpick.utils import keycodes
|
|
23
21
|
|
|
24
|
-
# def open_tty():
|
|
25
|
-
# """ Return a file descriptor for the tty that we are opening"""
|
|
26
|
-
# tty_fd = os.open('/dev/tty', os.O_RDONLY)
|
|
27
|
-
# tty.setraw(tty_fd)
|
|
28
|
-
# return tty_fd
|
|
29
|
-
#
|
|
30
|
-
# def get_char(tty_fd, timeout: float = 0.2) -> int:
|
|
31
|
-
# """ Get character from a tty_fd with a timeout. """
|
|
32
|
-
# rlist, _, _ = select.select([tty_fd], [], [], timeout)
|
|
33
|
-
# if rlist:
|
|
34
|
-
# # key = ord(tty_fd.read(1))
|
|
35
|
-
# key = ord(os.read(tty_fd, 1))
|
|
36
|
-
# else:
|
|
37
|
-
# key = -1
|
|
38
|
-
# return key
|
|
39
|
-
|
|
40
22
|
def input_field(
|
|
41
23
|
stdscr: curses.window,
|
|
42
24
|
usrtxt:str="",
|
|
@@ -126,7 +108,7 @@ def input_field(
|
|
|
126
108
|
offscreen_x, offscreen_y = False, False
|
|
127
109
|
orig_x, orig_y = x, y
|
|
128
110
|
|
|
129
|
-
tty_fd = open_tty()
|
|
111
|
+
tty_fd, saved_terminal_state = open_tty()
|
|
130
112
|
|
|
131
113
|
# Input field loop
|
|
132
114
|
while True:
|
|
@@ -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=
|
|
3
|
+
listpick/listpick_app.py,sha256=uy-sJUsFMtzqGT6mF-8ISZ3ZL31vLLkFD_K4G3pFFsc,201936
|
|
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
|
|
@@ -10,7 +10,7 @@ listpick/ui/build_help.py,sha256=IpN4tX4U8ET3icRoTlF389VqVjVcPAon617vgstlPAc,107
|
|
|
10
10
|
listpick/ui/draw_screen.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
11
|
listpick/ui/footer.py,sha256=NcdH1uO_ma91m0qCczyQZ3zGrexfkiEnwDf5E4tHSMk,15089
|
|
12
12
|
listpick/ui/help_screen.py,sha256=zbfGIgb-IXtATpl4_Sx7nPbsnRXZ7eiMYlCKGS9EFmw,5608
|
|
13
|
-
listpick/ui/input_field.py,sha256=
|
|
13
|
+
listpick/ui/input_field.py,sha256=scJjvmSS0QqeDbCky7_0Zgt35Aki7gezRJkrQROlLg4,30034
|
|
14
14
|
listpick/ui/keys.py,sha256=1NCsOPFxhNuVPbO5vflcArNZ1jbBBerPQ3oZUAZDyPs,13682
|
|
15
15
|
listpick/ui/picker_colours.py,sha256=FFsyny_q0mGO6u7B1n7anuReBtP7Jw6LrgX5ycN-MRM,13413
|
|
16
16
|
listpick/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -31,9 +31,9 @@ listpick/utils/sorting.py,sha256=WZZiVlVA3Zkcpwji3U5SNFlQ14zVEk3cZJtQirBkecQ,532
|
|
|
31
31
|
listpick/utils/table_to_list_of_lists.py,sha256=XBj7eGBDF15BRME-swnoXyOfZWxXCxrXp0pzsBfcJ5g,12224
|
|
32
32
|
listpick/utils/user_input.py,sha256=L3ylI7nnuFM_TP1XKwpiKpxUSkNb2W5cr7mJjTmv_6E,4582
|
|
33
33
|
listpick/utils/utils.py,sha256=nsR6orCBQy3rTXrCweq8cV-RzRVU15v3J9NclPeAOJk,13741
|
|
34
|
-
listpick-0.1.16.
|
|
35
|
-
listpick-0.1.16.
|
|
36
|
-
listpick-0.1.16.
|
|
37
|
-
listpick-0.1.16.
|
|
38
|
-
listpick-0.1.16.
|
|
39
|
-
listpick-0.1.16.
|
|
34
|
+
listpick-0.1.16.7.dist-info/licenses/LICENSE.txt,sha256=2mP-MRHJptADDNE9VInMNg1tE-C6Qv93Z4CCQKrpg9w,1061
|
|
35
|
+
listpick-0.1.16.7.dist-info/METADATA,sha256=v3oID7w9HO00hpInLFNSD6-9c2REqPUROPALr18FWPA,8128
|
|
36
|
+
listpick-0.1.16.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
37
|
+
listpick-0.1.16.7.dist-info/entry_points.txt,sha256=-QCf_BKIkUz35Y9nkYpjZWs2Qg0KfRna2PAs5DnF6BE,43
|
|
38
|
+
listpick-0.1.16.7.dist-info/top_level.txt,sha256=5mtsGEz86rz3qQDe0D463gGjAfSp6A3EWg4J4AGYr-Q,9
|
|
39
|
+
listpick-0.1.16.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|