twistd using usage.options in a *.tac file

Question:

I’m writing a server with Twisted that is based on a *.tac file that starts the services and the application. I’d like to get one additional command line argument to specify a yaml configuration file. I’ve tried using usage.Options by building a class that inherits from it, but is choking because of the additional, twistd command line arguments (-y <filename> for example) not being specified in my class Options(…) class.

How can get one additional argument and still pass the rest to twistd? Do I have to do this using the plugin system?

Asked By: writes_on

||

Answers:

A tac file is configuration. It doesn’t accept configuration.

If you want to pass command line arguments, you do need to write a plugin.

Answered By: Jean-Paul Calderone
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.