Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/136042/?format=api
http://patches.dpdk.org/api/patches/136042/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20240122182611.1904974-3-luca.vizzarro@arm.com/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20240122182611.1904974-3-luca.vizzarro@arm.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20240122182611.1904974-3-luca.vizzarro@arm.com", "date": "2024-01-22T18:26:09", "name": "[2/4] dts: customise argparse error message", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "3c137929f19255217443ed6e6ba288da545f799d", "submitter": { "id": 3197, "url": "http://patches.dpdk.org/api/people/3197/?format=api", "name": "Luca Vizzarro", "email": "luca.vizzarro@arm.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20240122182611.1904974-3-luca.vizzarro@arm.com/mbox/", "series": [ { "id": 30879, "url": "http://patches.dpdk.org/api/series/30879/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=30879", "date": "2024-01-22T18:26:07", "name": "dts: error and usage improvements", "version": 1, "mbox": "http://patches.dpdk.org/series/30879/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/136042/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/136042/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 3C9784399C;\n\tMon, 22 Jan 2024 19:26:47 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 48C6A40ED2;\n\tMon, 22 Jan 2024 19:26:37 +0100 (CET)", "from foss.arm.com (foss.arm.com [217.140.110.172])\n by mails.dpdk.org (Postfix) with ESMTP id 9109140A6C\n for <dev@dpdk.org>; Mon, 22 Jan 2024 19:26:35 +0100 (CET)", "from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])\n by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3B7FA106F;\n Mon, 22 Jan 2024 10:27:21 -0800 (PST)", "from localhost.localdomain (unknown [10.57.90.210])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 742E43F762;\n Mon, 22 Jan 2024 10:26:34 -0800 (PST)" ], "From": "Luca Vizzarro <luca.vizzarro@arm.com>", "To": "dev@dpdk.org", "Cc": "Luca Vizzarro <luca.vizzarro@arm.com>,\n =?utf-8?q?Juraj_Linke=C5=A1?= <juraj.linkes@pantheon.tech>,\n Paul Szczepanek <paul.szczepanek@arm.com>", "Subject": "[PATCH 2/4] dts: customise argparse error message", "Date": "Mon, 22 Jan 2024 18:26:09 +0000", "Message-Id": "<20240122182611.1904974-3-luca.vizzarro@arm.com>", "X-Mailer": "git-send-email 2.34.1", "In-Reply-To": "<20240122182611.1904974-1-luca.vizzarro@arm.com>", "References": "<20240122182611.1904974-1-luca.vizzarro@arm.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "This commit customises the arguments parsing class' error message,\nmaking it so the confusing usage is not displayed in these occurrences,\nbut the user is redirected to use the help argument instead.\n\nReviewed-by: Paul Szczepanek <paul.szczepanek@arm.com>\nSigned-off-by: Luca Vizzarro <luca.vizzarro@arm.com>\n---\n dts/framework/settings.py | 13 +++++++++++--\n 1 file changed, 11 insertions(+), 2 deletions(-)", "diff": "diff --git a/dts/framework/settings.py b/dts/framework/settings.py\nindex 2d0365e763..acfe5cad44 100644\n--- a/dts/framework/settings.py\n+++ b/dts/framework/settings.py\n@@ -170,6 +170,15 @@ def _parse_revision_id(rev_id: str) -> str:\n )\n \n \n+class ArgumentParser(argparse.ArgumentParser):\n+ \"\"\"ArgumentParser with a custom error message.\"\"\"\n+ def error(self, message):\n+ print(f\"{self.prog}: error: {message}\\n\", file=sys.stderr)\n+ self.exit(2,\n+ \"For help and usage, \"\n+ \"run the command with the --help flag.\\n\")\n+\n+\n @dataclass(slots=True)\n class Settings:\n \"\"\"Default framework-wide user settings.\n@@ -200,8 +209,8 @@ class Settings:\n SETTINGS: Settings = Settings()\n \n \n-def _get_parser() -> argparse.ArgumentParser:\n- parser = argparse.ArgumentParser(\n+def _get_parser() -> ArgumentParser:\n+ parser = ArgumentParser(\n description=\"Run DPDK test suites. All options may be specified with the environment \"\n \"variables provided in brackets. Command line arguments have higher priority.\",\n formatter_class=argparse.ArgumentDefaultsHelpFormatter,\n", "prefixes": [ "2/4" ] }{ "id": 136042, "url": "