txl-kernel 0.2.3__tar.gz → 0.2.13__tar.gz
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.
- {txl_kernel-0.2.3 → txl_kernel-0.2.13}/.gitignore +1 -0
- {txl_kernel-0.2.3 → txl_kernel-0.2.13}/PKG-INFO +4 -3
- {txl_kernel-0.2.3 → txl_kernel-0.2.13}/pyproject.toml +2 -1
- txl_kernel-0.2.13/txl_kernel/__init__.py +1 -0
- {txl_kernel-0.2.3 → txl_kernel-0.2.13}/txl_kernel/driver.py +15 -0
- txl_kernel-0.2.3/txl_kernel/__init__.py +0 -1
- {txl_kernel-0.2.3 → txl_kernel-0.2.13}/LICENSE.txt +0 -0
- {txl_kernel-0.2.3 → txl_kernel-0.2.13}/README.md +0 -0
- {txl_kernel-0.2.3 → txl_kernel-0.2.13}/txl_kernel/message.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: txl_kernel
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.13
|
|
4
4
|
Summary: TXL plugin for a kernel driver
|
|
5
5
|
Project-URL: Source, https://github.com/davidbrochart/jpterm/plugins/kernel
|
|
6
6
|
Author-email: David Brochart <david.brochart@gmail.com>
|
|
@@ -14,7 +14,8 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
14
14
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
15
15
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
16
16
|
Requires-Python: >=3.10
|
|
17
|
-
Requires-Dist:
|
|
17
|
+
Requires-Dist: asphalt
|
|
18
|
+
Requires-Dist: pycrdt<0.9.0,>=0.8.11
|
|
18
19
|
Requires-Dist: python-dateutil>=2.8.2
|
|
19
20
|
Requires-Dist: txl
|
|
20
21
|
Description-Content-Type: text/markdown
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.13"
|
|
@@ -2,6 +2,7 @@ import asyncio
|
|
|
2
2
|
import time
|
|
3
3
|
from typing import Dict
|
|
4
4
|
|
|
5
|
+
from asphalt.core import Event, Signal
|
|
5
6
|
from pycrdt import Array, Map
|
|
6
7
|
|
|
7
8
|
from .message import create_message
|
|
@@ -31,7 +32,15 @@ class Comm:
|
|
|
31
32
|
asyncio.create_task(self.send_message(msg, self.shell_channel, change_date_to_str=True))
|
|
32
33
|
|
|
33
34
|
|
|
35
|
+
class BusyEvent(Event):
|
|
36
|
+
def __init__(self, source, topic, busy: bool):
|
|
37
|
+
super().__init__(source, topic)
|
|
38
|
+
self.busy = busy
|
|
39
|
+
|
|
40
|
+
|
|
34
41
|
class KernelMixin:
|
|
42
|
+
busy = Signal(BusyEvent)
|
|
43
|
+
|
|
35
44
|
def __init__(self):
|
|
36
45
|
self.msg_cnt = 0
|
|
37
46
|
self.execute_requests: Dict[str, Dict[str, asyncio.Queue]] = {}
|
|
@@ -89,6 +98,12 @@ class KernelMixin:
|
|
|
89
98
|
elif msg_type == "comm_msg":
|
|
90
99
|
for comm_handler in self.comm_handlers:
|
|
91
100
|
comm_handler.comm_msg(msg)
|
|
101
|
+
elif msg_type == "status":
|
|
102
|
+
execution_state = msg["content"]["execution_state"]
|
|
103
|
+
if execution_state == "idle":
|
|
104
|
+
self.busy.dispatch(False)
|
|
105
|
+
elif execution_state == "busy":
|
|
106
|
+
self.busy.dispatch(True)
|
|
92
107
|
msg_id = msg["parent_header"].get("msg_id")
|
|
93
108
|
if msg_id in self.execute_requests:
|
|
94
109
|
# msg["header"] = str_to_date(msg["header"])
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.2.3"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|