Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Commit cb39c59

Browse files
committed
Added '@export' decorator.
1 parent 06eeb49 commit cb39c59

2 files changed

Lines changed: 17 additions & 16 deletions

File tree

pyTerminalUI/__init__.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# =============================================================================
99
# Authors: Patrick Lehmann
1010
#
11-
# Python module: A set of helpers to implement a text user interface (TUI) in a terminal.
11+
# Python package: A set of helpers to implement a text user interface (TUI) in a terminal.
1212
#
1313
# Description:
1414
# ------------------------------------
@@ -33,23 +33,19 @@
3333
# SPDX-License-Identifier: Apache-2.0
3434
# ============================================================================
3535
#
36-
from enum import Enum, unique
37-
38-
from pyMetaClasses import Singleton
36+
from enum import Enum, unique
37+
import os
38+
import sys
39+
from platform import system as platform_system
3940

41+
from pydecor import export
42+
from pyMetaClasses import Singleton
4043

41-
__api__ = [
42-
'Terminal',
43-
'Severity',
44-
'Line',
45-
'ILineTerminal',
46-
'LineTerminal',
47-
]
48-
__all__ = __api__
4944

50-
from platform import system as platform_system
45+
# __all__ = __api__
5146

5247

48+
@export
5349
class Terminal:
5450
FATAL_EXIT_CODE = 255
5551

@@ -335,6 +331,7 @@ def ioctl_GWINSZ(fd):
335331
return (int(cr[1]), int(cr[0]))
336332

337333

334+
@export
338335
@unique
339336
class Severity(Enum):
340337
"""Logging message severity levels."""
@@ -361,6 +358,7 @@ def __gt__(self, other): return self.value > other.value
361358
def __ge__(self, other): return self.value >= other.value
362359

363360

361+
@export
364362
class Line:
365363
"""Represents a single line message with a severity and indentation level."""
366364

@@ -409,6 +407,7 @@ def __str__(self):
409407
return self._LOG_MESSAGE_FORMAT__[self._severity].format(message=self._message)
410408

411409

410+
@export
412411
class ILineTerminal:
413412
"""A mixin class (interface) to provide class-local terminal writing methods."""
414413

@@ -502,6 +501,7 @@ def WriteDryRun(self, *args, condition=True, **kwargs):
502501
return False
503502

504503

504+
@export
505505
class LineTerminal(Terminal, ILineTerminal, metaclass=Singleton):
506506
def __init__(self, verbose=False, debug=False, quiet=False, writeToStdOut=True):
507507
"""Initializer of a line based terminal interface."""

requirements.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
colorama>=0.4.3
1+
colorama>=0.4.4
2+
pydecor>=2.0.1
23

3-
pyExceptions>=1.0.1
4-
pyMetaClasses>=1.2.1
4+
pyExceptions>=1.1.0
5+
pyMetaClasses>=1.3.0

0 commit comments

Comments
 (0)