listpick 0.1.13.25__py3-none-any.whl → 0.1.13.26__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 +26 -22
- {listpick-0.1.13.25.dist-info → listpick-0.1.13.26.dist-info}/METADATA +1 -1
- {listpick-0.1.13.25.dist-info → listpick-0.1.13.26.dist-info}/RECORD +7 -7
- {listpick-0.1.13.25.dist-info → listpick-0.1.13.26.dist-info}/WHEEL +0 -0
- {listpick-0.1.13.25.dist-info → listpick-0.1.13.26.dist-info}/entry_points.txt +0 -0
- {listpick-0.1.13.25.dist-info → listpick-0.1.13.26.dist-info}/licenses/LICENSE.txt +0 -0
- {listpick-0.1.13.25.dist-info → listpick-0.1.13.26.dist-info}/top_level.txt +0 -0
listpick/listpick_app.py
CHANGED
|
@@ -324,6 +324,7 @@ class Picker:
|
|
|
324
324
|
# self.footer = CompactFooter(self.stdscr, colours_start, self.get_function_data)
|
|
325
325
|
|
|
326
326
|
|
|
327
|
+
|
|
327
328
|
def calculate_section_sizes(self):
|
|
328
329
|
"""
|
|
329
330
|
Calculte the following for the Picker:
|
|
@@ -598,6 +599,8 @@ class Picker:
|
|
|
598
599
|
else:
|
|
599
600
|
self.cursor_pos = 0
|
|
600
601
|
|
|
602
|
+
if self.display_infobox:
|
|
603
|
+
self.infobox_picker = self.infobox(self.stdscr, self.infobox_items, self.infobox_title)
|
|
601
604
|
|
|
602
605
|
|
|
603
606
|
def move_column(self, direction: int) -> None:
|
|
@@ -988,15 +991,23 @@ class Picker:
|
|
|
988
991
|
## Display infobox
|
|
989
992
|
if self.display_infobox:
|
|
990
993
|
# self.stdscr.refresh()
|
|
991
|
-
self.infobox(self.stdscr, message=self.infobox_items, title=self.infobox_title)
|
|
994
|
+
# self.infobox(self.stdscr, message=self.infobox_items, title=self.infobox_title)
|
|
995
|
+
|
|
996
|
+
infobox_width, infobox_height = w//2, 3*h//5
|
|
997
|
+
infobox_x, infobox_y = w - (infobox_width + 4), 3
|
|
998
|
+
self.infobox_picker.stdscr.mvwin(infobox_y, infobox_x)
|
|
999
|
+
self.infobox_picker.stdscr.resize(infobox_height, infobox_width)
|
|
1000
|
+
self.infobox_picker.run()
|
|
1001
|
+
self.infobox_picker.stdscr.noutrefresh()
|
|
1002
|
+
else:
|
|
1003
|
+
self.stdscr.noutrefresh()
|
|
992
1004
|
|
|
993
|
-
# if not self.display_only:
|
|
994
|
-
# self.stdscr.refresh()
|
|
995
|
-
# self.stdscr.timeout(2000) # timeout is set to 50 in order to get the infobox to be displayed so here we reset it to 2000
|
|
996
1005
|
|
|
1006
|
+
if not self.display_only:
|
|
1007
|
+
curses.doupdate()
|
|
997
1008
|
|
|
998
1009
|
|
|
999
|
-
def infobox(self, stdscr: curses.window, message:
|
|
1010
|
+
def infobox(self, stdscr: curses.window, message: list =[], title: str ="Infobox", colours_end: int = 0, duration: int = 4):
|
|
1000
1011
|
""" Display non-interactive infobox window. """
|
|
1001
1012
|
|
|
1002
1013
|
self.logger.info(f"function: infobox()")
|
|
@@ -1004,6 +1015,7 @@ class Picker:
|
|
|
1004
1015
|
notification_width, notification_height = w//2, 3*h//5
|
|
1005
1016
|
message_width = notification_width-5
|
|
1006
1017
|
|
|
1018
|
+
notification_x, notification_y = w-(notification_width+4), 3
|
|
1007
1019
|
if not message: message = "!!"
|
|
1008
1020
|
if isinstance(message, str):
|
|
1009
1021
|
submenu_items = [" "+message[i*message_width:(i+1)*message_width] for i in range(len(message)//message_width+1)]
|
|
@@ -1019,10 +1031,7 @@ class Picker:
|
|
|
1019
1031
|
# while True:
|
|
1020
1032
|
h, w = stdscr.getmaxyx()
|
|
1021
1033
|
|
|
1022
|
-
|
|
1023
|
-
submenu_win = self.stdscr.subpad(notification_height, notification_width, 3, w - (notification_width+4))
|
|
1024
|
-
submenu_win.erase()
|
|
1025
|
-
# submenu_win.untouchwin()
|
|
1034
|
+
submenu_win = self.stdscr.derwin(notification_height, notification_width, 3, w - (notification_width+4))
|
|
1026
1035
|
infobox_data = {
|
|
1027
1036
|
"items": submenu_items,
|
|
1028
1037
|
"colours": notification_colours,
|
|
@@ -1036,12 +1045,9 @@ class Picker:
|
|
|
1036
1045
|
"title": title,
|
|
1037
1046
|
"reset_colours": False,
|
|
1038
1047
|
}
|
|
1039
|
-
|
|
1040
|
-
# for i in range(3, 3+notification_height):
|
|
1041
|
-
# self.stdscr.addstr(i, w - (notification_width+4), ' '*notification_width, curses.color_pair(4))
|
|
1048
|
+
submenu_win.noutrefresh()
|
|
1042
1049
|
OptionPicker = Picker(submenu_win, **infobox_data)
|
|
1043
|
-
|
|
1044
|
-
submenu_win.refresh()
|
|
1050
|
+
return OptionPicker
|
|
1045
1051
|
|
|
1046
1052
|
|
|
1047
1053
|
def get_function_data(self) -> dict:
|
|
@@ -1936,7 +1942,7 @@ class Picker:
|
|
|
1936
1942
|
# curses.curs_set(0)
|
|
1937
1943
|
# stdscr.nodelay(1) # Non-blocking input
|
|
1938
1944
|
# stdscr.timeout(2000) # Set a timeout for getch() to ensure it does not block indefinitely
|
|
1939
|
-
self.stdscr.timeout(max(min(2000, int(self.timer*1000)//2, int(self.footer_timer*1000))//2, 20)) # Set a timeout for getch() to ensure it does not block indefinitely
|
|
1945
|
+
# self.stdscr.timeout(max(min(2000, int(self.timer*1000)//2, int(self.footer_timer*1000))//2, 20)) # Set a timeout for getch() to ensure it does not block indefinitely
|
|
1940
1946
|
|
|
1941
1947
|
if self.clear_on_start:
|
|
1942
1948
|
self.stdscr.clear()
|
|
@@ -1953,8 +1959,6 @@ class Picker:
|
|
|
1953
1959
|
self.draw_screen(self.indexed_items, self.highlights)
|
|
1954
1960
|
|
|
1955
1961
|
if self.display_only:
|
|
1956
|
-
# self.stdscr.refresh()
|
|
1957
|
-
# function_data = self.get_function_data()
|
|
1958
1962
|
return [], "", {}
|
|
1959
1963
|
|
|
1960
1964
|
# Main loop
|
|
@@ -1982,8 +1986,8 @@ class Picker:
|
|
|
1982
1986
|
|
|
1983
1987
|
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):
|
|
1984
1988
|
self.logger.debug(f"Get new data (refresh).")
|
|
1985
|
-
self.stdscr.addstr(0,w-3," ", curses.color_pair(self.colours_start+21) | curses.A_BOLD)
|
|
1986
|
-
self.stdscr.refresh()
|
|
1989
|
+
# self.stdscr.addstr(0,w-3," ", curses.color_pair(self.colours_start+21) | curses.A_BOLD)
|
|
1990
|
+
# self.stdscr.refresh()
|
|
1987
1991
|
if self.get_new_data and self.refresh_function:
|
|
1988
1992
|
self.refreshing_data = True
|
|
1989
1993
|
|
|
@@ -3158,9 +3162,9 @@ def main() -> None:
|
|
|
3158
3162
|
function_data["centre_in_terminal_vertical"] = True
|
|
3159
3163
|
function_data["highlight_full_row"] = True
|
|
3160
3164
|
function_data["pin_cursor"] = True
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3165
|
+
function_data["display_infobox"] = True
|
|
3166
|
+
function_data["infobox_items"] = [["1"], ["2"], ["3"]]
|
|
3167
|
+
function_data["infobox_title"] = "Title"
|
|
3164
3168
|
|
|
3165
3169
|
|
|
3166
3170
|
# function_data["debug"] = 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=iskUM-xlwzBbS3Z-DIu0T5Ug_LL51PkmsxATnEiOpK8,164227
|
|
4
4
|
listpick/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
listpick/ui/build_help.py,sha256=_rVKKrX3HfFJtw-pyeNb2lQWbml4-AAw8sZIUYGn97Y,8731
|
|
6
6
|
listpick/ui/footer.py,sha256=s1L68MNmhWwbWRy0mn0ChmnE_dMQBAzNlTv917pyHE0,10673
|
|
@@ -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.
|
|
27
|
-
listpick-0.1.13.
|
|
28
|
-
listpick-0.1.13.
|
|
29
|
-
listpick-0.1.13.
|
|
30
|
-
listpick-0.1.13.
|
|
31
|
-
listpick-0.1.13.
|
|
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,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|