[Twisted-Python] Getting the options object from the service
Hello Everybody What is the prefered way to get the options object from the servicemaker when using twistd plugins. I guess i could access the object via from twisted.plugins.my_plugin import myServiceMaker options = myServicemMaker.options But is there a better way to do it? Somthing like from somwhere import get_service_config() options = get_service_config() All the best -- Brunsgaard
Hi Jonas, I strongly prefer to pass the options around (through the Service objects you're making) rather than relying on the global state of the plugin instance. hth lvh On Mon, Mar 17, 2014 at 2:02 PM, Jonas Brunsgaard < jonas.brunsgaard@gmail.com> wrote:
Hello Everybody
What is the prefered way to get the options object from the servicemaker when using twistd plugins.
I guess i could access the object via
from twisted.plugins.my_plugin import myServiceMaker options = myServicemMaker.options
But is there a better way to do it? Somthing like
from somwhere import get_service_config() options = get_service_config()
All the best
-- Brunsgaard
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
lvh, thanks for your answer. I will keep parsing the options object around. On Mon, Mar 17, 2014 at 2:20 PM, Laurens Van Houtven <_@lvh.io> wrote:
Hi Jonas,
I strongly prefer to pass the options around (through the Service objects you're making) rather than relying on the global state of the plugin instance.
hth lvh
On Mon, Mar 17, 2014 at 2:02 PM, Jonas Brunsgaard < jonas.brunsgaard@gmail.com> wrote:
Hello Everybody
What is the prefered way to get the options object from the servicemaker when using twistd plugins.
I guess i could access the object via
from twisted.plugins.my_plugin import myServiceMaker options = myServicemMaker.options
But is there a better way to do it? Somthing like
from somwhere import get_service_config() options = get_service_config()
All the best
-- Brunsgaard
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
participants (2)
-
Jonas Brunsgaard -
Laurens Van Houtven