On 01/04/17 at 07:48am, Xyne wrote:
On 2017-01-02 19:58 +0100 Jelle van der Waa wrote:
I'd like to chime in that I would love to see pyalpm to stop using it's self written config parser. I've put it on my TODO list, but I'm not sure when I'll be able to look at it.
At the risk of it becoming vaporware, I'm working on this right now. I already have a working shared library for src/pacman/conf.h (via CMake) and the beginnings of a Python extension module for working with it (so far it only includes a wrapper around "parseconfig" and a class for config_repo_t).
As I was writing that module I realized that I need most of alpm so I've started writing my own Python module for that too. I'm using scripts to automatically generate code for all of the enums and structs to ensure uniformity. The idea is to provide a module with a 1-to-1 correspondence with alpm.h (all enums as globals, classes for each struct, identical function names) along with utility modules for convenience code (e.g. convert enums to strings). This will make it much easier to maintain.
Interesting, are you using CFFI or are you generating C code for CPython? -- Jelle van der Waa