Fix IDE path in py2exe

This commit is contained in:
iabdalkader 2014-11-15 08:16:41 +02:00
parent 804c5dc6fe
commit f99ae139ad

View File

@ -21,7 +21,11 @@ except ImportError:
# 2.x name # 2.x name
configparser = __import__("ConfigParser") configparser = __import__("ConfigParser")
IDE_DIR = os.path.dirname(os.path.realpath(__file__)) if hasattr(sys,"frozen") and sys.frozen in ("windows_exe", "console_exe"):
IDE_DIR=os.path.dirname(sys.executable)
else:
IDE_DIR=os.path.dirname(os.path.realpath(__file__))
DATA_DIR = os.path.join(os.path.expanduser("~"), "openmv") #use home dir DATA_DIR = os.path.join(os.path.expanduser("~"), "openmv") #use home dir
SCRIPTS_DIR = os.path.join(DATA_DIR, "scripts") SCRIPTS_DIR = os.path.join(DATA_DIR, "scripts")
EXAMPLES_DIR = os.path.join(IDE_DIR, "examples") EXAMPLES_DIR = os.path.join(IDE_DIR, "examples")