python-tty 0.1.3__py3-none-any.whl → 0.1.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- python_tty/__init__.py +13 -3
- python_tty/audit/__init__.py +7 -0
- python_tty/audit/sink.py +141 -0
- python_tty/{utils → audit}/ui_logger.py +3 -4
- python_tty/commands/examples/root_commands.py +2 -3
- python_tty/commands/mixins.py +4 -5
- python_tty/config/__init__.py +8 -1
- python_tty/config/config.py +60 -3
- python_tty/console_factory.py +52 -3
- python_tty/consoles/core.py +5 -5
- python_tty/consoles/manager.py +5 -5
- python_tty/consoles/registry.py +33 -0
- python_tty/executor/executor.py +115 -16
- python_tty/frontends/rpc/__init__.py +0 -0
- python_tty/frontends/web/__init__.py +0 -0
- python_tty/meta/__init__.py +96 -0
- python_tty/runtime/__init__.py +29 -0
- python_tty/runtime/events.py +147 -0
- python_tty/runtime/provider.py +62 -0
- python_tty/{ui/output.py → runtime/router.py} +53 -11
- python_tty/utils/__init__.py +1 -3
- {python_tty-0.1.3.dist-info → python_tty-0.1.6.dist-info}/METADATA +5 -1
- python_tty-0.1.6.dist-info/RECORD +47 -0
- {python_tty-0.1.3.dist-info → python_tty-0.1.6.dist-info}/WHEEL +1 -1
- python_tty/ui/__init__.py +0 -13
- python_tty/ui/events.py +0 -55
- python_tty-0.1.3.dist-info/RECORD +0 -42
- {python_tty-0.1.3.dist-info → python_tty-0.1.6.dist-info}/licenses/LICENSE +0 -0
- {python_tty-0.1.3.dist-info → python_tty-0.1.6.dist-info}/licenses/NOTICE +0 -0
- {python_tty-0.1.3.dist-info → python_tty-0.1.6.dist-info}/top_level.txt +0 -0
python_tty/utils/__init__.py
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
from python_tty.utils.table import Table
|
|
2
2
|
from python_tty.utils.tokenize import get_command_token, get_func_param_strs, split_cmd, tokenize_cmd
|
|
3
|
-
from python_tty.utils.ui_logger import ConsoleHandler
|
|
4
3
|
|
|
5
4
|
__all__ = [
|
|
6
|
-
"ConsoleHandler",
|
|
7
5
|
"Table",
|
|
8
6
|
"get_command_token",
|
|
9
7
|
"get_func_param_strs",
|
|
10
8
|
"split_cmd",
|
|
11
9
|
"tokenize_cmd",
|
|
12
10
|
]
|
|
13
|
-
|
|
11
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-tty
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.6
|
|
4
4
|
Summary: A multi-console TTY framework for complex CLI/TTY apps
|
|
5
5
|
Home-page: https://github.com/ROOKIEMIE/python-tty
|
|
6
6
|
Author: ROOKIEMIE
|
|
@@ -12,8 +12,12 @@ Requires-Python: >=3.10
|
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
14
|
License-File: NOTICE
|
|
15
|
+
Requires-Dist: fastapi>=0.110.0
|
|
16
|
+
Requires-Dist: grpcio>=1.60.0
|
|
15
17
|
Requires-Dist: prompt_toolkit>=3.0.32
|
|
18
|
+
Requires-Dist: protobuf>=4.25.0
|
|
16
19
|
Requires-Dist: tqdm
|
|
20
|
+
Requires-Dist: uvicorn>=0.27.0
|
|
17
21
|
Dynamic: author
|
|
18
22
|
Dynamic: classifier
|
|
19
23
|
Dynamic: description
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
python_tty/__init__.py,sha256=BcJf6R5DOsMPCZCsCMJ_6WUUO8NqJ8Fnbq4WbK7-cL0,521
|
|
2
|
+
python_tty/console_factory.py,sha256=bomn4PdU2kfsUBrc3sz0sIQZ9qlhs-VMqOeZ87FE3No,5560
|
|
3
|
+
python_tty/audit/__init__.py,sha256=4VjFUH4KWjO-ZRBOCAZed5IT7zNVTfJOO-HaMTm762E,152
|
|
4
|
+
python_tty/audit/sink.py,sha256=9jyfhe6FEbsde-VIHpqJ4O7OEpoG3glOigE-guhRgJE,4821
|
|
5
|
+
python_tty/audit/ui_logger.py,sha256=SLFBmUKrb3-hbOEp0NkctAT_WvafEOeiFAymKAKXdXM,415
|
|
6
|
+
python_tty/commands/__init__.py,sha256=n3Thx4nzfnwFzEJ6JtrpX0_WuC1bntjtlH3-_ZSPPx8,455
|
|
7
|
+
python_tty/commands/core.py,sha256=3TNfSGfMa8VxO_6Eoj7qMGJgnIdUGejHK2_UDReaeHo,4892
|
|
8
|
+
python_tty/commands/decorators.py,sha256=MTCQrFlTK8cAHrgGjtjHETVmdnYI4-51G6CpcGP74S0,2656
|
|
9
|
+
python_tty/commands/general.py,sha256=2uu848GJzdMpYv0bOAZwG7zczxeczzk0Ppdt413rjG0,3555
|
|
10
|
+
python_tty/commands/mixins.py,sha256=Q47TyeO8D86m1m1OY_2fL-fcJqeyGe5m4GBUVwOvft4,1830
|
|
11
|
+
python_tty/commands/registry.py,sha256=NQg87PHDSH8Pk8Zg9oUayi76O0LAJ-8EDAyrCdypH-0,7041
|
|
12
|
+
python_tty/commands/examples/__init__.py,sha256=hToJIEZp-EK5atELlxola1U6pd-w21yhIqxD1MXo170,190
|
|
13
|
+
python_tty/commands/examples/root_commands.py,sha256=NikLU6Fm3dV1kpncrQoHqYTLeF7qRuOr1149cpKJtmw,1208
|
|
14
|
+
python_tty/commands/examples/sub_commands.py,sha256=7Mfn48u8nKRTkY1bc3Fj4qYU9e_7aU8dB829AOQmDmc,447
|
|
15
|
+
python_tty/config/__init__.py,sha256=xXK0TeWaO1KHDL8-1soWVfyh-ijON4A1cUt2aPoqyKQ,270
|
|
16
|
+
python_tty/config/config.py,sha256=7pkDsf9Q17IsZNaoy4QE5Vq8pH5MiUyBIBO-4YuZo2k,3282
|
|
17
|
+
python_tty/consoles/__init__.py,sha256=A_MC6Ot1EuQvjeSM75y5lE4WSbDph_t1JQYX8nuhmSU,403
|
|
18
|
+
python_tty/consoles/core.py,sha256=FEpClfEVZIZNXBfBSpuTwfVUdBPScbaKtMkvWuidHiQ,5433
|
|
19
|
+
python_tty/consoles/decorators.py,sha256=1RvZBpNXmvAF0J81duLc2uXsd9fX8VUrM5ZAPQjZqwQ,1554
|
|
20
|
+
python_tty/consoles/loader.py,sha256=FAlRwewsiJb5qkqgmPDKEszJ59X4nG85QHbhfc-knBQ,371
|
|
21
|
+
python_tty/consoles/manager.py,sha256=QYukO-Hkbet1FyHl5nkjXFLPeBawrhxxodyBplh1ZEA,4975
|
|
22
|
+
python_tty/consoles/registry.py,sha256=vQDMlMOUtWXrL4cnl5js4zIJ0VRshsIbUyxZ1yRWAOQ,4974
|
|
23
|
+
python_tty/consoles/examples/__init__.py,sha256=8f_zr6JPVx1CCR9SEqqUVVOh689t6pZ0XoAigEnftDQ,190
|
|
24
|
+
python_tty/consoles/examples/root_console.py,sha256=lg_p1KIYhF1z3WfGaoWsXelm46KD8HRHq_47F8Ol3yQ,834
|
|
25
|
+
python_tty/consoles/examples/sub_console.py,sha256=K-IyIy1UL4kj6QKCU-L-4CUSzPca-Flw-ePaKPmNa6Q,885
|
|
26
|
+
python_tty/exceptions/__init__.py,sha256=58tyDjS4S_jL4axvdmnryLoE9Sr73o5U6jehZvivbd8,161
|
|
27
|
+
python_tty/exceptions/console_exception.py,sha256=5xwfYsHvqYmFVnwbGq3eDGk9FZyE6eV9l6YobTqaa-w,231
|
|
28
|
+
python_tty/executor/__init__.py,sha256=k4Jv7n72IQN9BLmvi6ENbKhq405E5x8ongnVJXUFUhw,219
|
|
29
|
+
python_tty/executor/executor.py,sha256=oVEUPqvNP_nTw72DENE6vCQK4qJo0s8v0uWf8OylNuM,17562
|
|
30
|
+
python_tty/executor/models.py,sha256=FJDxV58DR2pK3g5-kA0d-SLcBV14nn6Fm34MhmkKx30,997
|
|
31
|
+
python_tty/frontends/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
32
|
+
python_tty/frontends/rpc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
|
+
python_tty/frontends/web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
34
|
+
python_tty/meta/__init__.py,sha256=RhdpITII79yGiKfwnU4NwhzJ-B9O6r1gOGx2YagYz_0,3306
|
|
35
|
+
python_tty/runtime/__init__.py,sha256=39hChqgLk1V1NtMxicAqZ2k4WCRsyLyPPWb9ofwx6kg,693
|
|
36
|
+
python_tty/runtime/events.py,sha256=teTtnLraOwaS47M5rdim1u-mXB1TfQIwIvdJmPZSZTk,4416
|
|
37
|
+
python_tty/runtime/provider.py,sha256=FaQF_pm2CqWRZZmiD_ipcl82E8lQpv9hBcM90u0GQGA,1645
|
|
38
|
+
python_tty/runtime/router.py,sha256=ywXydKmRMTdssWsX7NHdypl9C4fr0QDSXjFHk6p-Tng,4202
|
|
39
|
+
python_tty/utils/__init__.py,sha256=iU2MEk7j-8Sl4fiT4IsoOxQdq7MK70qpaD-87F0As9g,261
|
|
40
|
+
python_tty/utils/table.py,sha256=rAzxm-XTKbvKsn1Qoe_rXVjU6_5nQpJzSkgYZIRQBK8,4310
|
|
41
|
+
python_tty/utils/tokenize.py,sha256=TnZd1o6LmvqbMWON_RTVk4q664TviIQTFVkNX4CTUBs,1055
|
|
42
|
+
python_tty-0.1.6.dist-info/licenses/LICENSE,sha256=bR2Wj7Il7KNny38LiDGrASo12StUfpReF--OewXD5cw,10349
|
|
43
|
+
python_tty-0.1.6.dist-info/licenses/NOTICE,sha256=UiuDFTGN2ACyjBHAg4AoH6jM9aQRSgXjt2AYNUCI4ck,86
|
|
44
|
+
python_tty-0.1.6.dist-info/METADATA,sha256=0G7qEa9LVgVqgy3EawldHJtMjYIiRKWcnaLLeuiy-4g,2805
|
|
45
|
+
python_tty-0.1.6.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
46
|
+
python_tty-0.1.6.dist-info/top_level.txt,sha256=ZAEMWTGLkGwrlNN-lOeuJzAHB_xHAiEAecJ7CzS7FnY,11
|
|
47
|
+
python_tty-0.1.6.dist-info/RECORD,,
|
python_tty/ui/__init__.py
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
from python_tty.ui.events import UIEvent, UIEventLevel, UIEventListener, UIEventSpeaker
|
|
2
|
-
from python_tty.ui.output import OutputRouter, get_output_router, proxy_print
|
|
3
|
-
|
|
4
|
-
__all__ = [
|
|
5
|
-
"UIEvent",
|
|
6
|
-
"UIEventLevel",
|
|
7
|
-
"UIEventListener",
|
|
8
|
-
"UIEventSpeaker",
|
|
9
|
-
"OutputRouter",
|
|
10
|
-
"get_output_router",
|
|
11
|
-
"proxy_print",
|
|
12
|
-
]
|
|
13
|
-
|
python_tty/ui/events.py
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import enum
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class UIEventLevel(enum.Enum):
|
|
5
|
-
TEXT = -1
|
|
6
|
-
INFO = 0
|
|
7
|
-
WARNING = 1
|
|
8
|
-
ERROR = 2
|
|
9
|
-
SUCCESS = 3
|
|
10
|
-
FAILURE = 4
|
|
11
|
-
DEBUG = 5
|
|
12
|
-
|
|
13
|
-
@staticmethod
|
|
14
|
-
def map_level(code):
|
|
15
|
-
if code == 0:
|
|
16
|
-
return UIEventLevel.INFO
|
|
17
|
-
elif code == 1:
|
|
18
|
-
return UIEventLevel.WARNING
|
|
19
|
-
elif code == 2:
|
|
20
|
-
return UIEventLevel.ERROR
|
|
21
|
-
elif code == 3:
|
|
22
|
-
return UIEventLevel.SUCCESS
|
|
23
|
-
elif code == 4:
|
|
24
|
-
return UIEventLevel.FAILURE
|
|
25
|
-
elif code == 5:
|
|
26
|
-
return UIEventLevel.DEBUG
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
class UIEvent:
|
|
30
|
-
def __init__(self, msg, level=UIEventLevel.TEXT, run_id=None, event_type=None, payload=None):
|
|
31
|
-
self.msg = msg
|
|
32
|
-
self.level = level
|
|
33
|
-
self.run_id = run_id
|
|
34
|
-
self.event_type = event_type
|
|
35
|
-
self.payload = payload
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
class UIEventListener:
|
|
39
|
-
def handler_event(self, event: UIEvent):
|
|
40
|
-
pass
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
class UIEventSpeaker:
|
|
44
|
-
def __init__(self):
|
|
45
|
-
self._event_listener = []
|
|
46
|
-
|
|
47
|
-
def add_event_listener(self, listener: UIEventListener):
|
|
48
|
-
self._event_listener.append(listener)
|
|
49
|
-
|
|
50
|
-
def remove_event_listener(self, listener: UIEventListener):
|
|
51
|
-
self._event_listener.remove(listener)
|
|
52
|
-
|
|
53
|
-
def notify_event_listeners(self, event: UIEvent):
|
|
54
|
-
for listener in self._event_listener:
|
|
55
|
-
listener.handler_event(event)
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
python_tty/__init__.py,sha256=VZvoBsZTUvvolO2r3hwsC2r-BDTxjpy6zZjykO0_ZT4,376
|
|
2
|
-
python_tty/console_factory.py,sha256=yRWXsh8mNGyAxUUXe3el3ENKqL4fuAfUqZYBtScCii4,3666
|
|
3
|
-
python_tty/commands/__init__.py,sha256=n3Thx4nzfnwFzEJ6JtrpX0_WuC1bntjtlH3-_ZSPPx8,455
|
|
4
|
-
python_tty/commands/core.py,sha256=3TNfSGfMa8VxO_6Eoj7qMGJgnIdUGejHK2_UDReaeHo,4892
|
|
5
|
-
python_tty/commands/decorators.py,sha256=MTCQrFlTK8cAHrgGjtjHETVmdnYI4-51G6CpcGP74S0,2656
|
|
6
|
-
python_tty/commands/general.py,sha256=2uu848GJzdMpYv0bOAZwG7zczxeczzk0Ppdt413rjG0,3555
|
|
7
|
-
python_tty/commands/mixins.py,sha256=zI47zAFmZ2uvuzohpq4wabXiHb45PbbXxmYkAVaM5Lw,1761
|
|
8
|
-
python_tty/commands/registry.py,sha256=NQg87PHDSH8Pk8Zg9oUayi76O0LAJ-8EDAyrCdypH-0,7041
|
|
9
|
-
python_tty/commands/examples/__init__.py,sha256=hToJIEZp-EK5atELlxola1U6pd-w21yhIqxD1MXo170,190
|
|
10
|
-
python_tty/commands/examples/root_commands.py,sha256=L7cVS5I5ZrIrdSPS1Z1EIlOLN6WRDT925LSBR7uLi4M,1200
|
|
11
|
-
python_tty/commands/examples/sub_commands.py,sha256=7Mfn48u8nKRTkY1bc3Fj4qYU9e_7aU8dB829AOQmDmc,447
|
|
12
|
-
python_tty/config/__init__.py,sha256=5NlOOKUL0BqqO0zFPyN8N0MUDyfobEfjF2UM_FLkgkY,213
|
|
13
|
-
python_tty/config/config.py,sha256=Seis2foQv6f1AEVQZM0IQGRYJBs2Dixm3G0hYlXIa0E,910
|
|
14
|
-
python_tty/consoles/__init__.py,sha256=A_MC6Ot1EuQvjeSM75y5lE4WSbDph_t1JQYX8nuhmSU,403
|
|
15
|
-
python_tty/consoles/core.py,sha256=ZWJub29TrlZB6oRXNXBRMGUvnNqvuUn_QT_tVa2lUaQ,5340
|
|
16
|
-
python_tty/consoles/decorators.py,sha256=1RvZBpNXmvAF0J81duLc2uXsd9fX8VUrM5ZAPQjZqwQ,1554
|
|
17
|
-
python_tty/consoles/loader.py,sha256=FAlRwewsiJb5qkqgmPDKEszJ59X4nG85QHbhfc-knBQ,371
|
|
18
|
-
python_tty/consoles/manager.py,sha256=Z-0WepObqIL-Alt_ZmEIl9Kv-rMYy_xWSU359g2tYfw,4928
|
|
19
|
-
python_tty/consoles/registry.py,sha256=IlwP-uhK8EnN-M4lEqdr8wggn9BJdraDGcq8u_BvIOw,3891
|
|
20
|
-
python_tty/consoles/examples/__init__.py,sha256=8f_zr6JPVx1CCR9SEqqUVVOh689t6pZ0XoAigEnftDQ,190
|
|
21
|
-
python_tty/consoles/examples/root_console.py,sha256=lg_p1KIYhF1z3WfGaoWsXelm46KD8HRHq_47F8Ol3yQ,834
|
|
22
|
-
python_tty/consoles/examples/sub_console.py,sha256=K-IyIy1UL4kj6QKCU-L-4CUSzPca-Flw-ePaKPmNa6Q,885
|
|
23
|
-
python_tty/exceptions/__init__.py,sha256=58tyDjS4S_jL4axvdmnryLoE9Sr73o5U6jehZvivbd8,161
|
|
24
|
-
python_tty/exceptions/console_exception.py,sha256=5xwfYsHvqYmFVnwbGq3eDGk9FZyE6eV9l6YobTqaa-w,231
|
|
25
|
-
python_tty/executor/__init__.py,sha256=k4Jv7n72IQN9BLmvi6ENbKhq405E5x8ongnVJXUFUhw,219
|
|
26
|
-
python_tty/executor/executor.py,sha256=pnIODl4nI_foU6mgt6KdDiFLpGvVvAOUY6yWrATii7M,13561
|
|
27
|
-
python_tty/executor/models.py,sha256=FJDxV58DR2pK3g5-kA0d-SLcBV14nn6Fm34MhmkKx30,997
|
|
28
|
-
python_tty/frontends/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
29
|
-
python_tty/meta/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
30
|
-
python_tty/ui/__init__.py,sha256=wBSHvOMA8cZJQJk4D8UjvqHB3ujvBte0E064IUABbbc,327
|
|
31
|
-
python_tty/ui/events.py,sha256=qgyhDjkdU-K6j7_LDz9G33OZZxkHWOVxulq-oMzUBuU,1356
|
|
32
|
-
python_tty/ui/output.py,sha256=3_linB6hpDfQHbuff6bm9HcdgCB21RUrkDI7iHvL5x8,2690
|
|
33
|
-
python_tty/utils/__init__.py,sha256=8ky8A4s6NbxaEokdnUxhCxgIXjq5nFCeyOApjg0RfvI,338
|
|
34
|
-
python_tty/utils/table.py,sha256=rAzxm-XTKbvKsn1Qoe_rXVjU6_5nQpJzSkgYZIRQBK8,4310
|
|
35
|
-
python_tty/utils/tokenize.py,sha256=TnZd1o6LmvqbMWON_RTVk4q664TviIQTFVkNX4CTUBs,1055
|
|
36
|
-
python_tty/utils/ui_logger.py,sha256=dCqflrliX2T6GdTFonUwEiHYHHF-wlj1QkqpVsFvxio,393
|
|
37
|
-
python_tty-0.1.3.dist-info/licenses/LICENSE,sha256=bR2Wj7Il7KNny38LiDGrASo12StUfpReF--OewXD5cw,10349
|
|
38
|
-
python_tty-0.1.3.dist-info/licenses/NOTICE,sha256=UiuDFTGN2ACyjBHAg4AoH6jM9aQRSgXjt2AYNUCI4ck,86
|
|
39
|
-
python_tty-0.1.3.dist-info/METADATA,sha256=TBe7LF2A829o5-HzhBqSB4LIhvq6CiJYpJnVaUyEPEA,2680
|
|
40
|
-
python_tty-0.1.3.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
|
|
41
|
-
python_tty-0.1.3.dist-info/top_level.txt,sha256=ZAEMWTGLkGwrlNN-lOeuJzAHB_xHAiEAecJ7CzS7FnY,11
|
|
42
|
-
python_tty-0.1.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|