On Mar 22, 10:17 am, Van Gale <[email protected]> wrote:
> Florian Bösch wrote:
> > I think I've made my desire sufficiently clear in the first post to
> > this thread.
>
> Your idea is a waste of time because existing solutions work fine.
>
> Your messages are insulting, condescending, and demanding which is
> especially bad given mod_wsgi is an open source project.
>
> Have I removed enough of the blah, blah, blah for you?

The good thing is you didn't use the word jerk :)
The bad thing you did not collaborate on this part
Anyway i give it a shot

!/usr/bin/env python

import os, sys, signal
import traceback

###############################
here = os.path.dirname(__file__)
if here not in sys.path:
    sys.path.insert(0, here)
##############################
Using WSGIImportScript path would be a safer bed i think ?

try:
    from webwork import Application, ConfigParser
    from lib import handlers, Database
    config_path = os.path.join(here, 'app.cfg')
    config = ConfigParser(config_path)
    db_url = config.get('db', 'url')
    db = Database(db_url)

##################################
    app = Application(handlers, db, config)
    def application(environ, start_response):
        if config.getboolean('debug', 'debug'):
            os.kill(os.getpid(), signal.SIGINT)
        return app(environ, start_response)
#######################################
Can you kill something that still has to return some really big
response ?

except:
    data = traceback.format_exc()
    def appliaction(environ, start_response):
        os.kill(os.getpid(), signal.SIGINT)
        start_response('500 SERVER ERROR', [
            ('Content-Type', 'text/plain'),
        ])
        return [data]



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to