~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Jelmer Vernooij
  • Date: 2009-06-02 22:13:32 UTC
  • mto: This revision was merged to the branch mainline in revision 360.
  • Revision ID: jelmer@samba.org-20090602221332-cxt0pmw8z1a4alzv
Avoid diluting sys.path if loggerhead is installed systemwide.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
 
59
59
    def serve_http(transport, host=None, port=None, inet=None):
60
60
        # loggerhead internal code will try to 'import loggerhead', so
61
 
        # let's put it on the path
62
 
        import os.path, sys
63
 
        sys.path.append(os.path.dirname(__file__))
 
61
        # let's put it on the path if we can't find it in the existing path
 
62
        try:
 
63
            import loggerhead
 
64
        except ImportError:
 
65
            import os.path, sys
 
66
            sys.path.append(os.path.dirname(__file__))
64
67
 
65
68
        from loggerhead.apps.transport import BranchesFromTransportRoot
66
69
        from loggerhead.config import LoggerheadConfig