Confirm the format-specific save options before checking output

This commit is contained in:
Codex committed 2026-11-30 18:33:08 +01:00
1 parent fc09273dd9
commit 2580039bd4
1 file changed
+15 -1
+15 -1
View File
@@ -105,7 +105,21 @@ try:
name=ctypes.create_unicode_buffer(str(filename))
assert user.SendMessageW(field[0],12,0,ctypes.addressof(name))
assert user.PostMessageW(button[0],245,0,0)
wait(lambda: filename.exists() and filename.stat().st_size>0, f"Missing {filename}")
time.sleep(.8)
def saved():
if filename.exists() and filename.stat().st_size>0:
return True
dialogs=state()["dialogs"]
if dialogs:
print("Confirming format options",dialogs[-1].get("kind"),flush=True)
call("ui.dialog.confirm")
return False
try:
wait(saved, f"Missing {filename}")
except AssertionError:
s=state()
print("Save state",s["fileDialog"],s["documents"],s["ui"].get("status"),"files",list(root.iterdir()),"windows",controls(),flush=True)
raise
wait(lambda: not state()["fileDialog"], "Picker did not close")
def shortcut(**mods):
return call("ui.key",key="s",cmd=True,ctrl=True,**mods)