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

Jeff Schroeder jeffschroed at gmail.com
Sat May 31 01:49:37 UTC 2008


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.

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.

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

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!

-- 
Jeff Schroeder

Don't drink and derive, alcohol and analysis don't mix.
http://www.digitalprognosis.com




More information about the augeas-devel mailing list