On 3/7/06, Ian Bicking <[EMAIL PROTECTED]> wrote:
> I think files ending in .py should be importable and usable.  If so,
> then great, if not, then a new extension.  I guess that's more
> restrictive than just "valid Python".

So, here's the other bit of magic that goes on in the config file:

foo.bar = "baz"

path("/static")
static_filter.on = True

results in a config dictionary that looks like this:

{ "global" : { "foo.bar" : "baz" },
"/static" : { "static_filter.on" : True } }

path() does a little housekeeping to keep track of where you want
things to go, and that only works when you exec the file into a
special dictionary. So, this file can be made to be importable, but
the sectioned behavior that it provides would not function if you just
import.

It *can*, however, use Python functions and execute statements and
evaluate expressions as needed to compute values.

So, if there's another trick that we can use to make it look INI-like,
but still function entirely like a normal Python module, I'm game for
trying that out. Otherwise, given the constraints above, it sounds
like people are interested in changing the extension. ".pyini"? "pyc"?
(for python configuration -- just kidding!).

Kevin

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to