0.1.5 update video and Chinese changelog

Real footage of the installed 0.1.5 apps, composited in Remotion with
shape morphs between sections; synthesized score and UI sounds. Logs
P3-17 (ElyTable keyboard zoom leaves the grid half-scrolled).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-15 09:24:06 -04:00
1 parent 2e1ba5eded
commit 8f31e53cfc
57 files changed
+8051

No files matched your search

+306
View File
@@ -0,0 +1,306 @@
"""Real input, window placement and screen capture for the update video."""
import ctypes
import json
import math
import os
import shutil
import subprocess
import time
import tkinter
from contextlib import contextmanager
from ctypes import wintypes
from pathlib import Path
from PIL import ImageGrab
user32 = ctypes.windll.user32
user32.SetProcessDpiAwarenessContext(ctypes.c_void_p(-4))
user32.SetWindowPos.argtypes = [wintypes.HWND, wintypes.HWND, ctypes.c_int, ctypes.c_int, ctypes.c_int,
ctypes.c_int, wintypes.UINT]
ctypes.windll.winmm.timeBeginPeriod(1)
# The captured region, in physical pixels.
X0, Y0, W, H = 1536, 504, 2048, 1152
APPS = Path(os.environ["LOCALAPPDATA"]) / "Programs" / "Ely Office"
DATA = Path(os.environ["LOCALAPPDATA"]) / "ElyOffice"
KEEP = DATA.with_name("ElyOffice.video-keep")
FFMPEG = shutil.which("ffmpeg")
class MOUSEINPUT(ctypes.Structure):
_fields_ = [("dx", wintypes.LONG), ("dy", wintypes.LONG), ("mouseData", wintypes.DWORD),
("dwFlags", wintypes.DWORD), ("time", wintypes.DWORD), ("dwExtraInfo", ctypes.c_size_t)]
class KEYBDINPUT(ctypes.Structure):
_fields_ = [("wVk", wintypes.WORD), ("wScan", wintypes.WORD), ("dwFlags", wintypes.DWORD),
("time", wintypes.DWORD), ("dwExtraInfo", ctypes.c_size_t)]
class _U(ctypes.Union):
_fields_ = [("mi", MOUSEINPUT), ("ki", KEYBDINPUT), ("pad", ctypes.c_byte * 32)]
class INPUT(ctypes.Structure):
_fields_ = [("type", wintypes.DWORD), ("u", _U)]
def _send(*inputs):
arr = (INPUT * len(inputs))(*inputs)
if user32.SendInput(len(inputs), arr, ctypes.sizeof(INPUT)) != len(inputs):
raise OSError("SendInput was blocked")
def _mouse(flags, data=0):
i = INPUT(type=0)
i.u.mi = MOUSEINPUT(0, 0, data, flags, 0, 0)
return i
def _key(vk=0, scan=0, flags=0):
i = INPUT(type=1)
i.u.ki = KEYBDINPUT(vk, scan, flags, 0, 0)
return i
VK = {"ctrl": 0x11, "shift": 0x10, "alt": 0x12, "enter": 0x0D, "esc": 0x1B, "tab": 0x09,
"up": 0x26, "down": 0x28, "left": 0x25, "right": 0x27, "back": 0x08, "space": 0x20,
"home": 0x24, "end": 0x23, "delete": 0x2E, "=": 0xBB, "-": 0xBD}
EXTENDED = {0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x2D, 0x2E}
class Take:
"""One recorded clip: the capture and its input log."""
def __init__(self, name, out: Path):
self.name, self.out = name, out
self.events = []
self.zero = None
self.proc = None
# Positions are region pixels; the log keeps them so.
def log(self, kind, **fields):
self.events.append({"t": round(time.perf_counter() - self.zero, 4), "kind": kind, **fields})
def start(self):
path = self.out / f"{self.name}.mp4"
grab = (f"ddagrab=output_idx=0:framerate=60:offset_x={X0}:offset_y={Y0}:"
f"video_size={W}x{H}:draw_mouse=0,hwdownload,format=bgra")
self.proc = subprocess.Popen(
[FFMPEG, "-hide_banner", "-loglevel", "error", "-y", "-f", "lavfi", "-i", grab,
"-c:v", "h264_nvenc", "-preset", "p7", "-tune", "hq", "-rc", "vbr", "-cq", "14",
"-pix_fmt", "yuv420p", str(path)], stdin=subprocess.PIPE)
self.zero = time.perf_counter()
time.sleep(1.5)
if self.proc.poll() is not None:
raise RuntimeError("the capture stopped at once")
# A square flashes in a corner; a frame diff finds it.
front = user32.GetForegroundWindow()
flash = tkinter.Tk()
flash.overrideredirect(True)
flash.attributes("-topmost", True)
flash.configure(bg="#ff00ff")
flash.geometry(f"60x60+{X0 + W - 90}+{Y0 + H - 90}")
flash.update()
self.log("sync", x=W - 60, y=H - 60)
time.sleep(0.3)
flash.destroy()
_send(_key(0x12), _key(0x12, 0, 2))
user32.SetForegroundWindow(front)
time.sleep(0.5)
if user32.GetForegroundWindow() != front:
raise RuntimeError("the app lost the foreground to the sync flash")
def stop(self):
time.sleep(0.8)
self.proc.communicate(b"q")
if self.proc.returncode != 0:
raise RuntimeError(f"the capture failed: {self.proc.returncode}")
(self.out / f"{self.name}.json").write_text(json.dumps(self.events, ensure_ascii=False, indent=1),
encoding="utf-8")
TAKE: Take | None = None
def _log(kind, **fields):
if TAKE is not None and TAKE.zero is not None:
TAKE.log(kind, **fields)
def where():
p = wintypes.POINT()
user32.GetCursorPos(ctypes.byref(p))
return p.x - X0, p.y - Y0
def _ease(t):
return 0.5 - 0.5 * math.cos(math.pi * t)
def move_to(x, y, dur=0.6, path=None):
"""Moves the pointer to region (x, y); `path` bends the line."""
sx, sy = where()
steps = max(1, int(dur * 240))
start = time.perf_counter()
for i in range(1, steps + 1):
f = _ease(i / steps)
px, py = (path(f) if path else (sx + (x - sx) * f, sy + (y - sy) * f))
user32.SetCursorPos(int(round(X0 + px)), int(round(Y0 + py)))
_log("move", x=round(px, 1), y=round(py, 1))
target = start + i * dur / steps
while time.perf_counter() < target:
time.sleep(0.0005)
user32.SetCursorPos(X0 + int(x), Y0 + int(y))
def press(right=False):
x, y = where()
down, up = (0x8, 0x10) if right else (0x2, 0x4)
_send(_mouse(down))
_log("down", x=x, y=y, right=right)
time.sleep(0.07)
_send(_mouse(up))
_log("up", x=x, y=y, right=right)
def click(x, y, dur=0.6, right=False, settle=0.12):
move_to(x, y, dur)
time.sleep(settle)
press(right)
def wheel(notches, gap=0.09):
"""Scrolls `notches` (negative is down), one notch at a time."""
step = -120 if notches < 0 else 120
for _ in range(abs(notches)):
_send(_mouse(0x0800, step & 0xFFFFFFFF))
x, y = where()
_log("wheel", x=x, y=y, down=notches < 0)
time.sleep(gap)
def drag(x, y, dur=1.0):
sx, sy = where()
_send(_mouse(0x2))
_log("down", x=sx, y=sy, right=False)
time.sleep(0.15)
move_to(x, y, dur)
time.sleep(0.15)
_send(_mouse(0x4))
_log("up", x=x, y=y, right=False)
def key(chord, label=None):
codes = [VK[k] if k in VK else ord(k.upper()) for k in chord.split("+")]
downs = [_key(c, 0, 1 if c in EXTENDED else 0) for c in codes]
ups = [_key(c, 0, (1 if c in EXTENDED else 0) | 2) for c in reversed(codes)]
_send(*downs)
_log("key", key=label or chord)
time.sleep(0.05)
_send(*ups)
def type_text(text, cps=9.0):
"""Types `text` as Unicode characters at a human pace."""
for ch in text:
if ch == "\n":
key("enter")
else:
code = ord(ch)
_send(_key(0, code, 4), _key(0, code, 4 | 2))
_log("char", ch=ch)
time.sleep(1 / cps)
def window_of(pid, timeout=60):
found = []
@ctypes.WINFUNCTYPE(wintypes.BOOL, wintypes.HWND, wintypes.LPARAM)
def each(h, _):
owner = wintypes.DWORD()
user32.GetWindowThreadProcessId(h, ctypes.byref(owner))
if owner.value == pid and user32.IsWindowVisible(h) and not user32.GetWindow(h, 4):
found.append(h)
return True
deadline = time.time() + timeout
while time.time() < deadline:
found.clear()
user32.EnumWindows(each, 0)
if found:
return found[0]
time.sleep(0.2)
raise RuntimeError(f"process {pid} showed no window")
def place(h):
user32.ShowWindow(h, 9)
if not user32.SetWindowPos(h, -1, X0, Y0, W, H, 0x40):
raise ctypes.WinError()
# The visible frame, without DWM's invisible border, fills the region.
seen, outer = wintypes.RECT(), wintypes.RECT()
ctypes.windll.dwmapi.DwmGetWindowAttribute(h, 9, ctypes.byref(seen), ctypes.sizeof(seen))
user32.GetWindowRect(h, ctypes.byref(outer))
left, top = seen.left - outer.left, seen.top - outer.top
right, bottom = outer.right - seen.right, outer.bottom - seen.bottom
user32.SetWindowPos(h, -1, X0 - left, Y0 - top, W + left + right, H + top + bottom, 0x40)
# Alt lets this process take the foreground.
_send(_key(0x12), _key(0x12, 0, 2))
user32.SetForegroundWindow(h)
time.sleep(0.4)
if user32.GetForegroundWindow() != h:
raise RuntimeError("the app is not in front; no input sent")
def shot(path, scale=0.5):
img = ImageGrab.grab(bbox=(X0, Y0, X0 + W, Y0 + H), all_screens=True)
img.resize((int(W * scale), int(H * scale))).save(path)
def launch(app, exe, *files, wait=6.0):
env = dict(os.environ, ELY_LOCALE="zh-CN", ELY_APPEARANCE="dark", ELY_LOG="info", ELY_NO_DIALOG="1")
proc = subprocess.Popen([str(APPS / app / exe), *map(str, files)], env=env)
h = window_of(proc.pid)
place(h)
time.sleep(wait)
place(h)
return proc, h
def quit_all():
for exe in ("ely-doc", "ely-table", "ely-show", "ely-mark", "ely-pdf", "ely-tree"):
subprocess.run(["taskkill", "/F", "/IM", f"{exe}.exe"], capture_output=True)
for exe in ("ely-lok-worker", "ely-pdf-worker"):
subprocess.run(["taskkill", "/F", "/IM", f"{exe}.exe"], capture_output=True)
time.sleep(1.5)
@contextmanager
def fresh_data():
"""The user's ElyOffice data waits aside; recordings start clean."""
if KEEP.exists():
raise RuntimeError(f"{KEEP} exists: restore it by hand first")
quit_all()
if DATA.exists():
DATA.rename(KEEP)
try:
yield
finally:
quit_all()
if DATA.exists():
shutil.rmtree(DATA)
if KEEP.exists():
KEEP.rename(DATA)
@contextmanager
def take(name, out: Path):
global TAKE
TAKE = Take(name, out)
TAKE.start()
try:
yield TAKE
finally:
TAKE.stop()
TAKE = None
+15
View File
@@ -0,0 +1,15 @@
# Usage: explore.py <app> <exe> <file|-> <out.png> [python actions]
import sys
import time
from pathlib import Path
from drive import * # noqa: F403
app, exe, file, out = sys.argv[1:5]
actions = sys.argv[5] if len(sys.argv) > 5 else ""
with fresh_data():
files = [] if file == "-" else [Path(file).resolve()]
proc, h = launch(app, exe, *files)
exec(actions)
time.sleep(0.6)
shot(out)
+32
View File
@@ -0,0 +1,32 @@
"""Copies synced takes into public/footage with events in footage time.
Usage: prep.py <takes dir>
Writes public/footage/<name>.mp4 and <name>.json: {fps, size, events, menus}.
Event times are footage seconds; positions are footage pixels (2048×1152).
"""
import json
import shutil
import sys
from pathlib import Path
TAKES = ["menus", "cells", "doc", "table", "show", "more"]
# Submenu panels as recorded (x0, y0, x1, y1), for the safe triangle.
SUBMENUS = {
"menus": {"parent": [1100, 610, 1396, 652], "panel": [1394, 576, 1784, 1144]},
"doc": {"parent": [1072, 702, 1370, 742], "panel": [1364, 698, 1660, 874]},
"show": {"parent": [1182, 598, 1478, 638], "panel": [1474, 594, 1770, 774]},
}
root = Path(sys.argv[1])
out = Path(__file__).resolve().parent.parent / "public" / "footage"
out.mkdir(parents=True, exist_ok=True)
for name in TAKES:
offset = json.loads((root / f"{name}.sync.json").read_text())["offset"]
events = json.loads((root / f"{name}.json").read_text(encoding="utf-8"))
for event in events:
event["t"] = round(event["t"] + offset, 4)
shutil.copyfile(root / f"{name}.60.mp4", out / f"{name}.mp4")
data = {"fps": 60, "size": [2048, 1152], "events": events, "menus": SUBMENUS.get(name)}
(out / f"{name}.json").write_text(json.dumps(data, ensure_ascii=False), encoding="utf-8")
actions = [e for e in events if e["kind"] not in ("move", "sync")]
print(name, " ".join(f"{e['kind']}@{e['t']:.2f}" for e in actions))
+100
View File
@@ -0,0 +1,100 @@
# Writes the sample files the recordings open. Usage: samples.py <dir>
import sys
from pathlib import Path
import docx
import openpyxl
from docx.oxml.ns import qn
from docx.shared import Pt
from openpyxl.styles import Font
from pptx import Presentation
from pptx.util import Inches, Pt as PPt
out = Path(sys.argv[1])
out.mkdir(parents=True, exist_ok=True)
ROWS = [
("模块", "负责人", "状态", "进度"),
("编辑器", "林夏", "已完成", "100%"),
("表格", "周沐", "进行中", "72%"),
("演示", "陈一", "进行中", "58%"),
("发布", "许言", "未开始", "0%"),
]
mark = """# 0.1.5 发布计划
这一版的重点是**更顺手**:菜单、表格与右键都照常用的软件来。
| 模块 | 负责人 | 状态 | 进度 |
| --- | --- | --- | --- |
| 编辑器 | 林夏 | **已完成** | 100% |
| 表格 | 周沐 | 进行中 | 72% |
| 演示 | 陈一 | 进行中 | 58% |
| 发布 | 许言 | 未开始 | 0% |
> [!TIP]
> 点任意一格即可在格内编辑,Tab 到下一格。
## 下一步
- 收集反馈 :rocket:
- 整理文档
"""
(out / "发布计划.md").write_text(mark, encoding="utf-8")
(out / "会议记录.md").write_text("# 会议记录\n\n- 确认发布时间\n", encoding="utf-8")
(out / "读书笔记.md").write_text("# 读书笔记\n\n摘录与想法。\n", encoding="utf-8")
d = docx.Document()
d.styles["Normal"].font.size = Pt(12)
# One installed face for every script: no missing-font banner.
FACE = "微软雅黑"
defaults = d.styles.element.find(qn("w:docDefaults"))
for fonts in [*defaults.iter(qn("w:rFonts")), *(style.element.get_or_add_rPr().get_or_add_rFonts()
for style in d.styles if style.type == 1)]:
for name in list(fonts.attrib):
if name.endswith("Theme"):
del fonts.attrib[name]
for attr in ("w:ascii", "w:hAnsi", "w:eastAsia", "w:cs"):
fonts.set(qn(attr), FACE)
d.add_heading("第三季度工作汇报", 1)
d.add_paragraph("本季度完成了编辑器与表格两大模块,演示模块进入收尾阶段。下表列出各模块的负责人与进度。")
t = d.add_table(rows=len(ROWS), cols=4)
t.style = "Table Grid"
for r, row in enumerate(ROWS):
for c, value in enumerate(row):
t.cell(r, c).text = value
d.add_paragraph("下季度计划:完善导出与打印,补齐快捷键。")
d.save(out / "工作汇报.docx")
wb = openpyxl.Workbook()
ws = wb.active
ws.title = "销售"
ws.append(["地区", "一月", "二月", "三月", "合计"])
data = [("华东", 128, 142, 160), ("华南", 96, 104, 121), ("华北", 88, 97, 110), ("西南", 64, 71, 83)]
for i, (name, *months) in enumerate(data, start=2):
ws.append([name, *months, f"=SUM(B{i}:D{i})"])
ws.append(["合计", "=SUM(B2:B5)", "=SUM(C2:C5)", "=SUM(D2:D5)", "=SUM(E2:E5)"])
for cell in ws[1]:
cell.font = Font(bold=True)
for col in "ABCDE":
ws.column_dimensions[col].width = 12
wb.save(out / "季度销售.xlsx")
p = Presentation()
p.slide_width, p.slide_height = Inches(13.333), Inches(7.5)
s = p.slides.add_slide(p.slide_layouts[0])
s.shapes.title.text = "Ely Office 0.1.5"
s.placeholders[1].text = "更顺手的一次更新"
s = p.slides.add_slide(p.slide_layouts[5])
s.shapes.title.text = "模块进度"
table = s.shapes.add_table(len(ROWS), 4, Inches(1.2), Inches(2), Inches(10.9), Inches(3.6)).table
for r, row in enumerate(ROWS):
for c, value in enumerate(row):
table.cell(r, c).text = value
table.cell(r, c).text_frame.paragraphs[0].runs[0].font.size = PPt(20)
for title in ("用户反馈", "编辑器", "表格", "演示", "文档", "快捷键", "右键菜单", "跨平台", "发布节奏", "下一步"):
s = p.slides.add_slide(p.slide_layouts[1])
s.shapes.title.text = title
s.placeholders[1].text = "要点一\n要点二"
p.save(out / "季度汇报.pptx")
print("samples in", out)
+47
View File
@@ -0,0 +1,47 @@
"""Finds each take's sync jump; writes footage time = log time + offset.
Usage: sync.py <takes dir> <name> ...
Converts each take to constant 60 fps (`<name>.60.mp4`) and writes
`<name>.sync.json` with the offset and the source start time.
"""
import json
import subprocess
import sys
from pathlib import Path
import av
import numpy as np
def first_change(video: Path, x: int, y: int, after: float, until: float):
"""The first frame time when the patch at (x, y) changes."""
with av.open(str(video)) as box:
stream = box.streams.video[0]
start = float(stream.start_time * stream.time_base) if stream.start_time else 0.0
base = None
for frame in box.decode(stream):
t = float(frame.pts * stream.time_base) - start
if t < after:
continue
if t > until:
break
patch = frame.to_ndarray(format="gray")[y - 24:y + 24, x - 24:x + 24].astype(np.int16)
if base is None:
base = patch
continue
if np.abs(patch - base).mean() > 6:
return t, start
raise RuntimeError(f"{video.name}: no sync jump between {after} and {until} s")
root = Path(sys.argv[1])
for name in sys.argv[2:]:
events = json.loads((root / f"{name}.json").read_text(encoding="utf-8"))
sync = next(e for e in events if e["kind"] == "sync")
seen, start = first_change(root / f"{name}.mp4", sync["x"], sync["y"], sync["t"] - 0.5, sync["t"] + 1.5)
offset = round(seen - sync["t"], 4)
(root / f"{name}.sync.json").write_text(json.dumps({"offset": offset, "start": start}), encoding="utf-8")
subprocess.run(["ffmpeg", "-hide_banner", "-loglevel", "error", "-y", "-i", str(root / f"{name}.mp4"),
"-vf", "fps=60", "-c:v", "h264_nvenc", "-preset", "p7", "-rc", "vbr", "-cq", "14",
"-g", "30", "-pix_fmt", "yuv420p", str(root / f"{name}.60.mp4")], check=True)
print(f"{name}: jump seen at {seen:.3f} s, logged at {sync['t']:.3f} s, offset {offset:+.3f} s")
+156
View File
@@ -0,0 +1,156 @@
"""The recorded takes. Usage: takes.py <out dir> <samples dir> [take ...]"""
import shutil
import subprocess
import sys
import tempfile
import time
from pathlib import Path
from drive import * # noqa: F403
from drive import _log
def menus(files):
"""ElyMark: right-click › 表格 ▸, a diagonal over 插入 into the submenu."""
proc, h = launch("ElyMark", "ely-mark.exe", files / "发布计划.md")
with take("menus", OUT):
move_to(900, 520, 0.8)
time.sleep(0.4)
click(1100, 394, 0.8, right=True)
time.sleep(0.9)
move_to(1200, 632, 0.7)
time.sleep(1.1)
# Across 插入, which has its own submenu, to 下移该行.
move_to(1490, 824, 0.95)
time.sleep(0.8)
press()
time.sleep(1.6)
move_to(1000, 900, 0.9)
time.sleep(0.8)
def cells(files):
"""ElyMark: a cell opens alone, shows its source, Tab and arrows move."""
proc, h = launch("ElyMark", "ely-mark.exe", files / "发布计划.md")
with take("cells", OUT):
move_to(1000, 480, 0.8)
time.sleep(0.3)
click(1236, 344, 0.8)
time.sleep(1.4)
key("tab", "Tab")
time.sleep(1.1)
key("down", "↓")
time.sleep(1.0)
key("end", "End")
time.sleep(0.3)
for _ in range(3):
key("back", "⌫")
time.sleep(0.16)
time.sleep(0.3)
type_text("85%", cps=5)
time.sleep(0.8)
key("enter", "Enter")
time.sleep(1.4)
move_to(1100, 760, 0.8)
time.sleep(0.8)
def doc(files):
"""ElyDoc: Word-style table menu, insert a row, drag a column border."""
proc, h = launch("ElyDoc", "ely-doc.exe", files / "工作汇报.docx", wait=8)
with take("doc", OUT):
move_to(1000, 760, 0.8)
time.sleep(0.3)
click(1070, 634, 0.7)
time.sleep(0.4)
click(1070, 634, 0.2, right=True)
time.sleep(0.9)
move_to(1140, 722, 0.6)
time.sleep(0.9)
# Across 删除, which has its own submenu.
move_to(1468, 848, 0.9)
time.sleep(0.7)
press()
time.sleep(1.4)
# The border between 负责人 and 状态.
move_to(962, 560, 0.8)
time.sleep(0.7)
drag(1040, 560, 1.1)
time.sleep(1.4)
def table(files):
"""ElyTable: Excel-style column header menu, insert a column."""
proc, h = launch("ElyTable", "ely-table.exe", files / "季度销售.xlsx", wait=8)
with take("table", OUT):
move_to(600, 500, 0.8)
time.sleep(0.3)
click(406, 208, 0.8, right=True)
time.sleep(1.1)
move_to(510, 294, 0.6)
time.sleep(0.6)
press()
time.sleep(1.6)
move_to(700, 520, 0.8)
time.sleep(0.6)
def show(files):
"""ElyShow: the slide strip scrolls; PowerPoint-style table menu."""
proc, h = launch("ElyShow", "ely-show.exe", files / "季度汇报.pptx", wait=8)
with take("show", OUT):
move_to(180, 640, 0.9)
time.sleep(0.3)
wheel(-9, 0.11)
time.sleep(0.6)
wheel(9, 0.11)
time.sleep(0.5)
click(180, 380, 0.6)
time.sleep(1.4)
click(1180, 530, 0.8)
time.sleep(0.4)
click(1180, 530, 0.2, right=True)
time.sleep(0.9)
move_to(1250, 618, 0.6)
time.sleep(0.8)
move_to(1578, 662, 0.8)
time.sleep(0.6)
press()
time.sleep(1.6)
def more(files):
"""ElyMark: a second launch hands its file over; the recent list clears."""
proc, h = launch("ElyMark", "ely-mark.exe", files / "发布计划.md", files / "读书笔记.md")
with take("more", OUT):
move_to(900, 600, 0.8)
time.sleep(0.6)
env = dict(os.environ, ELY_LOCALE="zh-CN", ELY_APPEARANCE="dark")
subprocess.Popen([str(APPS / "ElyMark" / "ely-mark.exe"), str(files / "会议记录.md")], env=env)
_log("launch", file="会议记录.md")
time.sleep(2.6)
click(166, 1082, 1.0)
time.sleep(1.8)
move_to(700, 700, 0.8)
time.sleep(0.6)
OUT = Path(sys.argv[1])
OUT.mkdir(parents=True, exist_ok=True)
SAMPLES = Path(sys.argv[2])
ALL = {"menus": menus, "cells": cells, "doc": doc, "table": table, "show": show, "more": more}
names = sys.argv[3:] or list(ALL)
with fresh_data():
for name in names:
# Each take opens untouched copies under the same names.
with tempfile.TemporaryDirectory(prefix="ely-video-") as tmp:
files = Path(tmp) / "样例"
shutil.copytree(SAMPLES, files)
try:
ALL[name](files)
finally:
quit_all()
# The next take starts without this one's session.
if DATA.exists():
shutil.rmtree(DATA)
print("recorded", name, flush=True)