Package trac ::
Package web
1 # Workaround for http://bugs.python.org/issue6763 and
2 # http://bugs.python.org/issue5853 thread issues
3 import mimetypes
4 mimetypes.init ()
5
6 # With mod_python we'll have to delay importing trac.web.api until
7 # modpython_frontend.handler() has been called since the
8 # PYTHON_EGG_CACHE variable is set from there
9 #
10 # TODO: Remove this once the Genshi zip_safe issue has been resolved.
11
12 import os
13 from pkg_resources import get_distribution
14 if not os.path .isdir (get_distribution('genshi').location):
15 try:
16 import mod_python.apache
17 import sys
18 if 'trac.web.modpython_frontend' in sys.modules:
19 from trac .web .api import *
20 except ImportError:
21 from trac .web .api import *
22 else:
23 from trac .web .api import *
24