mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-12-31 10:26:39 +01:00
Updated for KeyboardInterrupt
This commit is contained in:
parent
ee06001fad
commit
a6091d4c2f
2 changed files with 9 additions and 19 deletions
|
@ -29,11 +29,8 @@ class DialogBox(Configs):
|
||||||
if self.dialog:
|
if self.dialog:
|
||||||
more_kwargs.update({"item_help": True})
|
more_kwargs.update({"item_help": True})
|
||||||
|
|
||||||
try:
|
code, tags = self.d.checklist(text=text, choices=choices, title=title, height=height, width=width,
|
||||||
code, tags = self.d.checklist(text=text, choices=choices, title=title, height=height, width=width,
|
list_height=list_height, help_status=True, **more_kwargs)
|
||||||
list_height=list_height, help_status=True, **more_kwargs)
|
|
||||||
except KeyboardInterrupt:
|
|
||||||
raise SystemExit()
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
code: bool = False
|
code: bool = False
|
||||||
|
@ -48,12 +45,9 @@ class DialogBox(Configs):
|
||||||
if self.dialog:
|
if self.dialog:
|
||||||
more_kwargs.update({"item_help": True,
|
more_kwargs.update({"item_help": True,
|
||||||
"help_tags": True})
|
"help_tags": True})
|
||||||
try:
|
code, tags = self.d.mixedform(text=text, title=title, elements=elements, # type: ignore
|
||||||
code, tags = self.d.mixedform(text=text, title=title, elements=elements, # type: ignore
|
height=height, width=width, help_button=True,
|
||||||
height=height, width=width, help_button=True,
|
help_status=True, **more_kwargs)
|
||||||
help_status=True, **more_kwargs)
|
|
||||||
except KeyboardInterrupt:
|
|
||||||
raise SystemExit()
|
|
||||||
else:
|
else:
|
||||||
code: bool = False
|
code: bool = False
|
||||||
tags: list = elements
|
tags: list = elements
|
||||||
|
@ -63,15 +57,9 @@ class DialogBox(Configs):
|
||||||
def msgbox(self, text: str, height: int, width: int) -> None:
|
def msgbox(self, text: str, height: int, width: int) -> None:
|
||||||
""" Display a message box. """
|
""" Display a message box. """
|
||||||
if self.dialog:
|
if self.dialog:
|
||||||
try:
|
self.d.msgbox(text, height, width)
|
||||||
self.d.msgbox(text, height, width)
|
|
||||||
except KeyboardInterrupt:
|
|
||||||
raise SystemExit()
|
|
||||||
|
|
||||||
def textbox(self, text: Union[str, Path], height: int, width: int) -> None:
|
def textbox(self, text: Union[str, Path], height: int, width: int) -> None:
|
||||||
""" Display a text box. """
|
""" Display a text box. """
|
||||||
if self.dialog:
|
if self.dialog:
|
||||||
try:
|
self.d.textbox(text, height, width)
|
||||||
self.d.textbox(text, height, width)
|
|
||||||
except KeyboardInterrupt:
|
|
||||||
raise SystemExit()
|
|
||||||
|
|
|
@ -834,6 +834,8 @@ def main() -> None:
|
||||||
logger = logging.getLogger(LoggingConfig.date)
|
logger = logging.getLogger(LoggingConfig.date)
|
||||||
logger.exception(main.__name__)
|
logger.exception(main.__name__)
|
||||||
usage.help_short(1)
|
usage.help_short(1)
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
raise SystemExit(1)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in a new issue