bindings: python: convert lines to offsets in LineRequest
authorVincent Fazio <vfazio@xes-inc.com>
Thu, 14 Nov 2024 14:51:05 +0000 (08:51 -0600)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 19 Nov 2024 14:21:01 +0000 (15:21 +0100)
commitfcddb71b45e7bf7dde3eb0c6849acba7bc609462
treed98680c016455ba7d23f6a9f83dfe5f916eea07b
parentfcb520f9fe5cc6e550646daee224c6e3d0c3bfb6
bindings: python: convert lines to offsets in LineRequest

Remove `_check_line_name` in favor of a new function, `_line_to_offset`,
that converts a line reference to an offset.

This new function helps narrow types and simplifies the iteration logic
that is used to build objects to interface with `_ext.Request`.

Signed-off-by: Vincent Fazio <vfazio@xes-inc.com>
Link: https://lore.kernel.org/r/20241114145116.2123714-13-vfazio@xes-inc.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
bindings/python/gpiod/line_request.py