when you say it detects stale code, how deep does the detection reach?
let's say I have a servlet script A. inside A it says ... import foo ...
does wsgikit detect changes to foo?
WSGIKit looks through all the modules in sys.modules and restarts the entire server if one of them changes. It is not initiated by a request, but rather runs in a separate thread and polls the files regularly. You can also make it look at extra files, like a configuration file, and restart when those change too. It doesn't reload modules, which is much more challenging to do correctly, though at some point I'll probably have it look at modules and see if some are explicitly marked to be reloadable. E.g., Webware servlet files (but not the files they import) can generally be reloaded.
Yeah, restarting is the easy way out. No shame in taking the easy way sometimes! That is what Spyce has to do for anything it doesn't compile itself.
BTW, to accomodate pathnames with spaces in them (common on Windows) you may want your reloader code to do something like this
args = ['"' + re.sub('"', r'"', i) + '"' for i in args]
before spawning the subprocess.
I also like to run python -u (if the speed hit matters they shouldn't have the modules checker turned on).
eh, your wiki nuked the backslash in that sub() call.
What happens if you use literal block text, like so:\bleh
Yep. Seems to work.