MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / _save_screenshot

Function _save_screenshot

scripts/website/syndicate_browser_posts.py:245–253  ·  view source on GitHub ↗
(page, slug: str, label: str)

Source from the content-addressed store, hash-verified

243
244
245def _save_screenshot(page, slug: str, label: str) -> Path:
246 SCREENSHOT_DIR.mkdir(parents=True, exist_ok=True)
247 stamp = dt.datetime.now(dt.timezone.utc).strftime("%Y%m%dT%H%M%SZ")
248 path = SCREENSHOT_DIR / f"{slug}-{label}-{stamp}.png"
249 try:
250 page.screenshot(path=str(path), full_page=True)
251 except Exception: # noqa: BLE001 — never let a screenshot failure mask the real error
252 return path
253 return path
254
255
256class FoojayAdapter:

Callers 3

submit_draftMethod · 0.85
submit_draftMethod · 0.85
run_adapterFunction · 0.85

Calls 3

mkdirMethod · 0.45
nowMethod · 0.45
screenshotMethod · 0.45

Tested by

no test coverage detected