Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2218317/?format=api
{ "id": 2218317, "url": "http://patchwork.ozlabs.org/api/patches/2218317/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260401001459.19159-7-vfazio@gmail.com/", "project": { "id": 42, "url": "http://patchwork.ozlabs.org/api/projects/42/?format=api", "name": "Linux GPIO development", "link_name": "linux-gpio", "list_id": "linux-gpio.vger.kernel.org", "list_email": "linux-gpio@vger.kernel.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260401001459.19159-7-vfazio@gmail.com>", "list_archive_url": null, "date": "2026-04-01T00:14:56", "name": "[libgpiod,7/9] bindings: python: examples: apply linter recommendations", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "26763e61666a7bffc814205c7639878fe757823b", "submitter": { "id": 78694, "url": "http://patchwork.ozlabs.org/api/people/78694/?format=api", "name": "Vincent Fazio", "email": "vfazio@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260401001459.19159-7-vfazio@gmail.com/mbox/", "series": [ { "id": 498263, "url": "http://patchwork.ozlabs.org/api/series/498263/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/list/?series=498263", "date": "2026-04-01T00:14:50", "name": "[libgpiod,1/9] bindings: python: build_tests: do not fallback to distutils", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/498263/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2218317/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2218317/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-gpio+bounces-34516-incoming=patchwork.ozlabs.org@vger.kernel.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linux-gpio@vger.kernel.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=Coh/XqnE;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-gpio+bounces-34516-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=\"Coh/XqnE\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.210.53", "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=gmail.com" ], "Received": [ "from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fllyf59s9z1yGH\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 01 Apr 2026 11:21:14 +1100 (AEDT)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id AD2B330945A8\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 1 Apr 2026 00:18:12 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 477F119067C;\n\tWed, 1 Apr 2026 00:18:12 +0000 (UTC)", "from mail-ot1-f53.google.com (mail-ot1-f53.google.com\n [209.85.210.53])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 7347B189F20\n\tfor <linux-gpio@vger.kernel.org>; Wed, 1 Apr 2026 00:18:10 +0000 (UTC)", "by mail-ot1-f53.google.com with SMTP id\n 46e09a7af769-7d7447778b9so3397455a34.2\n for <linux-gpio@vger.kernel.org>;\n Tue, 31 Mar 2026 17:18:10 -0700 (PDT)", "from Zephyrus.localdomain ([131.93.209.211])\n by smtp.gmail.com with ESMTPSA id\n 46e09a7af769-7da0a7ea668sm9173679a34.19.2026.03.31.17.18.08\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 31 Mar 2026 17:18:08 -0700 (PDT)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775002692; cv=none;\n b=LeWTi+qCQ4xSkfBBe/ZjIuiw+1zTyp5RUC7MVSjmGzKFnGTacLU8iJpI+k0T7MtcUj9LlQ0XoD2JtERtCO4nweF0MPp8FxhuTcb46H/iRD9yNRxUW7XSvdqrPF3qkkFJphftgY3Fg6MWD8IV+pT0FdSRVWG1w74xIGH9cCJ4F7g=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775002692; c=relaxed/simple;\n\tbh=cgWlJ6wiZtb67omI7p9trI4XljCKZVMExkArs+uH8zA=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=hj3MjcjTZCiFUarZK0zHI5wl8H+epofWR2Edf2AsCu8lzdCnAwhY8a/DYN2P0FoiNIja10UmRWF0l+MTz+TeY9ajTQAriGNdchsFZQtac3EUTzgVMcwhvpTHxFog7Fb4xwHPMPHm4+T70IijufNmBEt8us1gRdmq1XZFh1l6MqU=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com;\n spf=pass smtp.mailfrom=gmail.com;\n dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=Coh/XqnE; arc=none smtp.client-ip=209.85.210.53", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1775002689; x=1775607489;\n darn=vger.kernel.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=KmuuLb2CNw0YIHZdV74YrYZjKoouynJKnBrznXbSkn4=;\n b=Coh/XqnEbp5+G0H3RnjYkrE36lakB75o/ZNvNhUYVXI2O4Ddu3J4jSx8sITYjzKLAR\n pdtlmqrYcyPl+UARcA7li+g1qivVIJGanIbYtMI5XKFIIAqFUArpHkx4SdKXpj3Ws+xY\n rKJ37i2KDVAZDZ5SStQnfCOD+MnN/v+YhS5xVU6E+QrWVtZdpJYdLDqDvyNF2qlNqVe3\n dEPEvI99xQxYJ5ro05oXNuk/gEMxaoaUHwEF2Xiy8kbZ3s0Tzx9JES8CQFiCGBZYlbHm\n 1Edx4wYF18dPz/tf75SaQ3OsV8HcgCIToQhF7sQDpUlTaDxH8hbSm0Lmsm29t49gJwtj\n yV8Q==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775002689; x=1775607489;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=KmuuLb2CNw0YIHZdV74YrYZjKoouynJKnBrznXbSkn4=;\n b=aD9jwsHPUu4fOCOlDevob2z2q4pDxMRNDm9AxSvlmlCohJC+se2F+RGbwsL0IXiSgc\n yM9J1oiXj11+1QFMoifg659kQ7ofumLYYmK+W3mRqMkf5nTlLhWWzHbaXB/dymfcuR9O\n Kah8CPkEndepxMxfj0FGok6TYCImg+5zCveFbpsc5pW86Zf6oAlYlgvgH43EeaGa0k65\n OZpeMTs28rRnQ7JJiPSo8CkBUdj2XA9RIKceGOL2PaSdIS3b3Zw+mV/MiG90zk8bCiYG\n xq6HSr6FD3sVFBkcYmQKwRtwmKAXVzvwbsSFVUhejrgt2dNMRbzpIs2Q+/9TeAfu7BOj\n n3AA==", "X-Gm-Message-State": "AOJu0Yxac8OPHGcN+qxU5AzXYsaejxp5g0b3fQIumpehm+j2XTB2LWVU\n\tMggq5NQgT2ydVsaZt9QPKU9KxGq/k75MD6vBYZOFc1m9/bbqG54hodNg+eDN3g==", "X-Gm-Gg": "ATEYQzwKTH9cM3PHFtDH394xBfpWA4p5hfII/gYOaULQt2Uz+Z00lKchv2qyD3z0FZG\n\t0uzxgyZc2VGvVTr7kUC61Tqlzoj7+aDQ6TC1ltHlWpjIoFfCxSamE5P8RxLJpVouShIs8RlN6kO\n\tgEZxqWalJxe3kyWWFu98Ae5L/rXC3yTeEeIAKogCoplAadDZNhuJua9aHC1gQ6MCaoZ1LVWrzUQ\n\twmg1oARdLxpX4vma4FeVRJ/fRRhj0MJQM4+Cq4XPhK7Wu6y7CqV0uGNXivaEEmYAzzkYPJLbsxp\n\tJ2v0A1WPg/xN1xozvcowV7hQtb8HrIV8FKm59Abc8HL37dRI1UMdcsqIAqX1Muf/iyu6TveHgkT\n\t6ft4JGkCBr8n+jtQYUzTGUDP388UeHlfS3japPnmjBypL/2cHayXA1+PSShf17tgliBkv8tk3cN\n\tNpW1+hideqdZtYDV599HmDepbfXNhq20Xnl/oYPF5h3YZNSILIAepI4e+4aFKIa7pfAqnUgg2j", "X-Received": "by 2002:a05:6830:6c13:b0:7d7:d1f0:300e with SMTP id\n 46e09a7af769-7db99412403mr1140082a34.24.1775002689193;\n Tue, 31 Mar 2026 17:18:09 -0700 (PDT)", "From": "Vincent Fazio <vfazio@gmail.com>", "To": "linux-gpio@vger.kernel.org", "Cc": "Vincent Fazio <vfazio@gmail.com>", "Subject": "[libgpiod][PATCH 7/9] bindings: python: examples: apply linter\n recommendations", "Date": "Tue, 31 Mar 2026 19:14:56 -0500", "Message-ID": "<20260401001459.19159-7-vfazio@gmail.com>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20260401001459.19159-1-vfazio@gmail.com>", "References": "<20260401001459.19159-1-vfazio@gmail.com>", "Precedence": "bulk", "X-Mailing-List": "linux-gpio@vger.kernel.org", "List-Id": "<linux-gpio.vger.kernel.org>", "List-Subscribe": "<mailto:linux-gpio+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:linux-gpio+unsubscribe@vger.kernel.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit" }, "content": "* Sort imports\n* Use f-strings where possible\n* Remove usage of `tuple` for config key values\n\nSigned-off-by: Vincent Fazio <vfazio@gmail.com>\n---\n bindings/python/examples/async_watch_line_value.py | 9 ++++-----\n bindings/python/examples/find_line_by_name.py | 7 ++++---\n bindings/python/examples/get_chip_info.py | 2 +-\n bindings/python/examples/get_line_info.py | 12 +++++-------\n bindings/python/examples/get_line_value.py | 3 +--\n bindings/python/examples/get_multiple_line_values.py | 7 +++----\n .../python/examples/reconfigure_input_to_output.py | 5 ++---\n bindings/python/examples/toggle_line_value.py | 4 ++--\n .../python/examples/toggle_multiple_line_values.py | 12 ++++--------\n bindings/python/examples/watch_line_rising.py | 7 +++----\n bindings/python/examples/watch_line_value.py | 10 +++++-----\n .../python/examples/watch_multiple_line_values.py | 12 +++++-------\n 12 files changed, 39 insertions(+), 51 deletions(-)", "diff": "diff --git a/bindings/python/examples/async_watch_line_value.py b/bindings/python/examples/async_watch_line_value.py\nindex 640a4c5..68c8b28 100755\n--- a/bindings/python/examples/async_watch_line_value.py\n+++ b/bindings/python/examples/async_watch_line_value.py\n@@ -4,11 +4,10 @@\n \n \"\"\"Minimal example of asynchronously watching for edges on a single line.\"\"\"\n \n-import gpiod\n import select\n-\n from datetime import timedelta\n \n+import gpiod\n from gpiod.edge_event import EdgeEvent\n from gpiod.line import Bias, Edge\n \n@@ -48,9 +47,9 @@ def async_watch_line_value(chip_path: str, line_offset: int, done_fd: int) -> No\n # handle any edge events\n for event in request.read_edge_events():\n print(\n- \"offset: {} type: {:<7} event #{}\".format(\n- event.line_offset, edge_type_str(event), event.line_seqno\n- )\n+ f\"offset: {event.line_offset}\"\n+ f\" type: {edge_type_str(event):<7}\"\n+ f\" event #{event.line_seqno}\"\n )\n \n \ndiff --git a/bindings/python/examples/find_line_by_name.py b/bindings/python/examples/find_line_by_name.py\nindex 4ed3848..9523c1c 100755\n--- a/bindings/python/examples/find_line_by_name.py\n+++ b/bindings/python/examples/find_line_by_name.py\n@@ -4,10 +4,11 @@\n \n \"\"\"Minimal example of finding a line with the given name.\"\"\"\n \n-import gpiod\n import os\n from collections.abc import Generator\n \n+import gpiod\n+\n \n def generate_gpio_chips() -> Generator[str]:\n for entry in os.scandir(\"/dev/\"):\n@@ -22,13 +23,13 @@ def find_line_by_name(line_name: str) -> None:\n with gpiod.Chip(path) as chip:\n try:\n offset = chip.line_offset_from_id(line_name)\n- print(\"{}: {} {}\".format(line_name, chip.get_info().name, offset))\n+ print(f\"{line_name}: {chip.get_info().name} {offset}\")\n return\n except OSError:\n # An OSError is raised if the name is not found.\n continue\n \n- print(\"line '{}' not found\".format(line_name))\n+ print(f\"line '{line_name}' not found\")\n \n \n if __name__ == \"__main__\":\ndiff --git a/bindings/python/examples/get_chip_info.py b/bindings/python/examples/get_chip_info.py\nindex 037e424..addad5c 100755\n--- a/bindings/python/examples/get_chip_info.py\n+++ b/bindings/python/examples/get_chip_info.py\n@@ -10,7 +10,7 @@ import gpiod\n def get_chip_info(chip_path: str) -> None:\n with gpiod.Chip(chip_path) as chip:\n info = chip.get_info()\n- print(\"{} [{}] ({} lines)\".format(info.name, info.label, info.num_lines))\n+ print(f\"{info.name} [{info.label}] ({info.num_lines} lines)\")\n \n \n if __name__ == \"__main__\":\ndiff --git a/bindings/python/examples/get_line_info.py b/bindings/python/examples/get_line_info.py\nindex 8e7283e..4d9ba76 100755\n--- a/bindings/python/examples/get_line_info.py\n+++ b/bindings/python/examples/get_line_info.py\n@@ -12,13 +12,11 @@ def get_line_info(chip_path: str, line_offset: int) -> None:\n info = chip.get_line_info(line_offset)\n is_input = info.direction == gpiod.line.Direction.INPUT\n print(\n- \"line {:>3}: {:>12} {:>12} {:>8} {:>10}\".format(\n- info.offset,\n- info.name or \"unnamed\",\n- info.consumer or \"unused\",\n- \"input\" if is_input else \"output\",\n- \"active-low\" if info.active_low else \"active-high\",\n- )\n+ f\"line {info.offset:>3}:\"\n+ f\" {info.name or 'unnamed':>12}\"\n+ f\" {info.consumer or 'unused':>12}\"\n+ f\" {'input' if is_input else 'output':>8}\"\n+ f\" {'active-low' if info.active_low else 'active-high':>10}\"\n )\n \n \ndiff --git a/bindings/python/examples/get_line_value.py b/bindings/python/examples/get_line_value.py\nindex 5ca952b..3984802 100755\n--- a/bindings/python/examples/get_line_value.py\n+++ b/bindings/python/examples/get_line_value.py\n@@ -5,7 +5,6 @@\n \"\"\"Minimal example of reading a single line.\"\"\"\n \n import gpiod\n-\n from gpiod.line import Direction\n \n \n@@ -16,7 +15,7 @@ def get_line_value(chip_path: str, line_offset: int) -> None:\n config={line_offset: gpiod.LineSettings(direction=Direction.INPUT)},\n ) as request:\n value = request.get_value(line_offset)\n- print(\"{}={}\".format(line_offset, value))\n+ print(f\"{line_offset}={value}\")\n \n \n if __name__ == \"__main__\":\ndiff --git a/bindings/python/examples/get_multiple_line_values.py b/bindings/python/examples/get_multiple_line_values.py\nindex f70369f..66148a3 100755\n--- a/bindings/python/examples/get_multiple_line_values.py\n+++ b/bindings/python/examples/get_multiple_line_values.py\n@@ -7,7 +7,6 @@\n from collections.abc import Iterable\n \n import gpiod\n-\n from gpiod.line import Direction\n \n \n@@ -15,12 +14,12 @@ def get_multiple_line_values(chip_path: str, line_offsets: Iterable[int]) -> Non\n with gpiod.request_lines(\n chip_path,\n consumer=\"get-multiple-line-values\",\n- config={tuple(line_offsets): gpiod.LineSettings(direction=Direction.INPUT)},\n+ config={line_offsets: gpiod.LineSettings(direction=Direction.INPUT)},\n ) as request:\n vals = request.get_values()\n \n- for offset, val in zip(line_offsets, vals):\n- print(\"{}={} \".format(offset, val), end=\"\")\n+ for offset, val in zip(line_offsets, vals, strict=True):\n+ print(f\"{offset}={val} \", end=\"\")\n print()\n \n \ndiff --git a/bindings/python/examples/reconfigure_input_to_output.py b/bindings/python/examples/reconfigure_input_to_output.py\nindex feb5f0b..a2224e8 100755\n--- a/bindings/python/examples/reconfigure_input_to_output.py\n+++ b/bindings/python/examples/reconfigure_input_to_output.py\n@@ -5,7 +5,6 @@\n \"\"\"Example of a bi-directional line requested as input and then switched to output.\"\"\"\n \n import gpiod\n-\n from gpiod.line import Direction, Value\n \n \n@@ -18,7 +17,7 @@ def reconfigure_input_to_output(chip_path: str, line_offset: int) -> None:\n ) as request:\n # read the current line value\n value = request.get_value(line_offset)\n- print(\"{}={} (input)\".format(line_offset, value))\n+ print(f\"{line_offset}={value} (input)\")\n # switch the line to an output and drive it low\n request.reconfigure_lines(\n config={\n@@ -29,7 +28,7 @@ def reconfigure_input_to_output(chip_path: str, line_offset: int) -> None:\n )\n # report the current driven value\n value = request.get_value(line_offset)\n- print(\"{}={} (output)\".format(line_offset, value))\n+ print(f\"{line_offset}={value} (output)\")\n \n \n if __name__ == \"__main__\":\ndiff --git a/bindings/python/examples/toggle_line_value.py b/bindings/python/examples/toggle_line_value.py\nindex bc948de..bfd1585 100755\n--- a/bindings/python/examples/toggle_line_value.py\n+++ b/bindings/python/examples/toggle_line_value.py\n@@ -4,9 +4,9 @@\n \n \"\"\"Minimal example of toggling a single line.\"\"\"\n \n-import gpiod\n import time\n \n+import gpiod\n from gpiod.line import Direction, Value\n \n \n@@ -30,7 +30,7 @@ def toggle_line_value(chip_path: str, line_offset: int) -> None:\n },\n ) as request:\n while True:\n- print(\"{}={}\".format(line_offset, value_str[value]))\n+ print(f\"{line_offset}={value_str[value]}\")\n time.sleep(1)\n value = toggle_value(value)\n request.set_value(line_offset, value)\ndiff --git a/bindings/python/examples/toggle_multiple_line_values.py b/bindings/python/examples/toggle_multiple_line_values.py\nindex 74ff587..8c973f8 100755\n--- a/bindings/python/examples/toggle_multiple_line_values.py\n+++ b/bindings/python/examples/toggle_multiple_line_values.py\n@@ -4,9 +4,9 @@\n \n \"\"\"Minimal example of toggling multiple lines.\"\"\"\n \n-import gpiod\n import time\n \n+import gpiod\n from gpiod.line import Direction, Value\n \n \n@@ -24,18 +24,14 @@ def toggle_multiple_line_values(\n request = gpiod.request_lines(\n chip_path,\n consumer=\"toggle-multiple-line-values\",\n- config={\n- tuple(line_values.keys()): gpiod.LineSettings(direction=Direction.OUTPUT)\n- },\n+ config={line_values.keys(): gpiod.LineSettings(direction=Direction.OUTPUT)},\n output_values=line_values,\n )\n \n while True:\n- print(\n- \" \".join(\"{}={}\".format(l, value_str[v]) for (l, v) in line_values.items())\n- )\n+ print(\" \".join(f\"{l}={value_str[v]}\" for (l, v) in line_values.items())) # noqa: E741\n time.sleep(1)\n- for l, v in line_values.items():\n+ for l, v in line_values.items(): # noqa: E741\n line_values[l] = toggle_value(v)\n request.set_values(line_values)\n \ndiff --git a/bindings/python/examples/watch_line_rising.py b/bindings/python/examples/watch_line_rising.py\nindex 2f7f25f..59977c4 100755\n--- a/bindings/python/examples/watch_line_rising.py\n+++ b/bindings/python/examples/watch_line_rising.py\n@@ -5,7 +5,6 @@\n \"\"\"Minimal example of watching for rising edges on a single line.\"\"\"\n \n import gpiod\n-\n from gpiod.line import Edge\n \n \n@@ -19,9 +18,9 @@ def watch_line_rising(chip_path: str, line_offset: int) -> None:\n # Blocks until at least one event is available\n for event in request.read_edge_events():\n print(\n- \"line: {} type: Rising event #{}\".format(\n- event.line_offset, event.line_seqno\n- )\n+ f\"line: {event.line_offset}\"\n+ \" type: Rising\"\n+ f\" event #{event.line_seqno}\"\n )\n \n \ndiff --git a/bindings/python/examples/watch_line_value.py b/bindings/python/examples/watch_line_value.py\nindex 9b84d29..3140ea2 100755\n--- a/bindings/python/examples/watch_line_value.py\n+++ b/bindings/python/examples/watch_line_value.py\n@@ -4,9 +4,9 @@\n \n \"\"\"Minimal example of watching for edges on a single line.\"\"\"\n \n-import gpiod\n-\n from datetime import timedelta\n+\n+import gpiod\n from gpiod.edge_event import EdgeEvent\n from gpiod.line import Bias, Edge\n \n@@ -37,9 +37,9 @@ def watch_line_value(chip_path: str, line_offset: int) -> None:\n # Blocks until at least one event is available\n for event in request.read_edge_events():\n print(\n- \"line: {} type: {:<7} event #{}\".format(\n- event.line_offset, edge_type_str(event), event.line_seqno\n- )\n+ f\"line: {event.line_offset}\"\n+ f\" type: {edge_type_str(event):<7}\"\n+ f\" event #{event.line_seqno}\"\n )\n \n \ndiff --git a/bindings/python/examples/watch_multiple_line_values.py b/bindings/python/examples/watch_multiple_line_values.py\nindex d0ee35a..2c308bb 100755\n--- a/bindings/python/examples/watch_multiple_line_values.py\n+++ b/bindings/python/examples/watch_multiple_line_values.py\n@@ -23,17 +23,15 @@ def watch_multiple_line_values(chip_path: str, line_offsets: Iterable[int]) -> N\n with gpiod.request_lines(\n chip_path,\n consumer=\"watch-multiple-line-values\",\n- config={tuple(line_offsets): gpiod.LineSettings(edge_detection=Edge.BOTH)},\n+ config={line_offsets: gpiod.LineSettings(edge_detection=Edge.BOTH)},\n ) as request:\n while True:\n for event in request.read_edge_events():\n print(\n- \"offset: {} type: {:<7} event #{} line event #{}\".format(\n- event.line_offset,\n- edge_type_str(event),\n- event.global_seqno,\n- event.line_seqno,\n- )\n+ f\"offset: {event.line_offset}\"\n+ f\" type: {edge_type_str(event):<7}\"\n+ f\" event #{event.global_seqno}\"\n+ f\" line event #{event.line_seqno}\"\n )\n \n \n", "prefixes": [ "libgpiod", "7/9" ] }