view MoinMoin/web/ @ 4305:c067ef841a5c

Put the inserted path in front (shield against too old versions available in some *nix distributions)
author Florian Krupicka <>
date Thu, 14 Aug 2008 16:13:56 +0200
parents 775e8f24c1b1
children 71af4f379631
line wrap: on
line source
# -*- coding: iso-8859-1 -*-
    MoinMoin - This package contains the interface between webserver
               and application. This is meant to become a replacement
               and/or port of code currently scattered in MoinMoin.request
               and MoinMoin.server.

    @copyright: 2008-2008 MoinMoin:FlorianKrupicka
    @license: GNU GPL, see COPYING for details.

def _fixup_deps():
    Alter the system path to import some 3rd party dependencies from
    inside the package. This is meant for deps
    used inside this package, which are mainly werkzeug and flup.
    import sys, os
    from MoinMoin import support
    dirname = os.path.dirname(support.__file__)
    dirname = os.path.abspath(dirname)
    found = False
    for path in sys.path:
        if os.path.abspath(path) == dirname:
            found = True
    if not found:
        sys.path.insert(0, dirname)

    del _fixup_deps