[Twisted-Python] How do I modify sys.path in a .tap file?

I have an application which needs to modify sys.path, in order to pick up its configuration file (written in Python, naturally :-)) But I'm not sure how I do this. Ideally, I'd like to set an option in the tap config file, so I could just do mktap MyApp --confdir .... and be able to use config["confdir"] to set "something" which would be picked up and added to sys.path when I run the tap file with twistd. But I'm not sure how I could do this. Subclassing service.MultiService, so that I could set sys.path in startService(), worked OK, but I'm not sure if that's the best idea. Is there another way of doing this sort of thing, that I'd be better using? Paul. -- This signature intentionally left blank

Paul Moore wrote:
Subclassing service.MultiService, so that I could set sys.path in startService(), worked OK, but I'm not sure if that's the best idea. Is there another way of doing this sort of thing, that I'd be better using?
This sounds reasonable to me. -- Twisted | Christopher Armstrong: International Man of Twistery Radix | Release Manager, Twisted Project ---------+ http://radix.twistedmatrix.com/
participants (2)
-
Christopher Armstrong
-
Paul Moore