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

« back to all changes in this revision

Viewing changes to wiki/server/moin_flup_wsgi.py

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2008-06-22 21:17:13 UTC
  • mfrom: (0.9.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080622211713-fpo2zrq3s5dfecxg
Tags: 1.7.0-3
Simplify /etc/moin/wikilist format: "USER URL" (drop unneeded middle
CONFIG_DIR that was wrongly advertised as DATA_DIR).  Make
moin-mass-migrate handle both formats and warn about deprecation of
the old one.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"""
 
2
    MoinMoin - Moin as WSGI application with flup as fcgi gateway
 
3
 
 
4
    @copyright: 2005 by Anakim Border <akborder@gmail.com>,
 
5
                2008 by MoinMoin:ThomasWaldmann
 
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 wikiconfig.py / farmconfig.py is located.
 
20
#     See wiki/config/... for some sample config files.
 
21
#sys.path.insert(0, '/path/to/wikiconfigdir')
 
22
#sys.path.insert(0, '/path/to/farmconfigdir')
 
23
 
 
24
# b) Configuration of moin's logging
 
25
#    If you have set up MOINLOGGINGCONF environment variable, you don't need this!
 
26
#    You also don't need this if you are happy with the builtin defaults.
 
27
#    See wiki/config/logging/... for some sample config files.
 
28
#from MoinMoin import log
 
29
#log.load_config('/path/to/logging_configuration_file')
 
30
 
 
31
# Debug mode - show detailed error reports
 
32
#os.environ['MOIN_DEBUG'] = '1'
 
33
 
 
34
use_threads = True
 
35
unixSocketPath = '/tmp/moin.sock'
 
36
 
 
37
# Set threads flag, so other code can use proper locking
 
38
from MoinMoin import config
 
39
config.use_threads = use_threads
 
40
del config
 
41
 
 
42
from flup.server.fcgi import WSGIServer
 
43
from MoinMoin.server.server_wsgi import moinmoinApp, WsgiConfig
 
44
 
 
45
class Config(WsgiConfig):
 
46
    pass
 
47
 
 
48
config = Config()
 
49
 
 
50
if __name__ == '__main__':
 
51
    server = WSGIServer(moinmoinApp, bindAddress=unixSocketPath)
 
52
    server.run()
 
53
    os.unlink(unixSocketPath)
 
54