From 1b4c319fdbc3930dda68e8b4747fd4701c99f9c5 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Tue, 28 Jul 2026 10:01:18 +0545 Subject: [PATCH] style: format app-capture README code examples Add blank lines between function definitions per PEP 8. --- src/window/switcher/app-capture/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/window/switcher/app-capture/README.md b/src/window/switcher/app-capture/README.md index d146ffc..57921a9 100644 --- a/src/window/switcher/app-capture/README.md +++ b/src/window/switcher/app-capture/README.md @@ -38,9 +38,11 @@ Once compiled, you can easily load the library into any Python script using PyGO ```python import gi + gi.require_version("AppCapture", "1.0") from gi.repository import AppCapture + def on_frame_ready(capture, address, data, width, height, stride): # 'data' is a GLib.Bytes object containing the raw ARGB32 pixel data # Convert it to a Cairo Surface or GdkPixbuf @@ -49,9 +51,11 @@ def on_frame_ready(capture, address, data, width, height, stride): # Example: Request the next frame, but wait for damage (0% CPU idle) capture.capture_by_handle(address, 300, 168, True) + def on_frame_failed(capture, address, reason): print(f"Failed to capture {address}: {reason}") + # 1. Initialize the capture module capture = AppCapture.Capture() capture.connect("frame-ready", on_frame_ready)