On Friday 07 December 2001 10:55, 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 I'm proposing something more like:

1) WebwareConfig.py

OR

2) 
WebwareConfig/
    __init__.py
    WebKit.py
    UserKit.py
    MiddleKit.py
OR

3)
WebwareConfig/
    __init__.py
    WebKit/
        __init__.py
        AppServer.py
        ...
    UserKit.py
    MiddleKit.py

The scheme we were talking about yesterday would allow the end user 
to make the choice of whether to go for a single file or split it up. 
To Webware and its components it would be transparent.  I think 
option 2 or 3 should be the default layout, as a Webware componenent 
shouldn't meddle with another components configs.

> 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()

The idea is to import the 'WebwareConfig' package so that all import 
statements inside it will work properly without needing to manipulate 
sys.path.  Exec makes me go 'ick', when you could just to an import. 


> 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).

That brings up the issue of what should it be doing to the config 
files?  There have been fairly unanimous calls for the core classes 
to be installed in a completely separate location from user files via 
distutils.  

But what about the config files?  Do they also get installed to the 
same place as the core packages or are they something the user must 
install?  I'd argue for installing a template of the configs to the 
central location and then requiring the users to 'check out' a copy 
they can modify locally  ---> "<prompt> webware install-configs" or 
something like that would copy the templates to the current directory 
for the user to modify.  

> 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.

What do you think about the syntax that Geoff proposed as an 
alternative to dictionaries?  They're compatible, but I prefer the 
class syntax.


Tavis

_______________________________________________
Webware-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-devel

Reply via email to