bin/qmsk-irclogs.fcgi
author terom
Wed, 30 Mar 2016 01:29:22 +0300
changeset 153 47dbaa6b13b0
parent 147 95b0a3fdd207
permissions -rwxr-xr-x
qmsk.irclogs: config LogChannel tempire
147
95b0a3fdd207 qmsk-irclogs.fcgi: using #! python, not python2.5
Tero Marttila <terom@fixme.fi>
parents: 143
diff changeset
     1
#!/usr/bin/python
126
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