]> git.saurik.com Git - wxWidgets.git/blob - wxPython/samples/ide/activegrid/util/__init__.py
DocView patches from Morgen Hua: bug fixes, and additional SVN
[wxWidgets.git] / wxPython / samples / ide / activegrid / util / __init__.py
1 #----------------------------------------------------------------------------
2 # Name: __init__.py
3 # Purpose: Utilities
4 #
5 # Author: Joel Hare
6 #
7 # Created: 7/28/04
8 # CVS-ID: $Id$
9 # Copyright: (c) 2004-2005 ActiveGrid, Inc.
10 # License: wxWindows License
11 #----------------------------------------------------------------------------
12
13 import traceback
14 import sys
15 import os
16
17 def _registerMainModuleDir():
18 global mainModuleDir
19 if sys.executable.find('python') != -1:
20 utilModuleDir = os.path.dirname(__file__)
21 if not os.path.isabs(utilModuleDir):
22 utilModuleDir = os.path.join(os.getcwd(), utilModuleDir)
23 mainModuleDir = os.path.normpath(os.path.join(utilModuleDir, os.path.join(os.path.pardir, os.path.pardir)))
24 if mainModuleDir.endswith('.zip'):
25 mainModuleDir = os.path.dirname(mainModuleDir) # Get rid of library.zip
26 else:
27 mainModuleDir = os.path.dirname(sys.executable)
28
29 _registerMainModuleDir()