[Twisted-Python] Passing extra arguments to twistd?
I have a .tac file and am using twistd on it to start the application. I would like to be able to specify a config file on the command line so the .tac file code can figure out what it should do. Twistd doesn't seem to want me to do that though. Something like allowing $ twistd -twistedopts file -- extra args here... would be nice. Or is there a better way to do this? Regards, Terry
On Fri, 9 Jun 2006 23:03:06 +0200, Terry Jones
I have a .tac file and am using twistd on it to start the application. I would like to be able to specify a config file on the command line so the .tac file code can figure out what it should do. Twistd doesn't seem to want me to do that though.
Something like allowing
$ twistd -twistedopts file -- extra args here...
would be nice. Or is there a better way to do this?
.tac files _are_ configuration, so they don't _take_ configuration. You should have so little code in your .tac file that it is neither burdensome nor distasteful to make a copy and change bits of it to meet particular configuration requirements. On the other hand, .tac files are far from the final word on configuration. They're just the last word Twisted has put in so far ;) No doubt we'll see something better added at some future date. Jean-Paul
Jean-Paul Calderone ha scritto:
[...]
On the other hand, .tac files are far from the final word on configuration. They're just the last word Twisted has put in so far ;) No doubt we'll see something better added at some future date.
Maybe just a --conf=myconfig argument to twistd that will parse the config file (ini file or a simple python module) and call makeService(config) as with command line arguments. Regards Manlio Perillo
participants (3)
-
Jean-Paul Calderone
-
Manlio Perillo
-
Terry Jones