As long as I'm composing an email, I might as well mention that I had forgotten to mention Swig as a dependency (d'oh!). I now have a mention of it on the page, and a spec file that can be built using pkgtool. If you tried this before and gave up because of a missing package, please give it another shot.
On Mon, Jul 14, 2008 at 10:35, Akhilesh Mritunjai <[EMAIL PROTECTED]> wrote: > I had a quick look. Looks great! Thanks! > A suggestion - From given example, I think API could be made more "pythonic". > Python is dynamically typed and properties can be dynamically looked up too. > Thus, instead of prop_get_* we can have - > > 1. prop() : generic function, returning "typed" arguments. The builtin zfs > properties would be returned with correct "type" and user properties would be > returned as generic string. Definitely. This was just a barebones "does it work" kind of thing. I do plan to make it more python-styled than C-wrapper styled, but I wanted to go for the "release early, release often" kind of thing. > 2. Ability to just say "z.property_name" (eg. z.compression). This would be > trivial to implement syntactic sugar. Sure. This will just take a bunch of wrappers to get/set all the properties. > Also, some work would be needed to provide "pythonic" iterators and other > idioms so that API does not feel like a python interface to C. This I'm not so sure about. I could do it, sure, but the only way I can think of to do this would basically be this: def iterable_filesystems(self): def fn(fs, data): data.append(fs) list_of_fs = [] self.iter_filesystems(fn, list_of_fs) return list_of_fs Granted, perhaps this isn't pythonic as it stands, but especially in cases with thousands of filesystems storing all those objects could get (relatively) expensive. I may have to look into the Python API some more; perhaps there's a way to provide an iterable object without shoving everything into Python space at once. Will _______________________________________________ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss