hi there,

today i was trying to write a procedure to load per-context configuration information from a text file (once in memory a simply python dict) when context initializes.

i thought to store loading instructions in contextInitialize() function inside context's __init__.py file, so i've done the following:

def contextInitialize(app, path):
    cfg = loadConfiguration(os.path.join(path, 'blog.conf'))

it works as expected but after this point i wasn't able to proceed. now "cfg" var contains a dictionary with info, but i have now idea how to make accesible such dictionary from my servlet hierarchy. how can i stuff "cfg" to the current context? i was able to attach cfg to application object, but it was not ideal, i need per-context info.

i would like to stick to "contextInitialize()" and not to place
code in the servlet hierarchy (SitePage an the like) and not
to hardcode paths here and there.

any idea?

TIA.









-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to