Re: [libgpiod v2][PATCH v4 0/4] bindings: implement python bindings for libgpiod v2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 26, 2022 at 2:34 PM Bartosz Golaszewski <brgl@xxxxxxxx> wrote:
>
> This is the fourth iteration of python bindings for libgpiod v2.
>
> The code has been split into high-level python and low-level C layers
> with the latter only doing the bare minimum.
>
> The data model is mostly based on the C++ one with the main difference
> being utilizing dynamic typing and keyword arguments in place of the
> builder pattern. That allows us to reduce the number of methods and
> objects.
>
> Because python doesn't have RAII, unlike C++, we provide a module-level
> request_lines() helper as gpiod.Chip(path).request_lines(...) one-liner
> could lead to the chip left dangling even after the last reference is
> dropped.
>
> Because python forces us to dynamically allocate objects all the time even
> for fundamental types (which are also immutable) there's no point in trying
> to replicate the edge-event buffer. Instead LineRequest.read_edge_event()
> just returns a list of events.
>
> v3 -> v4:
> - use list and dict comprehensions where applicable
> - add a helper for detecting GPIO devices in examples
> - remove commented out code
> - fix whitespace errors
> - cache chip_info in the chip object
> - rename Chip.map_line() to Chip.line_name_from_id()
> - disallow repeating line offsets/names as well as offset-name conflicts in request configs
> - don't modify python objects with GIL released (self->chip assignment)
> - fix type conversion strings
> - fix error check in request_offsets()
> - fix type comparison warnings
>

I applied these patches, squashed the entire libgpiod v2 patchset to
preserve bisectability and pulled the entire thing into the master
branch. Let's continue the development from here. The new release is
definitely not done yet but let's just have some solid base to work
on.

Bart



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux