kalong 0.5.1__py3-none-any.whl → 0.5.3__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.
- kalong/__init__.py +1 -1
- kalong/communication.py +29 -16
- kalong/config.py +3 -0
- kalong/server.py +7 -1
- kalong/static/assets/{index-BwfqANhu.js → index-B6z5WP1H.js} +49 -49
- kalong/static/index.html +1 -1
- kalong/stepping.py +3 -1
- kalong/tracing.py +16 -2
- kalong/utils/io.py +4 -2
- kalong/utils/obj.py +9 -1
- {kalong-0.5.1.dist-info → kalong-0.5.3.dist-info}/METADATA +2 -2
- {kalong-0.5.1.dist-info → kalong-0.5.3.dist-info}/RECORD +15 -15
- {kalong-0.5.1.dist-info → kalong-0.5.3.dist-info}/WHEEL +1 -1
- {kalong-0.5.1.dist-info → kalong-0.5.3.dist-info}/entry_points.txt +0 -0
- {kalong-0.5.1.dist-info → kalong-0.5.3.dist-info}/licenses/LICENSE +0 -0
kalong/static/index.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
content="minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no"
|
|
9
9
|
/>
|
|
10
10
|
<title>Kalong</title>
|
|
11
|
-
<script type="module" crossorigin src="/assets/index-
|
|
11
|
+
<script type="module" crossorigin src="/assets/index-B6z5WP1H.js"></script>
|
|
12
12
|
</head>
|
|
13
13
|
<body>
|
|
14
14
|
<div id="root"></div>
|
kalong/stepping.py
CHANGED
|
@@ -18,7 +18,7 @@ steppings = {}
|
|
|
18
18
|
kalong_dir = str(Path(__file__).resolve().parent)
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
def add_step(type, frame, skip_frames=None):
|
|
21
|
+
def add_step(type, frame, skip_frames=None, condition=None):
|
|
22
22
|
origin = current_origin()
|
|
23
23
|
current = steppings.get(origin)
|
|
24
24
|
steppings[origin] = {
|
|
@@ -26,6 +26,8 @@ def add_step(type, frame, skip_frames=None):
|
|
|
26
26
|
"frame": frame,
|
|
27
27
|
"lno": frame.f_lineno,
|
|
28
28
|
}
|
|
29
|
+
if condition:
|
|
30
|
+
steppings[origin]["condition"] = condition
|
|
29
31
|
if skip_frames is not None:
|
|
30
32
|
steppings[origin]["skip_frames"] = skip_frames
|
|
31
33
|
if current:
|
kalong/tracing.py
CHANGED
|
@@ -26,6 +26,7 @@ def trace(origin, frame, event, arg):
|
|
|
26
26
|
skip_frames = stepping.get("skip_frames")
|
|
27
27
|
filename = frame.f_code.co_filename
|
|
28
28
|
into_type = None
|
|
29
|
+
pending = None
|
|
29
30
|
|
|
30
31
|
if type.startswith("stepInto"):
|
|
31
32
|
into_type = type.split("stepInto")[1].lower() or "skipcore"
|
|
@@ -52,8 +53,21 @@ def trace(origin, frame, event, arg):
|
|
|
52
53
|
# If we are continuing, don't trace anything but current frame
|
|
53
54
|
if type == "continue":
|
|
54
55
|
if frame == originalFrame:
|
|
56
|
+
if stepping.get("condition"):
|
|
57
|
+
# Check the condition
|
|
58
|
+
response = stepping["condition"]()
|
|
59
|
+
answers = response["answer"]
|
|
60
|
+
# Break if answer is truthy
|
|
61
|
+
break_ = len(answers) > 0 and (
|
|
62
|
+
any(answer.get("truthiness", True) for answer in answers)
|
|
63
|
+
)
|
|
64
|
+
if not break_:
|
|
65
|
+
# Continue tracing current frame
|
|
66
|
+
return sys.gettrace()
|
|
67
|
+
pending = response
|
|
68
|
+
|
|
55
69
|
# Continue tracing current frame
|
|
56
|
-
|
|
70
|
+
elif event != "exception":
|
|
57
71
|
return sys.gettrace()
|
|
58
72
|
else:
|
|
59
73
|
# Stop tracing if below
|
|
@@ -110,6 +124,6 @@ def trace(origin, frame, event, arg):
|
|
|
110
124
|
elif event == "exception":
|
|
111
125
|
frame.f_locals["__kalong_exception__"] = arg
|
|
112
126
|
# Enter the websocket communication loop that pauses the execution
|
|
113
|
-
communicate(frame, event, arg)
|
|
127
|
+
communicate(frame, event, arg, pending)
|
|
114
128
|
|
|
115
129
|
return sys.gettrace()
|
kalong/utils/io.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import sys
|
|
2
2
|
|
|
3
|
-
from .obj import walk_obj
|
|
3
|
+
from .obj import safe_bool, walk_obj
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
class FakeSTD(object):
|
|
@@ -29,7 +29,9 @@ class capture_display(object):
|
|
|
29
29
|
|
|
30
30
|
def hook(self, obj):
|
|
31
31
|
if obj is not None:
|
|
32
|
-
|
|
32
|
+
answer = walk_obj(obj, set())
|
|
33
|
+
answer["truthiness"] = safe_bool(obj)
|
|
34
|
+
self.answer.append(answer)
|
|
33
35
|
self.obj = obj
|
|
34
36
|
|
|
35
37
|
|
kalong/utils/obj.py
CHANGED
|
@@ -137,7 +137,8 @@ def sync_locals(frame, f_locals):
|
|
|
137
137
|
This is a cpython hack to synchronize new locals back into
|
|
138
138
|
the fast local slots.
|
|
139
139
|
"""
|
|
140
|
-
|
|
140
|
+
for key, value in f_locals.items():
|
|
141
|
+
frame.f_locals[key] = value
|
|
141
142
|
try:
|
|
142
143
|
ctypes.pythonapi.PyFrame_LocalsToFast(ctypes.py_object(frame), ctypes.c_int(0))
|
|
143
144
|
except Exception:
|
|
@@ -172,3 +173,10 @@ def safe_repr(obj, default="<unrepresentable>", include_exc=False):
|
|
|
172
173
|
if include_exc:
|
|
173
174
|
return f"{default} {e.__class__.__name__}: {e}"
|
|
174
175
|
return default
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
def safe_bool(obj):
|
|
179
|
+
try:
|
|
180
|
+
return bool(obj)
|
|
181
|
+
except Exception:
|
|
182
|
+
return False
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
kalong/__init__.py,sha256=
|
|
1
|
+
kalong/__init__.py,sha256=gP18eeJJ96cRW2z3IlU8idQD7yiA-PwX3LN-FZn1PHg,3463
|
|
2
2
|
kalong/__main__.py,sha256=rhd3QnCaDRx26Y1oEEoIUVYhzIhrddXMuZhDh1s1wyo,63
|
|
3
|
-
kalong/communication.py,sha256=
|
|
4
|
-
kalong/config.py,sha256=
|
|
3
|
+
kalong/communication.py,sha256=jmcHANSA2_gj0BhZlt_TOTdb-rMeOfTHY6ksA_Br6cc,7196
|
|
4
|
+
kalong/config.py,sha256=h03Tc8ozR2dXw3RwKMQbV3n8Vni8RUhVKjhnLyIAsjY,3492
|
|
5
5
|
kalong/debugger.py,sha256=1ZLC22djzjdE2Nx_tmZD5nuyAfwJKNyYXhNckVab9oY,13124
|
|
6
6
|
kalong/errors.py,sha256=3uUIdb_Vk046fZu7kvUNSIWStKUb2Lw9lzSr4KYjydQ,394
|
|
7
7
|
kalong/forking.py,sha256=F3cKnoyKz2aPa7e_VTELORoIfe8OPLdpMP2ROozOz0I,941
|
|
8
8
|
kalong/loops.py,sha256=Hm7axWgkWmhoovvEOz6pwLQau7Jvwi7k6JDIfdLfq_s,1452
|
|
9
|
-
kalong/server.py,sha256=
|
|
10
|
-
kalong/stepping.py,sha256=
|
|
11
|
-
kalong/tracing.py,sha256=
|
|
9
|
+
kalong/server.py,sha256=FIxLvtn2T_opjvhkDsL6TcNSYOHilwZIKYphBveoN_0,3916
|
|
10
|
+
kalong/stepping.py,sha256=3M4z_Pz7pybsunhC2zugRqeX6OHDJegwx2SgOSOgL2k,2483
|
|
11
|
+
kalong/tracing.py,sha256=KvOM-XeYbfQNHFA3FKYrElsOQp9hzzc9SiEhVTGOel4,4284
|
|
12
12
|
kalong/websockets.py,sha256=bhcFR24us1mBk_GYSKrFgHbAPsvrA4DGAO1sy4yLBa0,2844
|
|
13
|
-
kalong/static/index.html,sha256=
|
|
13
|
+
kalong/static/index.html,sha256=WiGSP6-eLdbtkU-vz7Pv7JsdU37FOw8rA77oU5WZyiU,447
|
|
14
14
|
kalong/static/assets/FiraCode-Bold-Ba6ukUQM.otf,sha256=OPRF39DTrhVOpC_076c_zWg35KnXePm0WfekHj_cVMU,165916
|
|
15
15
|
kalong/static/assets/FiraCode-Regular-DP3ilQdk.otf,sha256=glzWMf6FMYc2vBuQI5xHFh1EPbvWhVK0r11UbP56EhA,160556
|
|
16
16
|
kalong/static/assets/favicon-rdSYpj7B.svg,sha256=IIpCKte78geM0QpB2kh1Z-fDiuHxzKORPTJhTvi7k1U,546
|
|
17
|
-
kalong/static/assets/index-
|
|
17
|
+
kalong/static/assets/index-B6z5WP1H.js,sha256=WZkr2Sec__5cIWXHX5eunMMg_lzirEAS2ti4vj6d_S0,942710
|
|
18
18
|
kalong/utils/__init__.py,sha256=AM2jSxRBsFyDhB__TN_GI6WqsllN8WEk4cqRcyZvHug,3559
|
|
19
|
-
kalong/utils/io.py,sha256=
|
|
19
|
+
kalong/utils/io.py,sha256=lPxXFDErqVHDHAFKyIAjHH7WSFfY8HRKIRyXB1_6IkU,1533
|
|
20
20
|
kalong/utils/iterators.py,sha256=6fbv-9hZ-7a3i1oJvLCzLXm7Ihc66CgSO2u87nZzxrg,1045
|
|
21
|
-
kalong/utils/obj.py,sha256=
|
|
21
|
+
kalong/utils/obj.py,sha256=FXm98nx7l60mBN3LzwdmuiAckw36-3F96tJqo1K5R6A,4385
|
|
22
22
|
kalong/utils/doc_lookup/__init__.py,sha256=Bf0hv0Enkk46TTIlBfyDlGMf9LHhp4wNPDgBl_TVM1s,685
|
|
23
23
|
kalong/utils/doc_lookup/lookup.json,sha256=Xvfd7njY3dyQ7i4IRoOs_5CAlTk0TWEAL4a5kiuObU0,997017
|
|
24
|
-
kalong-0.5.
|
|
25
|
-
kalong-0.5.
|
|
26
|
-
kalong-0.5.
|
|
27
|
-
kalong-0.5.
|
|
28
|
-
kalong-0.5.
|
|
24
|
+
kalong-0.5.3.dist-info/METADATA,sha256=8ReYgjK3Hn-GqIN8r_nIZXzBsuwZ_Z750f9XeMDC_4M,815
|
|
25
|
+
kalong-0.5.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
26
|
+
kalong-0.5.3.dist-info/entry_points.txt,sha256=ATxUxSsaDx2Ggw96-oG3rFA59uxPOK_R7o7-yJn7tlo,39
|
|
27
|
+
kalong-0.5.3.dist-info/licenses/LICENSE,sha256=pXYsRuhMNEdOP2Mtt6hP9twpETOg_5R2wMYDrz7Z0ms,36836
|
|
28
|
+
kalong-0.5.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|