view wiki/server/moin_flup_wsgi.py @ 3111:79f850129782

logging: fix server scripts to load logging config, fix logging configs
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 25 Feb 2008 14:01:08 +0100
parents c6e39279f83b
children b6edaabd06b7
line wrap: on
line source
"""
    MoinMoin - Moin as WSGI application with flup as fcgi gateway

    @copyright: 2005 by Anakim Border <akborder@gmail.com>,
                2007 by MoinMoin:ThomasWaldmann
    @license: GNU GPL, see COPYING for details.
"""

use_threads = True
unixSocketPath = '/tmp/moin.sock'

import os

from MoinMoin import log
log.load_config('.../wiki/config/logging/logfile') # XXX fix path

# Set threads flag, so other code can use proper locking
from MoinMoin import config
config.use_threads = use_threads
del config

from flup.server.fcgi import WSGIServer
from MoinMoin.server.server_wsgi import moinmoinApp, WsgiConfig

class Config(WsgiConfig):
    pass

config = Config() # MUST create an instance to init logging

if __name__ == '__main__':
    server = WSGIServer(moinmoinApp, bindAddress=unixSocketPath)
    server.run()
    os.unlink(unixSocketPath)