bindings: python: improve LineSettings.__repr__()
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Fri, 20 Sep 2024 14:32:03 +0000 (16:32 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Fri, 27 Sep 2024 08:09:37 +0000 (10:09 +0200)
commitf6c8c3321d8f30979fa593a4f6546ff3dccd2549
treef82d094ab308d275e30c8c2cdba37759ff3e0d51
parent5715f61fd204d232925b30c26e20cce4993ddf5a
bindings: python: improve LineSettings.__repr__()

Currently, for the output of LineSettings.__repr__() to be eval()able,
the user must have pulled all the relevant definitions from gpiod.line
within the scope where it is used. Modify the output so that all the user
needs is `import gpiod`.

Reported-by: Vincent Fazio <vfazio@gmail.com>
Link: https://lore.kernel.org/r/20240920143203.6377-1-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
bindings/python/gpiod/line_settings.py
bindings/python/tests/tests_line_settings.py