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

Nathaniel McCallum nathaniel at natemccallum.com
Tue Jun 3 00:30:01 UTC 2008


On Mon, Jun 2, 2008 at 12:46 PM, David Lutterkort <dlutter at redhat.com> wrote:
> 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 ...

Agreed.  I suspect pure-python will be easier to maintain long-term.
However, since the bindings were basically written as an exercise in
writing python bindings using ctypes, I don't mind chalking it up to a
teaching experience.

Harald?

>> 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.

Sure, I wasn't sure if they were stable or not. If they are stable,
don't change them...

>> 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.

So the question still remains... Is 0 an error?  I would say yes.  But
I could be convinced otherwise.  Basically, the method would throw two
exceptions.  One is a RuntimError and the other would be a
NonexistantPath error.  Does this sound sane?

Nathaniel




More information about the augeas-devel mailing list