I've got AJAX calling every few seconds, so I guess that's why your 
solution doesn't work for me. I can wait for minutes but it doesn't catch 
it.

I've made a ugly monkeypatch which cleanly exits the process when Enter is 
pressed. 
Inside the handler any thing like "raise KeyboardInterrupt", "raise 
SystemExit", "sys.exit()", "exit()",  didn't work, so I had to do it with "
os._exit(1)"
Any better solution than this is *REALY* welcome.


import select
import os
def scaper():
def handler(handle):
if select.select([sys.stdin], [], [], 0) == ([sys.stdin], [], []):
print 'Exiting by monkeypatch!'
os._exit(1)
return handle()
return handler

Then:

app = web.application(urls, globals())
app.add_processor(scaper())
app.run()

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/webpy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to