Re: A more useful command-line wsgiref.simple_server?

PJ Eby <pje-Wh6+Hckhi6HFNGf7iClzIwC/[email protected]> Thu, 29 Mar 2012 13:46:12 -0400
Newsgroups gmane.comp.python.web
Message-ID <CALeMXf7dz0Dosfy7qF=5XybYLwu9_yWjC1EDU-q6-xedx1rT=w@mail.gmail.com>
On Thu, Mar 29, 2012 at 6:02 AM, Masklinn <[email protected]> wrote:

> * This would allow testing that the script has no error without having
>  to go through mounting it in e.g. mod_wsgi
> * It would make trivial/test applications (e.g. dynamic responders to
>  local JS) simpler to bootstrap as there would be no need for the
>  half-dozen lines of wsgiref.simple_server bootstrapping and "hard"
>  dependency on wsgiref,
>

Looks good to me.  A few things I'd suggest adding:

* Add an option to serve a single request or forever
* Have it optionally launch any script in the webbrowser, not just the demo
* Allow use of a module instead of a script to obtain the application
* drop the ':' separator syntax, or else use os.pathsep so that it works
properly on Windows (where ':' can denote a drive letter)

_______________________________________________
Web-SIG mailing list
[email protected]
Web SIG: http://www.python.org/sigs/web-sig
Unsubscribe: http://mail.python.org/mailman/options/web-sig/gcpw-web-sig%40m.gmane.org