From: Chuck E. <ec...@mi...> - 2001-04-12 14:38:52
|
At 09:59 AM 4/12/2001 -0400, Roy W Fileger wrote: >I have not been able to get a sense of how to do that from the WebKit >materials. If you can point me in the right direction I would greatly >appreciate it. Based on my recent experience, I would say that you could put that initialization code in a module. Importing modules in Python is thread safe--the module code will only execute once. For convenience, you can make a method in SitePage that returns the data: class SitePage: def data(self): import Parameters return Parameters.data Now your subclasses of SitePage can all say: self.data() which is convenient. Since the parameters are kept in a module, non-servlet classes can also use them: FooBar.py: def doSomething(): import Parameters print Parameters.data Let us know if that makes sense and how it works for you. Also, if you would ever be interested in posting a little article or HOWTO on credit card processing, that would be a nice contribution. It doesn't have to be formal. -Chuck |