5from typing
import Any, Tuple
7from AthenaConfiguration.iconfTool.gui.modals
import (
12from AthenaConfiguration.iconfTool.gui.pad
import Pad
13from AthenaConfiguration.iconfTool.models.loaders
import (
14 ComponentsDiffFileLoader,
17from AthenaConfiguration.iconfTool.models.structure
import ComponentsStructure
19logger = logging.getLogger(__name__)
23 def __init__(self, data_loader: ComponentsFileLoader) ->
None:
49 def search(self, strict: bool =
False) ->
None:
52 b_startx: int = self.
width - search_size - 2
53 b_width: int = search_size
55 cursor_pos: Tuple[int, int] = curses.getsyx()
56 search: SearchModal = SearchModal(
57 b_startx, b_starty, b_width, b_height
59 text: str = search.edit()
60 curses.setsyx(cursor_pos[0], cursor_pos[1])
69 b_width: int = search_size
71 b_starty: int = self.
screen.getmaxyx()[0] - b_height
72 b_startx: int = self.
width - search_size - 2
73 cursor_pos: Tuple[int, int] = curses.getsyx()
74 search: SingleHelpModal = SingleHelpModal(
75 b_startx, b_starty, b_width, b_height
77 curses.setsyx(*cursor_pos)
79 self.
pad.initialize_cursor()
84 event: int = self.
screen.getch()
85 logger.debug(f
"Key pressed: [{event}, {chr(event)}]")
88 elif event == ord(
"m"):
90 elif event == ord(
"h"):
92 elif event == ord(
"r"):
97 self.
pad.handle_event(event)
101 def __init__(self, data_loader: ComponentsDiffFileLoader) ->
None:
125 int(self.
width / 2) - 1,
127 int(self.
width / 2) + 2,
145 search_size: int = 50
147 b_startx: int = self.
width - search_size - 2
148 b_width: int = search_size
150 cursor_pos: Tuple[int, int] = curses.getsyx()
151 search: SearchModal = SearchModal(
152 b_startx, b_starty, b_width, b_height
154 text: str = search.edit()
155 curses.setsyx(cursor_pos[0], cursor_pos[1])
177 search_size: int = 60
178 b_width: int = search_size
180 b_starty: int = self.
screen.getmaxyx()[0] - b_height
181 b_startx: int = self.
width - search_size - 2
182 cursor_pos: Tuple[int, int] = curses.getsyx()
183 search: DoubleHelpModal = DoubleHelpModal(
184 b_startx, b_starty, b_width, b_height
186 curses.setsyx(*cursor_pos)
193 event = self.
screen.getch()
194 logger.debug(f
"Key pressed: [{event}, {chr(event)}]")
195 if event == ord(
"q"):
197 elif event == ord(
"\t"):
199 elif event == ord(
"h"):
201 elif event == ord(
"m"):
203 elif event == ord(
"r"):