0002142: Patch to const.py.in to enable py2exe
svn: r10693
This commit is contained in:
parent
cad6ff69a6
commit
9fb61bec46
@ -31,6 +31,7 @@ Provides constants for other modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import os
|
||||
import sys
|
||||
from gettext import gettext as _
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@ -94,7 +95,14 @@ else:
|
||||
# this one, and that the plugins directory is in a directory below this.
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
ROOT_DIR = os.path.abspath(os.path.dirname(__file__))
|
||||
# test for sys.frozen to detect a py2exe executable on Windows
|
||||
if hasattr(sys, "frozen"):
|
||||
ROOT_DIR = os.path.abspath(os.path.dirname(
|
||||
unicode(sys.executable, sys.getfilesystemencoding())))
|
||||
else:
|
||||
ROOT_DIR = os.path.abspath(os.path.dirname(
|
||||
unicode(__file__, sys.getfilesystemencoding())))
|
||||
|
||||
IMAGE_DIR = os.path.join(ROOT_DIR, "images")
|
||||
|
||||
CUSTOM_FILTERS = os.path.join(HOME_DIR, "custom_filters.xml")
|
||||
@ -244,3 +252,4 @@ LONGOPTS = [
|
||||
|
||||
SHORTOPTS = "O:i:o:f:a:p:d:lLhu?"
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user