<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Thank you!<div><br></div><div>I still disagree with the following statement:</div><div><br></div><div><blockquote type="cite"><div class="gmail_quote"><div>While this is a reasonable expectation, twistd does quite a lot and it wouldn't be quite right to pass on all the arguments in a flat list the way Python does.</div></div></blockquote><div><br></div>Something can be done about that. One possible approach could be to use two argument lists (one - 'twistd' arguments, second - application's arguments) and enforce following rule(s):</div><div><br></div><div>- all arguments that follow after 'twistd' but before Python file name (*.py) are considered as 'twistd' arguments (loaded into &lt;twistdArgs&gt; list;</div><div>- all arguments that follow Python file name (*.py) are considered as Python application's arguments (loaded into &lt;appArgs&gt; list and get passed to that application)</div><div><br></div><div>Thus, it should be possible to execute following commands:</div><div><br></div><div><font class="Apple-style-span" face="Courier" size="3"><span class="Apple-style-span" style="font-size: 12px;"><b>twistd &lt;twistd_args&gt; *.py &lt;app_args&gt;</b></span></font></div><div><br></div><div>Using this approach, it should be simple enough (at least - logically) to allow passing arguments to an application. Of course, this would also limit "duplicate" arguments (same argument appearing in both lists) - due to 'getopt' limitations... But if these rules and limitations are well documented - developers should be able to work around this problem.</div><div><br></div><div>I suggest that Twisted dev. team looks into implementing this...<br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br class="Apple-interchange-newline"><br></div><div>Kind regards,</div><div><br></div><div>Valeriy Pogrebitskiy</div><div><a href="mailto:vpogrebi@verizon.net">vpogrebi@verizon.net</a></div><div><br></div></div></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline"> </div><br><div><div>On Oct 1, 2009, at 4:55 PM, Glyph Lefkowitz wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_quote">On Thu, Oct 1, 2009 at 2:17 PM, Valeriy Pogrebitskiy <span dir="ltr">&lt;<a href="mailto:vpogrebi@verizon.net">vpogrebi@verizon.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div style="">I came across some problem using 'twistd' utility - that I would not have expected from it. The problem is - using 'twistd' to start application that requires command-line arguments. In other words, I would expect that 'twistd' passes command-line arguments to Python application - just as Python does.&nbsp;<div> </div></div></blockquote><div><br>While this is a reasonable expectation, twistd does quite a lot and it wouldn't be quite right to pass on all the arguments in a flat list the way Python does.<br></div><div>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div style=""><div>My question is: how is it possible to use 'twistd' to start applications that do require command-line arguments? Does anyone have suggestions?<br></div></div></blockquote><div><br>twistd doesn't do this for scripts passed with the '-y' option.&nbsp; Those are supposed to be fully-formed configuration files; the options are present in the file itself.<br> <br>However, it's fairly straightforward to get what you want.&nbsp; Instead of writing a python configuration file, write a plug-in for twistd.&nbsp; The technique for doing so is documented here:<br><br>&lt;<a href="http://twistedmatrix.com/projects/core/documentation/howto/tap.html">http://twistedmatrix.com/projects/core/documentation/howto/tap.html</a>&gt;<br> </div></div><br>Hope this helps.<br> _______________________________________________<br>Twisted-Python mailing list<br><a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python<br></blockquote></div><br></div></body></html>