view wiki/server/mointwisted @ 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 caad2c46e525
children cd43bbf56c33
line wrap: on
line source
#!/usr/bin/env python
"""
    mointwisted - control MoinMoin Twisted server

    @copyright: 2004-2005 Thomas Waldmann, Nir Soffer
    @license: GNU GPL, see COPYING for details.
"""

# Add the path to mointwisted.py directory 
## import sys
## sys.path.insert(0, '/path/to/mointwisted')

import os

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

from MoinMoin.server import daemon
from mointwisted import Config


class TwistedScript(daemon.DaemonScript):

    def do_start(self):
        """ Override to use twistd daemonizer """
        os.system('twistd --python mointwisted.py --pidfile %s' % self.pidFile)       


script = TwistedScript(Config.name, None)
script.run()