Back to index

moin  1.9.0~rc2
__init__.py
Go to the documentation of this file.
00001 # -*- coding: iso-8859-1 -*-
00002 """
00003     MoinMoin - Low-level interface code between the wiki and the web
00004 
00005     This package contains everything related to interfacing the wiki with
00006     the actual request from the web. It replaces the former packages
00007     `MoinMoin.request` and `MoinMoin.server`. There is code for convenient
00008     access to the supplied request parameters (using the werkzeug library),
00009     wrappers (called contexts) that try to capture the use of the former
00010     Request-objects in MoinMoin, session handling and interfaces to
00011     common webserver deployment methods.
00012 
00013     @copyright: 2008-2008 MoinMoin:FlorianKrupicka
00014     @license: GNU GPL, see COPYING for details.
00015 """
00016 
00017 def _fixup_deps():
00018     """
00019     Alter the system path to import some 3rd party dependencies from
00020     inside the MoinMoin.support package. This is meant for deps
00021     used inside this package, which are mainly werkzeug and flup.
00022     """
00023     import sys, os
00024     from MoinMoin import support
00025     dirname = os.path.dirname(support.__file__)
00026     dirname = os.path.abspath(dirname)
00027     found = False
00028     for path in sys.path:
00029         if os.path.abspath(path) == dirname:
00030             found = True
00031             break
00032     if not found:
00033         sys.path.insert(0, dirname)
00034 
00035 try:
00036     _fixup_deps()
00037 finally:
00038     del _fixup_deps