Configuration rewrite

9 views
Skip to first unread message

Jeff Lindsay

unread,
Mar 23, 2012, 7:37:21 PM3/23/12
to ginkg...@googlegroups.com
In the rewrite branch (poorly named "ginkgo" branch), I just pushed a
configuration module that is basically a replacement for current
configuration. It's now responsible for loading configuration,
contains a configuration container (allowing multiple configurations
to be used, say, in testing), and has the same Setting API with some
extra convenience functions for when you can't use a descriptor. It
also adds a better API for determining if a setting has changed.

Anyway, would love any feedback:
https://github.com/progrium/ginkgo/blob/ginkgo/ginkgo/config.py

Jeff Lindsay

unread,
Mar 23, 2012, 10:43:50 PM3/23/12
to ginkg...@googlegroups.com
Alan's offline feedback was to rename namespaces to views. I think
it's still a little weird, but better than namespaces.

He also commented on the Setting descriptor not having a __set__
method. This was done so that you could override the variable per
object. If you implement __set__, the object level assignment would
affect all other objects of that class. This seemed to be unexpected
behavior that prevents you from overriding at the object level.

Alan believes we can implement __set__ so it will set it on the object
or set it class level and is going to submit a pull request for that.

I think that's it.

-jeff

Alan Shreve

unread,
Mar 24, 2012, 5:56:07 PM3/24/12
to ginkg...@googlegroups.com
I managed to get a working implementation with __set__, but without using the ObjectWrapper, you can't get the 'changed' property to show up so I scrapped it.

While I was messing around, I ended up refactoring the module with a slightly different interface: https://github.com/aes-/ginkgo/blob/8ac1003290fb466f76b68e281fa69a5628e8d505/ginkgo/config.py

- alan

Jeff Lindsay

unread,
Mar 24, 2012, 5:58:58 PM3/24/12
to ginkg...@googlegroups.com
Discussion on these changes happening here:
--
Jeff Lindsay
http://progrium.com
Reply all
Reply to author
Forward
0 new messages