Show a patch.

GET /api/1.1/patches/16420/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 16420,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/16420/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/16420/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20220629070416.17550-15-tomi.valkeinen@ideasonboard.com>",
    "date": "2022-06-29T07:04:16",
    "name": "[libcamera-devel,v2,14/14] py: Add hotplug-monitor.py",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "0e46570e6f0a8d4c016d5bc54aae9e75490665df",
    "submitter": {
        "id": 109,
        "url": "https://patchwork.libcamera.org/api/1.1/people/109/?format=api",
        "name": "Tomi Valkeinen",
        "email": "tomi.valkeinen@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/16420/mbox/",
    "series": [
        {
            "id": 3230,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3230/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3230",
            "date": "2022-06-29T07:04:02",
            "name": "Python bindings event handling",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/3230/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/16420/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/16420/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>",
        "X-Original-To": "parsemail@patchwork.libcamera.org",
        "Delivered-To": "parsemail@patchwork.libcamera.org",
        "Received": [
            "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 48961BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 29 Jun 2022 07:05:01 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E203C6565D;\n\tWed, 29 Jun 2022 09:05:00 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5662E6564D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 29 Jun 2022 09:04:48 +0200 (CEST)",
            "from deskari.lan (91-158-154-79.elisa-laajakaista.fi\n\t[91.158.154.79])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B690C4A8;\n\tWed, 29 Jun 2022 09:04:47 +0200 (CEST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1656486301;\n\tbh=9IF/8cQaAqh4IDA/idC7EzTVcSpnho5mCs7AV/Irp0k=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=xb+TSo/chmDot28pYiQ1w/6jz/Tbd9j4YOVjydHc/CrJvYW+AGE62skDslmSWIC2i\n\tuhKk6IlldYzlDOWyl5zdY+uKKcrMYj3I/DZ6FslcZljI2vspX+xTI3Vn0d0IHsD3sU\n\tqZJWgVnEWp9TXlfsUK0vKfFTaqcB1Jd/7QC9A9821Kocrvj5/oCcJVBncm+SQQOr5Y\n\tlhhYv2OjPjatxRpNBjmlzJ9U6BFVarn9/rxKD9UyVuWG6+hYjIyQrzFGkjbkcQXjIA\n\t7+3jau2uqmDO7uhNWEP/IBnbDrP98aPSNSLPm8P+kIpP4SNHaeAXGTWiIkatfxh6hw\n\tyHKAJ9IEXCG4A==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1656486288;\n\tbh=9IF/8cQaAqh4IDA/idC7EzTVcSpnho5mCs7AV/Irp0k=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=uwi0HuD7b66EO0YxRi1jofo97HHNO2YIVJjAa028FY4DzLiGKmz+qpeIbgf7wv2/V\n\t1M8odTc3n2pahu4GX5c6y30LFMqZ0Ly/wRLNZC1uMtL/kquN3yf4oBxLtiBoKDhhxb\n\tApfnbW+lAeea3a8zb1DzfiaGPhTA20LaPVz2GbV4="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"uwi0HuD7\"; dkim-atps=neutral",
        "To": "libcamera-devel@lists.libcamera.org,\n\tDavid Plowman <david.plowman@raspberrypi.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tJacopo Mondi <jacopo@jmondi.org>",
        "Date": "Wed, 29 Jun 2022 10:04:16 +0300",
        "Message-Id": "<20220629070416.17550-15-tomi.valkeinen@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20220629070416.17550-1-tomi.valkeinen@ideasonboard.com>",
        "References": "<20220629070416.17550-1-tomi.valkeinen@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 14/14] py: Add hotplug-monitor.py",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "<libcamera-devel.lists.libcamera.org>",
        "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>",
        "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>",
        "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>",
        "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>",
        "From": "Tomi Valkeinen via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Add a simple example script which waits for camera hotplug events.\n\nSigned-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n---\n src/py/examples/hotplug-monitor.py | 38 ++++++++++++++++++++++++++++++\n 1 file changed, 38 insertions(+)\n create mode 100644 src/py/examples/hotplug-monitor.py",
    "diff": "diff --git a/src/py/examples/hotplug-monitor.py b/src/py/examples/hotplug-monitor.py\nnew file mode 100644\nindex 00000000..787aa45a\n--- /dev/null\n+++ b/src/py/examples/hotplug-monitor.py\n@@ -0,0 +1,38 @@\n+#!/usr/bin/env python3\n+\n+# SPDX-License-Identifier: GPL-2.0-or-later\n+# Copyright (C) 2022, Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n+\n+import libcamera as libcam\n+import selectors\n+import sys\n+\n+\n+def main():\n+    cm = libcam.CameraManager.singleton()\n+\n+    cm.camera_added = lambda c: print('Camera added:', c)\n+    cm.camera_removed = lambda c: print('Camera removed:', c)\n+\n+    sel = selectors.DefaultSelector()\n+    sel.register(cm.event_fd, selectors.EVENT_READ)\n+\n+    print('Waiting for camera hotplug events... (CTRL-C to exit)')\n+\n+    while True:\n+        try:\n+            events = sel.select()\n+            if not events:\n+                continue\n+        except KeyboardInterrupt:\n+            break\n+\n+        cm.dispatch_events()\n+\n+    cm.discard_events()\n+\n+    return 0\n+\n+\n+if __name__ == '__main__':\n+    sys.exit(main())\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "14/14"
    ]
}