[mod_python] global textual constants

Colin Bean ccbean at gmail.com
Mon Jun 5 13:52:38 EDT 2006


I haven't used publisher extensively, but FWIW you should be able to
call your setup code in the global scope of the module (it'll be
executed when publisher imports the module), and reference slot1,
slot2, etc in as globals in your publisher code.

-Colin

(sorry for the duplicate, David, I forgot to re: list)

On 6/5/06, David Bear <David.Bear at asu.edu> wrote:
> I am attempting to have modpython populate certain slots in a psp
> template.
>
> Since publisher calls the function named on the url automagically, is
> there  some init that I can call prior to that? I would like to have
> my script read some files that would provide globally available text
> -- something like a common footer disclaimer --
>
> so I could do someting like
>
> slot1 = open('slot1.txt', 'r').read()
> slot2 = open('slot2.txt', 'r').read()
>
> Then slot1 and slot2 would be available in any function that I need
> them.
>
> --
> David Bear
> phone:  480-965-8257
> fax:    480-965-9189
> College of Public Programs/ASU
> Wilson Hall 232
> Tempe, AZ 85287-0803
>  "Beware the IP portfolio, everyone will be suspect of trespassing"
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>


More information about the Mod_python mailing list