Custom classes for various extensions
Posted: 29 Jun 2009, 21:25
Hi Guys,
I have a set of classes that are common to all the extensions e.g: To read config, check for webserver session existance etc. And most of them are singletons, so just one instance of them is good enough through out the installation.
Is there a way that all these classes are initialized and are available to all the extensions without they being initiated in the extension's init function?
Say I have a config class:
Now can I initialize this class and object so that they are available to all the extensions?
If so how do I initialize it? Does something like.
work??
Any help would be appreciated.
Regards,
Yaswanth
P.S> I am using Python to code my extensions
I have a set of classes that are common to all the extensions e.g: To read config, check for webserver session existance etc. And most of them are singletons, so just one instance of them is good enough through out the installation.
Is there a way that all these classes are initialized and are available to all the extensions without they being initiated in the extension's init function?
Say I have a config class:
Code: Select all
class cfg
myConfig = cfg()
If so how do I initialize it? Does something like.
Code: Select all
_server.myConfig
Any help would be appreciated.
Regards,
Yaswanth
P.S> I am using Python to code my extensions