[Twisted-Python] mktap web --index patch

All, It would appear that a twisted web server can't be easily configured (via mktap web --index) to use both index.html _and_ index.php (or any other combination) as directory indexes. mktap2.1 web --help ... -i, --index= Add the name of a file used to check for directory indexes. [default: index, index.html] SO.. I tried: 1) mktap2.1 web --path ~/public_html/ --index index.php and my php indexed directories work; but index.html indexed dirs do not 2) mktap2.1 web --path ~/public_html/ --index index.html,index.php and get the mktap web usage I've got to believe what I'm looking to do is something others would want to be able to configure too. However, the relevant twisted/tap/web.py code will only allow the user to add a single directory index; pretty strange limitation... Here's a patch to enable a user to specify multiple directory indexes to the web server via mktap (i.e. like #2 above): --- Twisted.orig/twisted/tap/web.py Wed Oct 23 07:56:52 2002 +++ Twisted/twisted/tap/web.py Sun Oct 27 13:35:34 2002 @@ -54,10 +54,11 @@ self.opts['root'] = None def opt_index(self, indexName): - """Add the name of a file used to check for directory indexes. + """Add the name of a file(s) used to check for directory indexes. [default: index, index.html] """ - self.opts['indexes'].append(indexName) + for index in string.split(indexName,','): + self.opts['indexes'].append(index) opt_i = opt_index

On Sun, Oct 27, 2002 at 01:49:55PM -0500, Mike Snitzer wrote:
mktap web --path ~/public_html/ -i index.html -i index.php -i ... -- Christopher Armstrong << radix@twistedmatrix.com >> http://twistedmatrix.com/users/radix.twistd/

Christopher Armstrong (radix@twistedmatrix.com) said:
mktap web --path ~/public_html/ -i index.html -i index.php -i ...
Ah thanks, I didn't think to try stringing a bunch of -i's together. On a completely unrelated note; I've created a "Powered by Twisted" icon and attached it for all those interested (it's _very_ small (1.5K); and I'm not sure if something similar already exists or not). Mike

On Sun, Oct 27, 2002 at 01:49:55PM -0500, Mike Snitzer wrote:
mktap web --path ~/public_html/ -i index.html -i index.php -i ... -- Christopher Armstrong << radix@twistedmatrix.com >> http://twistedmatrix.com/users/radix.twistd/

Christopher Armstrong (radix@twistedmatrix.com) said:
mktap web --path ~/public_html/ -i index.html -i index.php -i ...
Ah thanks, I didn't think to try stringing a bunch of -i's together. On a completely unrelated note; I've created a "Powered by Twisted" icon and attached it for all those interested (it's _very_ small (1.5K); and I'm not sure if something similar already exists or not). Mike
participants (2)
-
Christopher Armstrong
-
Mike Snitzer