[Twisted-Python] Passing extra arguments to twistd?
terry at jon.es
Fri Jun 9 18:50:25 EDT 2006
OK, I take your point. Below are a couple more reasons why I still think it
would be useful.
>>>>> "JPC" == Jean-Paul Calderone <exarkun at divmod.com> writes:
JPC> .tac files _are_ configuration, so they don't _take_ configuration.
JPC> You should have so little code in your .tac file that it is neither
JPC> burdensome nor distasteful to make a copy and change bits of it to
JPC> meet particular configuration requirements.
.tac files don't always seem to be that small:
~/Nevow-0.8.0/examples $ find . -name '*.tac' -print0 | xargs -0 wc -l
I'd like to avoid making people edit python files in what I distribute. I
know it seems easy, that it is easy, but it's also easy to provide a
familiar .ini style config file and let them edit that. Then the .ini file
could be passed to twistd and on to my app. This minimizes duplicated code
in the case that the .tac file is non trivial and is more idiot proof
(especially given python's indentation sensitivity).
Anyway, for now I'm taking your advice and simply embedding a config file
name in my .tac file. It's not a big deal - I was just wondering.
More information about the Twisted-Python