2005-05-04 20:10:29 -04:00
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
# Name: __init__.py
|
|
|
|
# Purpose: Utilities
|
|
|
|
#
|
|
|
|
# Author: Joel Hare
|
|
|
|
#
|
|
|
|
# Created: 7/28/04
|
|
|
|
# CVS-ID: $Id$
|
|
|
|
# Copyright: (c) 2004-2005 ActiveGrid, Inc.
|
|
|
|
# License: wxWindows License
|
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
|
2005-04-08 18:54:02 -04:00
|
|
|
import traceback
|
|
|
|
import sys
|
|
|
|
import os
|
|
|
|
|
2005-05-18 20:21:49 -04:00
|
|
|
def _registerMainModuleDir():
|
|
|
|
global mainModuleDir
|
|
|
|
if sys.executable.find('python') != -1:
|
|
|
|
utilModuleDir = os.path.dirname(__file__)
|
|
|
|
if not os.path.isabs(utilModuleDir):
|
|
|
|
utilModuleDir = os.path.join(os.getcwd(), utilModuleDir)
|
|
|
|
mainModuleDir = os.path.normpath(os.path.join(utilModuleDir, os.path.join(os.path.pardir, os.path.pardir)))
|
2005-05-31 17:41:11 -04:00
|
|
|
if mainModuleDir.endswith('.zip'):
|
|
|
|
mainModuleDir = os.path.dirname(mainModuleDir) # Get rid of library.zip
|
2005-05-18 20:21:49 -04:00
|
|
|
else:
|
|
|
|
mainModuleDir = os.path.dirname(sys.executable)
|
|
|
|
|
|
|
|
_registerMainModuleDir()
|