bin/index.fcgi
author Tero Marttila <terom@fixme.fi>
Sun, 13 Sep 2009 01:15:56 +0300
changeset 140 6db2527b67cf
parent 134 index.fcgi@fbccc1648d79
permissions -rwxr-xr-x
restructure into package format - the qmsk.* stuff doesn't work so well though, requires a symlink for qmsk.web to work...
126
2528cef45fe3 simple FastCGI support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     1
#!/usr/bin/python2.5
2528cef45fe3 simple FastCGI support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     2
# :set filetype=py
2528cef45fe3 simple FastCGI support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     3
2528cef45fe3 simple FastCGI support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     4
"""
134
fbccc1648d79 improved error handling for CGI/FastCGI
Tero Marttila <terom@fixme.fi>
parents: 126
diff changeset
     5
    FastCGI mode using qmsk.web.fastcgi_main
126
2528cef45fe3 simple FastCGI support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     6
"""
2528cef45fe3 simple FastCGI support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     7
134
fbccc1648d79 improved error handling for CGI/FastCGI
Tero Marttila <terom@fixme.fi>
parents: 126
diff changeset
     8
from qmsk.web import fastcgi_main
fbccc1648d79 improved error handling for CGI/FastCGI
Tero Marttila <terom@fixme.fi>
parents: 126
diff changeset
     9
fbccc1648d79 improved error handling for CGI/FastCGI
Tero Marttila <terom@fixme.fi>
parents: 126
diff changeset
    10
# XXX: error handling for imports? Lighttp sucks hard at this
140
6db2527b67cf restructure into package format - the qmsk.* stuff doesn't work so well though, requires a symlink for qmsk.web to work...
Tero Marttila <terom@fixme.fi>
parents: 134
diff changeset
    11
from qmsk.irclogs import wsgi
134
fbccc1648d79 improved error handling for CGI/FastCGI
Tero Marttila <terom@fixme.fi>
parents: 126
diff changeset
    12
126
2528cef45fe3 simple FastCGI support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    13
def main () :
2528cef45fe3 simple FastCGI support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    14
    """
134
fbccc1648d79 improved error handling for CGI/FastCGI
Tero Marttila <terom@fixme.fi>
parents: 126
diff changeset
    15
        Build our WSGIApplication and run
126
2528cef45fe3 simple FastCGI support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    16
    """
2528cef45fe3 simple FastCGI support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    17
134
fbccc1648d79 improved error handling for CGI/FastCGI
Tero Marttila <terom@fixme.fi>
parents: 126
diff changeset
    18
    # create app
fbccc1648d79 improved error handling for CGI/FastCGI
Tero Marttila <terom@fixme.fi>
parents: 126
diff changeset
    19
    app = wsgi.Application()
126
2528cef45fe3 simple FastCGI support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    20
134
fbccc1648d79 improved error handling for CGI/FastCGI
Tero Marttila <terom@fixme.fi>
parents: 126
diff changeset
    21
    # run once
fbccc1648d79 improved error handling for CGI/FastCGI
Tero Marttila <terom@fixme.fi>
parents: 126
diff changeset
    22
    fastcgi_main.run(app)
126
2528cef45fe3 simple FastCGI support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    23
2528cef45fe3 simple FastCGI support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    24
if __name__ == '__main__' :
2528cef45fe3 simple FastCGI support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    25
    main()
2528cef45fe3 simple FastCGI support
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    26