durusmail: quixote-users: Any idea concerning a re-loaded server ?
Any idea concerning a re-loaded server ?
Any idea concerning a re-loaded server ?
william@opensource4you.com
2006-02-12
You add the autoreload.py and you just make a small modification in
"simple_server.py" and it works !!!!

Simple no ???

Once started, you can modify your python file, autoreload detect it and
will reload the file for you in background.

This is very usefull during development phases.

I've tested it with mini_demo.py and it works well.

Further investigation with .ptl files must still be made (I'm not using ptl).

William



DIFF (based on quixote-2.4):

107a108,110
>     import autoreload
>     import sys
>
116,117c119,134
<     run(import_object(options.factory), host=options.host,
port=options.port,
<         https=options.https)
---
>     def _start():
>          run(import_object(options.factory), host=options.host,
port=options.port,
>                https=options.https)
>
>
>     try:
>         autoreload.main(_start, freq=1)
>     except KeyboardInterrupt:
>         print " hit: shutting down autoreloader", "HTTP"
>         sys.exit()
>     except SystemExit:
>         print "SystemExit raised: shutting down autoreloader", "HTTP"
>         # We must raise here: if this is a process spawned by
>         # autoreload, then it must return its error code to
>         # the parent.
>         raise
















william@opensource4you.com wrote:
> Thanks Mario.
>
> That's what I was looking for.
>
> Now it must be adapted it for Quixote simple server.
>
>
>
> mario ruggier wrote:
>>
>>
>> I think the only thing that might be useful would be a crude total web
>> application restart, when in very specific dev mode. Here's how this is
>> done in (threaded) cherrypy:
>> http://svn.cherrypy.org/trunk/cherrypy/lib/autoreload.py
>>
>> Maybe in quixote or qp, a separate script/process could watch specific
>> source files, as well as (re-)spawn off the actual web process.
>>
>> m.
>>
>
>
> --
> William: http://www.opensource4you.com
>
> _______________________________________________
> Quixote-users mailing list
> Quixote-users@mems-exchange.org
> http://mail.mems-exchange.org/mailman/listinfo/quixote-users
>


--
William: http://www.opensource4you.com

reply