mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-03 06:56:44 +01:00
Updated for KeyboardInterrupt
This commit is contained in:
parent
10865d029a
commit
2f2c7e3dbf
1 changed files with 20 additions and 8 deletions
|
@ -29,8 +29,12 @@ class DialogBox(Configs):
|
|||
if self.dialog:
|
||||
more_kwargs.update({"item_help": True})
|
||||
|
||||
code, tags = self.d.checklist(text=text, choices=choices, title=title, height=height, width=width,
|
||||
list_height=list_height, help_status=True, **more_kwargs)
|
||||
try:
|
||||
code, tags = self.d.checklist(text=text, choices=choices, title=title, height=height, width=width,
|
||||
list_height=list_height, help_status=True, **more_kwargs)
|
||||
except KeyboardInterrupt:
|
||||
raise SystemExit()
|
||||
|
||||
else:
|
||||
code: bool = False
|
||||
tags: list = packages
|
||||
|
@ -44,10 +48,12 @@ class DialogBox(Configs):
|
|||
if self.dialog:
|
||||
more_kwargs.update({"item_help": True,
|
||||
"help_tags": True})
|
||||
|
||||
code, tags = self.d.mixedform(text=text, title=title, elements=elements, # type: ignore
|
||||
height=height, width=width, help_button=True,
|
||||
help_status=True, **more_kwargs)
|
||||
try:
|
||||
code, tags = self.d.mixedform(text=text, title=title, elements=elements, # type: ignore
|
||||
height=height, width=width, help_button=True,
|
||||
help_status=True, **more_kwargs)
|
||||
except KeyboardInterrupt:
|
||||
raise SystemExit()
|
||||
else:
|
||||
code: bool = False
|
||||
tags: list = elements
|
||||
|
@ -57,9 +63,15 @@ class DialogBox(Configs):
|
|||
def msgbox(self, text: str, height: int, width: int) -> None:
|
||||
""" Display a message box. """
|
||||
if self.dialog:
|
||||
self.d.msgbox(text, height, width)
|
||||
try:
|
||||
self.d.msgbox(text, height, width)
|
||||
except KeyboardInterrupt:
|
||||
raise SystemExit()
|
||||
|
||||
def textbox(self, text: Union[str, Path], height: int, width: int) -> None:
|
||||
""" Display a text box. """
|
||||
if self.dialog:
|
||||
self.d.textbox(text, height, width)
|
||||
try:
|
||||
self.d.textbox(text, height, width)
|
||||
except KeyboardInterrupt:
|
||||
raise SystemExit()
|
||||
|
|
Loading…
Reference in a new issue