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

Harald Hoyer harald at redhat.com
Sat May 31 18:11:45 UTC 2008


Jeff Schroeder wrote:
> Hello all,
> 
> I am pleased to announce native python bindings for augeas written by
> Nathaniel McCallum:
> http://www.digitalprognosis.com/opensource/augeas.py
> 
> Q: Ummmm sorry dude, python-augeas already exists. What gives?
> A: These are python bindings using ctypes that contain no platform
> specific code and attempt
> to be as "pythonic" as possible.
> 
> 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
> 
> Q: How do you know that these work?
> A: Because Harald Hoyer was nice enough to point me at the unit tests here:
> http://hg.et.redhat.com/misc/python-augeas?cmd=manifest;manifest=83d01599cc466c7fa4571862aa545e7ff6ac1aad;path=/test/
> 
> which I modified from using augeas.augeas to augeas.Augeas. The
> modified version is located here:
> http://www.digitalprognosis.com/opensource/test_augeas.py
> 
> Harald also sent a patch to fix a copy and paste error.
> 
> Q: Why are you doing this?
> A: Duh... world domination. Python is awesome.
> 
> Now that the announcement is over, we have a few questions for the
> augeas development team.
> 
> Would an API break be out of the question?
> 
> Ideally the python bindings should match PEP8:
> http://www.python.org/dev/peps/pep-0008/
> This is why augeas.Augeas is more pythonic than augeas.augeas. If
> nothing much is using
> the python bindings yet we should switch this.

we could do class augeas(Augeas) and add a deprecation warning

> 
> 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
> 
> If Harald is ok with it, we would like for these native python
> bindings to be the "preferred" ones.

yes, although it is not yet a "versioned" library dependency. Requiring major version ".0" feels much better.

> 
> "print" as a method name is horrible.  It is a reserved keyword in
> many languages. What would
> be a better name for this method?

I called it "printnodes"

> 
> 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
> 
> Thanks and we look forward to the comments!
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3636 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20080531/e5dfb62f/attachment.bin>


More information about the augeas-devel mailing list