Skip to content

Commit b2e0a02

Browse files
committed
Added a 'fatalExit' method.
1 parent c0870b5 commit b2e0a02

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

pyTerminalUI/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454

5555

5656
class Terminal:
57+
FATAL_EXIT_CODE = 255
58+
5759
try:
5860
from colorama import Fore as Foreground
5961
Foreground = {
@@ -135,6 +137,11 @@ def deinitColors(cls):
135137
except:
136138
pass
137139

140+
@classmethod
141+
def fatalExit(cls, returnCode:int =0):
142+
"""Exit the terminal application by uninitializing color support and returning a fatal exit code."""
143+
cls.exit(cls.FATAL_EXIT_CODE if returnCode == 0 else returnCode)
144+
138145
@classmethod
139146
def exit(cls, returnCode:int =0):
140147
"""Exit the terminal application by uninitializing color support and returning an exit code."""

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
setuptools.setup(
5252
name=projectName,
53-
version="1.3.0",
53+
version="1.3.1",
5454

5555
author="Patrick Lehmann",
5656
author_email="Paebbels@gmail.com",

0 commit comments

Comments
 (0)