~ubuntu-branches/ubuntu/natty/moin/natty-updates

« back to all changes in this revision

Viewing changes to wiki/server/mointwisted

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2008-06-22 21:17:13 UTC
  • mto: This revision was merged to the branch mainline in revision 18.
  • Revision ID: james.westby@ubuntu.com-20080622211713-inlv5k4eifxckelr
ImportĀ upstreamĀ versionĀ 1.7.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
"""
 
3
    mointwisted - control MoinMoin Twisted server
 
4
 
 
5
    @copyright: 2004-2005 Thomas Waldmann, Nir Soffer
 
6
    @license: GNU GPL, see COPYING for details.
 
7
"""
 
8
 
 
9
import sys, os
 
10
 
 
11
# a) Configuration of Python's code search path
 
12
#    If you already have set up the PYTHONPATH environment variable for the
 
13
#    stuff you see below, you don't need to do a1) and a2).
 
14
 
 
15
# a1) Path of the directory where the MoinMoin code package is located.
 
16
#     Needed if you installed with --prefix=PREFIX or you didn't use setup.py.
 
17
#sys.path.insert(0, 'PREFIX/lib/python2.3/site-packages')
 
18
 
 
19
# a2) Path of the directory where mointwisted.py is located.
 
20
#sys.path.insert(0, '/path/to/mointwisted')
 
21
 
 
22
# b) Configuration of moin's logging
 
23
#    If you have set up MOINLOGGINGCONF environment variable, you don't need this!
 
24
#    You also don't need this if you are happy with the builtin defaults.
 
25
#    See wiki/config/logging/... for some sample config files.
 
26
#from MoinMoin import log
 
27
#log.load_config('/path/to/logging_configuration_file')
 
28
 
 
29
# Debug mode - show detailed error reports
 
30
#os.environ['MOIN_DEBUG'] = '1'
 
31
 
 
32
 
 
33
from MoinMoin.server import daemon
 
34
from mointwisted import Config
 
35
 
 
36
 
 
37
class TwistedScript(daemon.DaemonScript):
 
38
 
 
39
    def do_start(self):
 
40
        """ Override to use twistd daemonizer """
 
41
        os.system('twistd --python mointwisted.py --pidfile %s' % self.pidFile)
 
42
 
 
43
 
 
44
script = TwistedScript(Config.name, None)
 
45
script.run()
 
46