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

Commit 5d800ee

Browse files
committed
Added dependency to pyMetaClasses and made LineTerminal a singleton.
Extended auto documentation.
1 parent ca85b00 commit 5d800ee

File tree

6 files changed

+37
-5
lines changed

6 files changed

+37
-5
lines changed

doc/index.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ Updating using PIP
2222
2323
pip3 install -U pyTerminalUI
2424
25+
Dependencies
26+
************
27+
28+
* pyMetaClasses
29+
2530
------------------------------------
2631

2732
.. |docdate| date:: %b %d, %Y - %H:%M
@@ -37,10 +42,10 @@ Updating using PIP
3742
3843
3944
.. toctree::
40-
:caption: CallBy Classes
45+
:caption: pyTerminalUI Classes
4146
:hidden:
4247

43-
pyCallBy
48+
pyTerminalUI
4449

4550

4651
.. toctree::

doc/pyTerminalUI.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,30 @@ Terminal
99
:private-members:
1010

1111

12+
Severity
13+
********
14+
15+
.. autoclass:: pyTerminalUI.Severity
16+
:members:
17+
:private-members:
18+
19+
20+
Line
21+
****
22+
23+
.. autoclass:: pyTerminalUI.Line
24+
:members:
25+
:private-members:
26+
27+
28+
ILineTerminal
29+
*************
30+
31+
.. autoclass:: pyTerminalUI.ILineTerminal
32+
:members:
33+
:private-members:
34+
35+
1236
LineTerminal
1337
************
1438

pyTerminalUI/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
#
3939
from enum import Enum, unique
4040

41+
from pyMetaClasses import Singleton
42+
4143

4244
__api__ = [
4345
'Terminal',
@@ -442,7 +444,7 @@ def WriteDryRun(self, *args, condition=True, **kwargs):
442444
return False
443445

444446

445-
class LineTerminal(Terminal, ILineTerminal):
447+
class LineTerminal(Terminal, ILineTerminal, metaclass=Singleton):
446448
def __init__(self, verbose=False, debug=False, quiet=False, writeToStdOut=True):
447449
"""Initializer of a line based terminal interface."""
448450

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pyMetaClasses>=1.0.0

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.2.0",
53+
version="1.2.1",
5454

5555
author="Patrick Lehmann",
5656
author_email="[email protected]",

test/Application.py

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

4747
class Application(LineTerminal):
4848
def __init__(self):
49-
super().__init__(Severity.All)
49+
super().__init__(verbose=True, debug=True, quiet=False)
5050

5151
def run(self):
5252
self.WriteQuiet("This is a quiet message.")

0 commit comments

Comments
 (0)