The cursor's path leaves as one stroke: the pacer's events go to Actions.walk
Pointer asked the Pacer for the instant of each point, but every point left through actions.move, a lone command that waits for the engine's reply. A slow reply stopped the path (a 2.6 s pause seen by the page, measured on a GitHub runner) and the points after it were crowded together. The approach, the walk before a Mouse.click, the wheel burst and the idle movement now hand their planned timeline to the core's Actions.walk, which sends each point at its instant carrying stroke and at, without waiting for any reply, and collects the replies at the end. The synchronous driver this module kept is gone: the pacer's loop is the core's. A lone mouse.down, mouse.up or one-step move is still a single command. Needs the core that has Actions.walk (the 65 pin).
This commit is contained in:
1 parent
7a44cddede
commit
450ff5a235
5 files changed
+263
-65
No files matched your search
@@ -48,8 +48,8 @@ from dataclasses import dataclass
|
||||
from typing import Any, Callable, Dict, Iterable, List, Optional, Sequence, Tuple
|
||||
|
||||
from invisible_core.juggler import (
|
||||
DONE, SLEEP, Ev as _Ev, Pacer, PointerPersona, Step,
|
||||
clamp_to_viewport as _clamp, fine_timer as _fine_timer,
|
||||
Ev as _Ev, PointerPersona, Step,
|
||||
clamp_to_viewport as _clamp,
|
||||
fit_timeline as _fit_timeline, initial_pointer, landing_point,
|
||||
plan_aimless_move, plan_approach, plan_idle, plan_scroll,
|
||||
steps_from_waypoints, tail_within,
|
||||
@@ -179,41 +179,6 @@ def _normalise_waypoints(raw: Iterable[Any], max_seconds: float) -> List[Tuple[f
|
||||
return out
|
||||
|
||||
|
||||
def _drive(evs: Sequence[_Ev], emit_move: Callable[[float, float], Any],
|
||||
emit_wheel: Optional[Callable[[float, float], Any]] = None, *,
|
||||
emit_last: bool = True,
|
||||
origin: Optional[Tuple[float, float]] = None) -> int:
|
||||
"""The synchronous driver of `Pacer`. Returns events sent.
|
||||
|
||||
The rules it obeys - absolute deadlines from one ``t0``, drop rather than
|
||||
send late while the drop stays within reach, never two events in one
|
||||
instant - are the pacer's, the core's, and are the same ones the client's
|
||||
asynchronous driver obeyed. This supplies a clock, a way of waiting and
|
||||
where the pointer starts from; it makes no decision the pacer has not made.
|
||||
"""
|
||||
if not evs:
|
||||
return 0
|
||||
clock = _CLOCK
|
||||
pacer = Pacer(evs, emit_last=emit_last, origin=origin)
|
||||
with _fine_timer():
|
||||
while True:
|
||||
what, arg = pacer.step(clock.now())
|
||||
if what == DONE:
|
||||
break
|
||||
if what == SLEEP:
|
||||
clock.sleep(arg)
|
||||
continue
|
||||
if arg.is_wheel:
|
||||
if emit_wheel is None:
|
||||
pacer.dropped() # nothing here can carry a notch
|
||||
continue
|
||||
emit_wheel(arg.dx, arg.dy)
|
||||
else:
|
||||
emit_move(arg.x, arg.y)
|
||||
pacer.emitted(clock.now())
|
||||
return pacer.delivered
|
||||
|
||||
|
||||
# ── one page's hand ─────────────────────────────────────────────────────────
|
||||
|
||||
class _Hand:
|
||||
@@ -409,10 +374,18 @@ class Pointer:
|
||||
hand.x, hand.y = hand.start_point(w, h)
|
||||
return float(hand.x), float(hand.y)
|
||||
|
||||
def _emit_move(self, x: float, y: float) -> None:
|
||||
def _walk(self, evs: Sequence[_Ev], *, emit_last: bool = True) -> int:
|
||||
"""Hand a planned timeline to the core, which walks it as ONE stroke: the pacer's instants on the client's clock, each point
|
||||
carrying `stroke` and `at`, no reply waited for between two points. Returns the events delivered.
|
||||
|
||||
⛔ THIS IS THE ONLY PLACE A PATH LEAVES. It used to be driven here, one point at a time through `actions.move`, and each point
|
||||
waited for the engine's reply: a slow reply was a pause in the path that the page saw, and the points after it were crowded
|
||||
together. The pacer's decisions are the core's, and so is the loop that applies them (`Actions.walk`)."""
|
||||
hand = self.hand
|
||||
self.actions.move(x, y)
|
||||
sent = self.actions.walk(evs, origin=(hand.x, hand.y), emit_last=emit_last,
|
||||
now=_CLOCK.now, sleep=_CLOCK.sleep)
|
||||
hand.synced = getattr(self.actions, "position", None)
|
||||
return sent
|
||||
|
||||
# -- the probes --------------------------------------------------------
|
||||
|
||||
@@ -505,21 +478,19 @@ class Pointer:
|
||||
|
||||
# -- travelling --------------------------------------------------------
|
||||
|
||||
def _run_steps(self, steps: Sequence[Any], emit_wheel: Optional[Callable] = None,
|
||||
*, budget_s: float, emit_last: bool = True) -> None:
|
||||
"""Dispatch a planned ``_behaviour`` timeline, inside a time budget."""
|
||||
def _run_steps(self, steps: Sequence[Any], *, budget_s: float, emit_last: bool = True) -> None:
|
||||
"""Dispatch a planned ``_behaviour`` timeline, inside a time budget: moves and wheel notches, as one stroke."""
|
||||
hand = self.hand
|
||||
evs = _fit_timeline(_timeline(steps), budget_s)
|
||||
if not evs:
|
||||
return
|
||||
|
||||
def move(x: float, y: float) -> None:
|
||||
self._emit_move(x, y)
|
||||
hand.x, hand.y = x, y
|
||||
|
||||
_drive(evs, move, emit_wheel, emit_last=emit_last,
|
||||
origin=(hand.x, hand.y))
|
||||
if not emit_last and evs:
|
||||
self._walk(evs, emit_last=emit_last)
|
||||
if emit_last:
|
||||
# The pointer is where the last move that went out put it (a notch leaves it where it was).
|
||||
now = getattr(self.actions, "position", None)
|
||||
if now is not None:
|
||||
hand.x, hand.y = float(now[0]), float(now[1])
|
||||
else:
|
||||
hand.x, hand.y = evs[-1].x, evs[-1].y
|
||||
hand.last_event_at = _CLOCK.now()
|
||||
|
||||
@@ -756,11 +727,7 @@ class Pointer:
|
||||
# though the caller is the one that emits it.
|
||||
evs.append(_Ev(max(t, evs[-1].t_ms if evs else 0.0), to_x, to_y))
|
||||
|
||||
def emit(x: float, y: float) -> None:
|
||||
self._emit_move(x, y)
|
||||
hand.x, hand.y = x, y
|
||||
|
||||
_drive(evs, emit, emit_last=False, origin=(hand.x, hand.y))
|
||||
self._walk(evs, emit_last=False)
|
||||
hand.x, hand.y = to_x, to_y
|
||||
hand.last_event_at = _CLOCK.now()
|
||||
|
||||
@@ -799,8 +766,7 @@ class Pointer:
|
||||
try:
|
||||
plan = self._scroll_plan(float(dx), float(dy))
|
||||
if plan:
|
||||
self._run_steps(plan, self.actions.wheel,
|
||||
budget_s=hand.max_seconds)
|
||||
self._run_steps(plan, budget_s=hand.max_seconds)
|
||||
return True
|
||||
finally:
|
||||
hand.busy = False
|
||||
|
||||
@@ -7,6 +7,7 @@ receive.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from invisible_core.juggler import _pacing
|
||||
from invisible_playwright._juggler import pointer as pointer_mod
|
||||
from invisible_playwright._juggler.pointer import Pointer
|
||||
|
||||
@@ -52,6 +53,21 @@ class FakeActions:
|
||||
def move(self, x, y, steps=1):
|
||||
self._page.moves.append((round(x, 4), round(y, 4)))
|
||||
self.position = (x, y)
|
||||
self._page.singles.append(("move", steps))
|
||||
|
||||
def walk(self, events, *, origin=None, buttons=None, modifiers=0, emit_last=True, now=None, sleep=None):
|
||||
"""`Actions.walk`: the pacer's loop over the events, one stroke per call. The points land in `moves` and the notches in
|
||||
`wheels`, as the single commands did, and `walks` keeps what was handed over, so a test sees that a path left as a walk."""
|
||||
evs = list(events)
|
||||
self._page.walks.append({"events": evs, "origin": origin, "emit_last": emit_last})
|
||||
|
||||
def move(x, y, t_ms):
|
||||
self._page.moves.append((round(x, 4), round(y, 4)))
|
||||
self.position = (x, y)
|
||||
|
||||
def wheel(dx, dy, t_ms):
|
||||
self._page.wheels.append((dx, dy))
|
||||
return _pacing.drive(evs, move, emit_wheel=wheel, emit_last=emit_last, now=now, sleep=sleep, origin=origin, timed=True)
|
||||
|
||||
def wheel(self, dx, dy):
|
||||
self._page.wheels.append((dx, dy))
|
||||
@@ -83,6 +99,8 @@ class FakePage:
|
||||
self.hits = hits
|
||||
self.moves = []
|
||||
self.wheels = []
|
||||
self.walks = []
|
||||
self.singles = []
|
||||
self.hit_asked = []
|
||||
self.queried = []
|
||||
self.disposed = []
|
||||
|
||||
@@ -0,0 +1,207 @@
|
||||
"""A path of the cursor is ONE stroke: the pacer's instants on the client's clock, each point sent without waiting for the reply of the one
|
||||
before it.
|
||||
|
||||
THE KNOWN-BAD, measured on a GitHub runner (hunt 43794672372): `Pointer` asked the `Pacer` for the instant of each point, but every point
|
||||
left through `actions.move`, a lone command that WAITS for the engine's reply. A slow reply stopped the path (the page saw a 2.6 s pause)
|
||||
and the points after it were then crowded together. The keys had the same defect before the stroke.
|
||||
|
||||
What is asserted here is who sends the path, never how long it took:
|
||||
|
||||
* with a stand-in for the core's actions (`_pointer_fakes.FakeActions`): the approach, the walk before a `Mouse.click`, the wheel burst
|
||||
and the idle movement each go to `Actions.walk` as one timeline, and no single `move` is made for them;
|
||||
* with the real `Actions` over a connection that records when a command is sent and when a reply is waited for: every point of the
|
||||
path is on the wire before the first reply is waited for, all of them in one stroke, each at its instant (`at`); a command of the
|
||||
user that is alone (`mouse.down`, `mouse.up`, a one-step `move`) still waits for its own reply.
|
||||
|
||||
Nothing launches a browser, and nothing here reads the time.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from invisible_core.juggler import PageActs
|
||||
from invisible_core.juggler.actions import Actions
|
||||
|
||||
from invisible_playwright import _cursor
|
||||
|
||||
from _pointer_fakes import BOX, FakeInjected, FakePage, VirtualClock, make_pointer, use_clock
|
||||
from invisible_playwright._juggler.pointer import Pointer
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def quiet(monkeypatch):
|
||||
monkeypatch.delenv(_cursor.LANDING_ENV, raising=False)
|
||||
_cursor._reset_warnings()
|
||||
yield
|
||||
_cursor._reset_warnings()
|
||||
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# 1. Through a stand-in for the core's actions: what is handed over
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
|
||||
def test_the_approach_is_one_walk_and_no_single_move(monkeypatch):
|
||||
use_clock(monkeypatch, VirtualClock())
|
||||
page, pointer = make_pointer()
|
||||
pointer.approach("main", "#b", None)
|
||||
assert len(page.walks) == 1
|
||||
assert len(page.walks[0]["events"]) > 3, "a path of one point is not a path"
|
||||
assert page.singles == [], "a point of the path was sent as a command of its own"
|
||||
assert page.walks[0]["emit_last"] is False, "the last hop is the action's"
|
||||
|
||||
|
||||
def test_the_walk_before_a_mouse_click_is_one_walk_and_no_single_move(monkeypatch):
|
||||
use_clock(monkeypatch, VirtualClock())
|
||||
page, pointer = make_pointer()
|
||||
pointer.travel(900.0, 500.0)
|
||||
assert len(page.walks) == 1 and len(page.walks[0]["events"]) > 3
|
||||
assert page.singles == []
|
||||
|
||||
|
||||
def test_the_wheel_burst_is_one_walk_with_its_notches_in_it(monkeypatch):
|
||||
use_clock(monkeypatch, VirtualClock())
|
||||
page, pointer = make_pointer()
|
||||
assert pointer.wheel(0.0, 900.0) is True
|
||||
assert len(page.walks) == 1
|
||||
notches = [e for e in page.walks[0]["events"] if e.is_wheel]
|
||||
assert len(notches) > 1
|
||||
assert sum(e.dy for e in notches) == pytest.approx(900.0)
|
||||
assert page.singles == []
|
||||
|
||||
|
||||
def test_the_idle_movement_and_the_approach_are_each_one_walk(monkeypatch):
|
||||
clock = VirtualClock()
|
||||
use_clock(monkeypatch, clock)
|
||||
page, pointer = make_pointer()
|
||||
pointer.approach("main", "#b", None)
|
||||
page.walks.clear()
|
||||
clock.t += 30.0 # the script was busy elsewhere
|
||||
pointer.approach("main", "#b", None)
|
||||
assert len(page.walks) == 2, "the fidget and the approach are one path each"
|
||||
assert page.singles == []
|
||||
|
||||
|
||||
def test_the_instants_handed_over_are_the_pacers_and_grow(monkeypatch):
|
||||
use_clock(monkeypatch, VirtualClock())
|
||||
page, pointer = make_pointer()
|
||||
pointer.approach("main", "#b", None)
|
||||
ts = [e.t_ms for e in page.walks[0]["events"]]
|
||||
assert ts == sorted(ts) and ts[-1] > 0.0
|
||||
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# 2. Through the real `Actions`: what goes on the wire
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
|
||||
class Reply:
|
||||
def __init__(self, engine, index) -> None:
|
||||
self.engine, self.index = engine, index
|
||||
|
||||
def wait(self, timeout=None):
|
||||
self.engine.log.append(("wait", self.index))
|
||||
return {}, 0
|
||||
|
||||
|
||||
class HeldEngine:
|
||||
"""A connection that records when each command is sent and when its reply is waited for. A reply is only ever read at `wait`, so a
|
||||
command sent before the `wait` of the one before it was sent while that reply was still held."""
|
||||
|
||||
def __init__(self) -> None:
|
||||
self.sent = []
|
||||
self.log = []
|
||||
|
||||
def send_async(self, method, params, session=None):
|
||||
self.log.append(("send", len(self.sent)))
|
||||
self.sent.append((method, dict(params)))
|
||||
return Reply(self, len(self.sent) - 1)
|
||||
|
||||
def send(self, method, params=None, session=None, timeout=None, **kw):
|
||||
return self.send_async(method, params or {}, session).wait(timeout)[0]
|
||||
|
||||
def kinds(self):
|
||||
return [k for k, _i in self.log]
|
||||
|
||||
def params(self, method):
|
||||
return [p for m, p in self.sent if m == method]
|
||||
|
||||
|
||||
class Life:
|
||||
main_frame = "main"
|
||||
|
||||
|
||||
class Injected(FakeInjected):
|
||||
def check_hit_target(self, frame_id, element, point):
|
||||
return "done"
|
||||
|
||||
|
||||
def _real(monkeypatch, *, seed=4242, budget=1.5):
|
||||
use_clock(monkeypatch, VirtualClock())
|
||||
engine = HeldEngine()
|
||||
page = FakePage(box=BOX)
|
||||
actions = Actions(engine, "S", Life(), Injected(page), acts=PageActs(0), session_seed=seed,
|
||||
motion_budget_s=budget, layout="us")
|
||||
pointer = Pointer(actions, Injected(page), 0, seed, budget, lambda: page.viewport_size)
|
||||
return engine, actions, pointer
|
||||
|
||||
|
||||
def _one_stroke_in_order(params):
|
||||
assert len(params) > 3, "a path of one point is not a path"
|
||||
assert len({p["stroke"] for p in params}) == 1
|
||||
ats = [p["at"] for p in params]
|
||||
assert ats == sorted(ats) and len(set(ats)) == len(ats), "the instants of a path increase"
|
||||
|
||||
|
||||
def test_every_point_of_the_approach_is_sent_before_any_reply_is_waited_for(monkeypatch):
|
||||
engine, actions, pointer = _real(monkeypatch)
|
||||
pointer.approach("main", "#b", None)
|
||||
n = len(engine.sent)
|
||||
assert engine.kinds() == ["send"] * n + ["wait"] * n, "a point waited for the reply of the one before it"
|
||||
_one_stroke_in_order(engine.params("Page.dispatchMouseEvent"))
|
||||
|
||||
|
||||
def test_every_point_of_the_walk_before_a_click_is_in_one_stroke(monkeypatch):
|
||||
engine, actions, pointer = _real(monkeypatch)
|
||||
pointer.travel(900.0, 500.0)
|
||||
n = len(engine.sent)
|
||||
assert engine.kinds() == ["send"] * n + ["wait"] * n
|
||||
_one_stroke_in_order(engine.params("Page.dispatchMouseEvent"))
|
||||
|
||||
|
||||
def test_the_wheel_burst_is_one_stroke_of_moves_and_notches(monkeypatch):
|
||||
engine, actions, pointer = _real(monkeypatch)
|
||||
assert pointer.wheel(0.0, 900.0) is True
|
||||
n = len(engine.sent)
|
||||
assert engine.kinds() == ["send"] * n + ["wait"] * n
|
||||
everything = [p for _m, p in engine.sent]
|
||||
assert len({p["stroke"] for p in everything}) == 1
|
||||
ats = [p["at"] for p in everything]
|
||||
assert ats == sorted(ats)
|
||||
assert sum(p["deltaY"] for p in engine.params("Page.dispatchWheelEvent")) == pytest.approx(900.0)
|
||||
|
||||
|
||||
def test_the_path_of_one_gesture_is_not_the_stroke_of_the_next(monkeypatch):
|
||||
engine, actions, pointer = _real(monkeypatch)
|
||||
pointer.travel(900.0, 500.0)
|
||||
first = {p["stroke"] for p in engine.params("Page.dispatchMouseEvent")}
|
||||
pointer.travel(100.0, 100.0)
|
||||
ids = {p["stroke"] for p in engine.params("Page.dispatchMouseEvent")}
|
||||
assert len(first) == 1 and len(ids) == 2
|
||||
|
||||
|
||||
def test_a_lone_press_release_and_one_step_move_each_wait_for_their_own_reply(monkeypatch):
|
||||
engine, actions, pointer = _real(monkeypatch)
|
||||
actions.move(10.0, 10.0)
|
||||
actions.mouse_down()
|
||||
actions.mouse_up()
|
||||
assert engine.kinds() == ["send", "wait"] * 3
|
||||
assert all("stroke" not in p and "at" not in p for _m, p in engine.sent)
|
||||
|
||||
|
||||
def test_the_explicit_move_walks_its_path_as_a_stroke_and_then_is_one_command(monkeypatch):
|
||||
engine, actions, pointer = _real(monkeypatch)
|
||||
pointer.move(900.0, 500.0)
|
||||
actions.move(900.0, 500.0)
|
||||
n = len(engine.sent) - 1
|
||||
assert engine.kinds() == ["send"] * n + ["wait"] * n + ["send", "wait"]
|
||||
@@ -27,6 +27,7 @@ import time
|
||||
import pytest
|
||||
|
||||
from invisible_core.juggler import Ev, MIN_EVENT_INTERVAL_MS, fit_timeline
|
||||
from invisible_core.juggler import _pacing
|
||||
from invisible_core.juggler import _motion
|
||||
|
||||
from invisible_playwright import _cursor
|
||||
@@ -53,6 +54,11 @@ def landing_on(monkeypatch):
|
||||
# 1. B2 - the schedule survives a platform that cannot keep it
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
|
||||
def _drive(evs, emit):
|
||||
"""The pacer's loop the core's `Actions.walk` runs, on the pointer's clock (the virtual one when a test put it in place)."""
|
||||
_pacing.drive(evs, emit, now=pointer_mod._CLOCK.now, sleep=pointer_mod._CLOCK.sleep)
|
||||
|
||||
|
||||
def _path(seed=42, frm=(120.0, 640.0), to=(980.0, 200.0)):
|
||||
return _motion.CursorMotion(seed).path(frm[0], frm[1], to[0], to[1])
|
||||
|
||||
@@ -76,7 +82,7 @@ def test_lateness_does_not_accumulate(monkeypatch):
|
||||
use_clock(monkeypatch, clock)
|
||||
sink = []
|
||||
|
||||
pointer_mod._drive(evs, lambda x, y: sink.append(clock.now()))
|
||||
_drive(evs, lambda x, y: sink.append(clock.now()))
|
||||
|
||||
delivered_ms = (sink[-1] - sink[0]) * 1000.0
|
||||
naive_ms = planned_ms + 6.0 * len(evs)
|
||||
@@ -98,7 +104,7 @@ def test_a_platform_too_slow_for_the_plan_pays_in_waypoints(monkeypatch):
|
||||
use_clock(monkeypatch, clock)
|
||||
sink = []
|
||||
|
||||
pointer_mod._drive(evs, lambda x, y: sink.append(clock.now()))
|
||||
_drive(evs, lambda x, y: sink.append(clock.now()))
|
||||
assert len(sink) < len(evs) * 0.75, (
|
||||
"%d of %d waypoints survived a platform three times too slow"
|
||||
% (len(sink), len(evs))
|
||||
@@ -113,7 +119,7 @@ def test_no_two_events_are_delivered_in_the_same_instant(monkeypatch):
|
||||
use_clock(monkeypatch, clock)
|
||||
evs = _events(_path())
|
||||
sink = []
|
||||
pointer_mod._drive(evs, lambda x, y: sink.append(clock.now()))
|
||||
_drive(evs, lambda x, y: sink.append(clock.now()))
|
||||
gaps = [(sink[i] - sink[i - 1]) * 1000.0 for i in range(1, len(sink))]
|
||||
assert min(gaps) >= MIN_EVENT_INTERVAL_MS - 1e-6, min(gaps)
|
||||
|
||||
@@ -125,7 +131,7 @@ def test_a_dropped_waypoint_is_the_one_that_was_superseded(monkeypatch):
|
||||
use_clock(monkeypatch, clock)
|
||||
evs = _events(_path())
|
||||
sink = []
|
||||
pointer_mod._drive(evs, lambda x, y: sink.append((clock.now(), x, y)))
|
||||
_drive(evs, lambda x, y: sink.append((clock.now(), x, y)))
|
||||
assert (sink[-1][1], sink[-1][2]) == (evs[-1].x, evs[-1].y), (
|
||||
"the endpoint of a movement is never dropped"
|
||||
)
|
||||
@@ -181,9 +187,9 @@ def test_delivered_timing_on_a_real_clock(seed):
|
||||
# BOTH dispatchers, so comparing them back to back on the same busy machine
|
||||
# is the only form that measures the change instead of the moment. Same
|
||||
# rule the project applies to every other A/B.
|
||||
a = run(pointer_mod._drive) # A
|
||||
a = run(_drive) # A
|
||||
b = run(naive) # B
|
||||
c = run(pointer_mod._drive) # A again, so a drifting machine shows up
|
||||
c = run(_drive) # A again, so a drifting machine shows up
|
||||
|
||||
def span_ms(sink):
|
||||
return (sink[-1] - sink[0]) * 1000.0
|
||||
|
||||
@@ -220,8 +220,9 @@ def play(page, clock, ops):
|
||||
|
||||
|
||||
def _normalised(log):
|
||||
# JSON round trip: the golden is JSON, and a float survives it exactly.
|
||||
return json.loads(json.dumps(log))
|
||||
# JSON round trip: the golden is JSON, and a float survives it exactly. `stroke` and `at` are the tags of the core's strokes, which
|
||||
# 5d9ad70 did not send: what the golden holds is the events and the instants they went out at, which the log's `t` still is.
|
||||
return [{k: v for k, v in e.items() if k not in ("stroke", "at")} for e in json.loads(json.dumps(log))]
|
||||
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
|
||||
Reference in new issue
Block a user