At 10:55 AM 12/7/01 -0800, Chuck Esterbrook wrote:
>On Friday 07 December 2001 06:05 am, Geoffrey Talvola wrote:
> > As far as naming conventions, these are valid Python
> > modules/packages, so .py would probably be best. But it would be
> > nice to be able to identify config files from their filename, so it
> > could look like this for a multiple-file configuration:
> >
> > Configs/
> > __init__.py
> > AppServerConfig.py
> > ApplicationConfig.py
> > ...
>
>
>What's the __init__.py for? In other projects I just went with:
>
>
>Configs/
> FooBar.config
>
>
>and did an exec on FooBar to get the variables which looked like:
>
>reps = 50
>names = 'foo bar'.split()
>
>etc.
The __init__.py was just so that the config files could be imported as a
package. But if there are good reasons to stick with *.config, then
obviously you can't just import the files as a package, so the reason for
__init__.py goes away.
>We definitely have to be able to distinguish the file as install.py
>does things with config files (which will change in nature in the
>future, but still be a requirement).
>
>
>The plan I was changing for Configurable was simply to do an exec,
>unless the first char was a {, in which case I would do an eval.
Just make sure to chop off whitespace first. I don't know if you want to
scan for comments before the first { or not.
--
- Geoff Talvola
[EMAIL PROTECTED]
_______________________________________________
Webware-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-devel