Show a patch.

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

{
    "id": 10927,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/10927/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/10927/",
    "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": "<20210121124417.13629-1-laurent.pinchart@ideasonboard.com>",
    "date": "2021-01-21T12:44:17",
    "name": "[libcamera-devel] utils: checkstyle.py: Fix \"protected\" members in Commit class",
    "commit_ref": "afbf0ec626db43b0117d28ef4f9b825a7d19929a",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "59589439d35b547ea38976be3932e7c775b22c75",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/10927/mbox/",
    "series": [
        {
            "id": 1592,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1592/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1592",
            "date": "2021-01-21T12:44:17",
            "name": "[libcamera-devel] utils: checkstyle.py: Fix \"protected\" members in Commit class",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1592/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/10927/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/10927/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 402E4BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 21 Jan 2021 12:44:42 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B6D33681EE;\n\tThu, 21 Jan 2021 13:44:41 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4D826681E6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 21 Jan 2021 13:44:40 +0100 (CET)",
            "from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id AD47F50E;\n\tThu, 21 Jan 2021 13:44:39 +0100 (CET)"
        ],
        "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=\"E74Mz32C\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1611233080;\n\tbh=wHaolLLWY7852RSkVEoNwpeo/68pZIhmJylHFcWac8Y=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=E74Mz32CiT91u34HtvRRgm/p9J4jNM+XDBYAK31hngwnQkQtRYboVX57DdPEUKgkn\n\tLjWe8xkiqOqLvLWY4bbi9ssZweT6HnComCWEdrvjshot//jQo76q/pwXqZnySRBMRP\n\tI621NJbgPbd/qkjGH8mUQESsBpl1YAuSVUhijkO0=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Thu, 21 Jan 2021 14:44:17 +0200",
        "Message-Id": "<20210121124417.13629-1-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.28.0",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH] utils: checkstyle.py: Fix \"protected\"\n\tmembers in Commit class",
        "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>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "The Commit class and subclasses were reworked in commit 4f5d17f3a4f5\n(\"utils: checkstyle.py: Make title and files properties of commit\nclass\") with the introduction of members of the base class that were\nmeant to be protected (not used externally, but accessible by\nsubclasses). They have been named with a '__' prefix for this purpose,\nwhich was a bad choice as Python effectively replaces a leading '__'\nwith a literal '__classname__' prefix to make them private\n(https://docs.python.org/3/tutorial/classes.html#private-variables). The\nmembers accessed in the derived classes are thus different from the ones\nin the base class.\n\nFix this by replacing the double underscore prefix with a single\nunderscore, which is a \"weak internal use indicator\" (as specified in\nhttps://www.python.org/dev/peps/pep-0008/), closer to the protected\naccess specifier of C++.\n\nReported-by: Umang Jain <email@uajain.com>\nReported-by: Naushir Patuck <naush@raspberrypi.com>\nFixes: 4f5d17f3a4f5 (\"utils: checkstyle.py: Make title and files properties of commit class\")\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n utils/checkstyle.py | 24 ++++++++++++------------\n 1 file changed, 12 insertions(+), 12 deletions(-)",
    "diff": "diff --git a/utils/checkstyle.py b/utils/checkstyle.py\nindex 0e9659e98518..fb9366f8095d 100755\n--- a/utils/checkstyle.py\n+++ b/utils/checkstyle.py\n@@ -203,23 +203,23 @@ class CommitFile:\n class Commit:\n     def __init__(self, commit):\n         self.commit = commit\n-        self.__parse()\n+        self._parse()\n \n-    def __parse(self):\n+    def _parse(self):\n         # Get the commit title and list of files.\n         ret = subprocess.run(['git', 'show', '--pretty=oneline', '--name-status',\n                               self.commit],\n                              stdout=subprocess.PIPE).stdout.decode('utf-8')\n         files = ret.splitlines()\n-        self.__files = [CommitFile(f) for f in files[1:]]\n-        self.__title = files[0]\n+        self._files = [CommitFile(f) for f in files[1:]]\n+        self._title = files[0]\n \n     def files(self, filter='AM'):\n-        return [f.filename for f in self.__files if f.status in filter]\n+        return [f.filename for f in self._files if f.status in filter]\n \n     @property\n     def title(self):\n-        return self.__title\n+        return self._title\n \n     def get_diff(self, top_level, filename):\n         diff = subprocess.run(['git', 'diff', '%s~..%s' % (self.commit, self.commit),\n@@ -236,11 +236,11 @@ class StagedChanges(Commit):\n     def __init__(self):\n         Commit.__init__(self, '')\n \n-    def __parse(self):\n+    def _parse(self):\n         ret = subprocess.run(['git', 'diff', '--staged', '--name-status'],\n                              stdout=subprocess.PIPE).stdout.decode('utf-8')\n-        self.__title = \"Staged changes\"\n-        self.__files = [CommitFile(f) for f in ret.splitlines()]\n+        self._title = \"Staged changes\"\n+        self._files = [CommitFile(f) for f in ret.splitlines()]\n \n     def get_diff(self, top_level, filename):\n         diff = subprocess.run(['git', 'diff', '--staged', '--',\n@@ -253,15 +253,15 @@ class Amendment(StagedChanges):\n     def __init__(self):\n         StagedChanges.__init__(self)\n \n-    def __parse(self):\n+    def _parse(self):\n         # Create a title using HEAD commit\n         ret = subprocess.run(['git', 'show', '--pretty=oneline', '--no-patch'],\n                              stdout=subprocess.PIPE).stdout.decode('utf-8')\n-        self.__title = 'Amendment of ' + ret.strip()\n+        self._title = 'Amendment of ' + ret.strip()\n         # Extract the list of modified files\n         ret = subprocess.run(['git', 'diff', '--staged', '--name-status', 'HEAD~'],\n                              stdout=subprocess.PIPE).stdout.decode('utf-8')\n-        self.__files = [CommitFile(f) for f in ret.splitlines()]\n+        self._files = [CommitFile(f) for f in ret.splitlines()]\n \n     def get_diff(self, top_level, filename):\n         diff = subprocess.run(['git', 'diff', '--staged', 'HEAD~', '--',\n",
    "prefixes": [
        "libcamera-devel"
    ]
}