[augeas-devel] [ANNOUNCE RFC] Native python augeas bindings

David Lutterkort dlutter at redhat.com
Mon Jun 2 16:46:47 UTC 2008


On Fri, 2008-05-30 at 18:49 -0700, Jeff Schroeder wrote:
> I am pleased to announce native python bindings for augeas written by
> Nathaniel McCallum:
> http://www.digitalprognosis.com/opensource/augeas.py

Cool .. is there any way that you and Harald can come to an agreement
what the 'official' python bindings should be ? It seems silly to have
two sets of bindings ...

> Q: Why aren't your bindings in that cool dcvs that starts with an m
> and ends with an ercurial?
> A: Because I don't have an account on hg.et.redhat.com

Unfortuantely, I can't give ssh access for that machine to people
outside of RedHat, because of the way it's firewalled. But it doesn't
have to be on that machine - if you host and maintain the bindings on
some other machine (e.g., fedorahosted.org) I'll be more than happy to
update the Augeas pages to point to that. But I'd really only want _one_
set of python bindings.

> Would an API break be out of the question?

For the C API: yes, since I said that the C API is stable; I leave it up
to Harald on how much breakage in the Python API he thinks is
acceptable.

> get() in C, returning NULL is the right behavior.  The question for
> today kids: "Is NULL an error?"
> If it is an error, it should be an exception in python

get returns an int; if that int is < 0, you have an error. It returns 0
if you try to get a nonexistant path, and 1 if the path exists.
Typically, you get an error if the path matches more than one node.

> The order of the variables in the "print" method (called "write" in
> our bindings) is crack
> this is because in all functions that take a path, path is the first
> argument (except write / print).
> It should be normalized

This follows the model of things like fprintf etc. where you have the
FILE * first and then what to print. Regardless of that, sine the API is
stable, I won't change that now.

David





More information about the augeas-devel mailing list