"Aaron Held" <[EMAIL PROTECTED]> wrote:
> in a webware servlet write:
>     from config import  datapool
> 
> Then does the datapool get reinitialized every page?

No, when a module is reimported, it is not reexecuted.

> If it does not then is datapool a application level object or a
> context level one?

Module-level, which means interpreter-level, which also means
application-level; though you still must always import it (but that
doesn't reexecute it).

> How can I use  __init__.py to initialize the database connection?
> can I just import config from __init__.py

I'm not sure if this will put the binding in your namespace -- I don't
think it will.  So you'd have to have something like "from thisContext
import datapool".  It is Python's nature not to automatically set
anything up for you.

> I used MakeAppWorkDir.py (thanks for editing the oneshot webware
> path in that script!)  where do I put site specific vs module
> specific modules?

I assume you mean site specific vs. context specific?  You might want
to make a directory off of Webware/ for your site-wide modules.  You
can also import modules from other contexts, you should just use the
complete path (from Bill.SomeModule import Something).

  Ian

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

Reply via email to