Show a patch.

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

{
    "id": 12370,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/12370/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/12370/",
    "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": "<20210524084029.1179881-2-paul.elder@ideasonboard.com>",
    "date": "2021-05-24T08:40:24",
    "name": "[libcamera-devel,RFC,1/6] utils: ipc: Add script to extract doxygen docs from mojom files",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "25ee0da61cf3c5146fc9980ade03362d7c4ca0b5",
    "submitter": {
        "id": 17,
        "url": "https://patchwork.libcamera.org/api/1.1/people/17/?format=api",
        "name": "Paul Elder",
        "email": "paul.elder@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/12370/mbox/",
    "series": [
        {
            "id": 2051,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2051/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2051",
            "date": "2021-05-24T08:40:23",
            "name": "Generate docs from mojom files",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/2051/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/12370/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/12370/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 5CAB8C3200\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 24 May 2021 08:40:42 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 25AB06891F;\n\tMon, 24 May 2021 10:40:42 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 63896602B1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 24 May 2021 10:40:41 +0200 (CEST)",
            "from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id CCA741315;\n\tMon, 24 May 2021 10:40:39 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"ICoEsmg7\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1621845641;\n\tbh=2qjW1axMxYthC1x2cRLVGL+hAaEeSS8pMw+R8ODuz+8=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=ICoEsmg7zECLLhpbqueufmaJ/NyqSGqF3CdfrJu6zGy9ZQoB+JRndM8xhhbLO5VX9\n\tj7BiadXDnbFUCJEJdi1Ho5ELXhd8tDF0cTmRr2PmycTuRr7iJiUqqNUkeTVJKW9ycz\n\tR4s8fDD62dY+X0ePHW0rgJ3q6sF6SIcK1Bi5sck8=",
        "From": "Paul Elder <paul.elder@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 24 May 2021 17:40:24 +0900",
        "Message-Id": "<20210524084029.1179881-2-paul.elder@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20210524084029.1179881-1-paul.elder@ideasonboard.com>",
        "References": "<20210524084029.1179881-1-paul.elder@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [RFC PATCH 1/6] utils: ipc: Add script to extract\n\tdoxygen docs from mojom files",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Add a script to extract doxygen documentation comments from mojom files.\nIt matches based on ^\\/\\*\\*$ for start of block and ^ \\*\\/$ for end of\nblock, and simply copies the comments to the output file along with a\nheader and the libcamera namespace.\n\nAlso add it to the meson file so it is usable by other meson files.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n---\n utils/ipc/extract-docs.py | 77 +++++++++++++++++++++++++++++++++++++++\n utils/ipc/meson.build     |  2 +\n 2 files changed, 79 insertions(+)\n create mode 100755 utils/ipc/extract-docs.py",
    "diff": "diff --git a/utils/ipc/extract-docs.py b/utils/ipc/extract-docs.py\nnew file mode 100755\nindex 00000000..b6667057\n--- /dev/null\n+++ b/utils/ipc/extract-docs.py\n@@ -0,0 +1,77 @@\n+#!/usr/bin/env python3\n+# SPDX-License-Identifier: GPL-2.0-or-later\n+# Copyright (C) 2021, Google Inc.\n+#\n+# Author: Paul Elder <paul.elder@ideasonboard.com>\n+#\n+# extract-docs.py - Extract doxygen documentation from mojom files\n+\n+import argparse\n+import re\n+import sys\n+\n+regex_block_start = re.compile('^\\/\\*\\*$')\n+regex_block_end = re.compile('^ \\*\\/$')\n+\n+\n+def main(argv):\n+\n+    # Parse command line arguments\n+    parser = argparse.ArgumentParser()\n+    parser.add_argument('-o', dest='output', metavar='file', type=str,\n+                        help='Output file name. Defaults to standard output if not specified.')\n+    parser.add_argument('input', type=str,\n+                        help='Input file name.')\n+    args = parser.parse_args(argv[1:])\n+\n+    lines = open(args.input, 'r').readlines()\n+    pipeline = args.input.split('/')[-1].replace('.mojom', '')\n+    data = f'''\\\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2021, Google Inc.\n+ *\n+ * {pipeline}_ipa_interface.cpp - Docs file for generated {pipeline}.mojom\n+ *\n+ * This file is auto-generated. Do not edit.\n+ */\n+\n+namespace libcamera {{\n+\n+'''\n+\n+    in_block = False\n+    comment = ''\n+    for lineno, line in enumerate(lines, start=1):\n+        if regex_block_start.match(line):\n+            if in_block:\n+                raise SyntaxError('Expected end of comment',\n+                                  (args.input, lineno, 1, line))\n+            in_block = True\n+            comment = line\n+            continue\n+\n+        if regex_block_end.match(line):\n+            if in_block:\n+                comment += line\n+                data += comment + '\\n'\n+            in_block = False\n+            continue\n+\n+        if in_block:\n+            comment += line\n+\n+    data += '} /* namespace libcamera */\\n'\n+\n+    if args.output:\n+        output = open(args.output, 'wb')\n+        output.write(data.encode('utf-8'))\n+        output.close()\n+    else:\n+        sys.stdout.write(data)\n+\n+    return 0\n+\n+\n+if __name__ == '__main__':\n+    sys.exit(main(sys.argv))\ndiff --git a/utils/ipc/meson.build b/utils/ipc/meson.build\nindex 4a41b9c1..973a5417 100644\n--- a/utils/ipc/meson.build\n+++ b/utils/ipc/meson.build\n@@ -8,6 +8,8 @@ mojom_parser = find_program('./parser.py')\n \n mojom_generator = find_program('./generate.py')\n \n+mojom_docs_extractor = find_program('./extract-docs.py')\n+\n mojom_templates = custom_target('mojom_templates',\n                                 input : mojom_template_files,\n                                 output : 'libcamera_templates.zip',\n",
    "prefixes": [
        "libcamera-devel",
        "RFC",
        "1/6"
    ]
}