txl-kernel 0.2.3__tar.gz → 0.2.14__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.14}/.gitignore +1 -0
- {txl_kernel-0.2.3 → txl_kernel-0.2.14}/PKG-INFO +5 -4
- {txl_kernel-0.2.3 → txl_kernel-0.2.14}/pyproject.toml +4 -6
- txl_kernel-0.2.14/txl_kernel/__init__.py +0 -0
- {txl_kernel-0.2.3 → txl_kernel-0.2.14}/txl_kernel/driver.py +16 -0
- txl_kernel-0.2.3/txl_kernel/__init__.py +0 -1
- {txl_kernel-0.2.3 → txl_kernel-0.2.14}/LICENSE.txt +0 -0
- {txl_kernel-0.2.3 → txl_kernel-0.2.14}/README.md +0 -0
- {txl_kernel-0.2.3 → txl_kernel-0.2.14}/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.14
|
|
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,9 +14,10 @@ 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<5.0.0,>=4.0.0
|
|
18
|
+
Requires-Dist: pycrdt<0.9.0,>=0.8.11
|
|
18
19
|
Requires-Dist: python-dateutil>=2.8.2
|
|
19
|
-
Requires-Dist: txl
|
|
20
|
+
Requires-Dist: txl<0.3.0,>=0.2.18
|
|
20
21
|
Description-Content-Type: text/markdown
|
|
21
22
|
|
|
22
23
|
# TXL plugin for a kernel driver
|
|
@@ -4,6 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "txl_kernel"
|
|
7
|
+
version = "0.2.14"
|
|
7
8
|
description = "TXL plugin for a kernel driver"
|
|
8
9
|
readme = "README.md"
|
|
9
10
|
requires-python = ">=3.10"
|
|
@@ -22,14 +23,11 @@ classifiers = [
|
|
|
22
23
|
"Programming Language :: Python :: Implementation :: PyPy",
|
|
23
24
|
]
|
|
24
25
|
dependencies = [
|
|
25
|
-
"txl",
|
|
26
|
+
"txl >=0.2.18,<0.3.0",
|
|
27
|
+
"asphalt >=4.0.0,<5.0.0",
|
|
26
28
|
"python-dateutil >=2.8.2",
|
|
27
|
-
"pycrdt >=0.
|
|
29
|
+
"pycrdt >=0.8.11,<0.9.0",
|
|
28
30
|
]
|
|
29
|
-
dynamic = ["version"]
|
|
30
31
|
|
|
31
32
|
[project.urls]
|
|
32
33
|
Source = "https://github.com/davidbrochart/jpterm/plugins/kernel"
|
|
33
|
-
|
|
34
|
-
[tool.hatch.version]
|
|
35
|
-
path = "txl_kernel/__init__.py"
|
|
File without changes
|
|
@@ -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"])
|
|
@@ -106,6 +121,7 @@ class KernelMixin:
|
|
|
106
121
|
if ycell["cell_type"] != "code":
|
|
107
122
|
return
|
|
108
123
|
ycell["outputs"].clear()
|
|
124
|
+
ycell["execution_count"] = None
|
|
109
125
|
code = str(ycell["source"])
|
|
110
126
|
content = {"code": code, "silent": False}
|
|
111
127
|
msg = create_message(
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.2.3"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|