Change to absolute paths in const.py

svn: r21033
This commit is contained in:
Nick Hall 2013-01-08 17:26:44 +00:00
parent 6bf8994fbb
commit fd227ef251
2 changed files with 16 additions and 15 deletions

View File

@ -199,17 +199,10 @@ else:
# Paths to data files. # Paths to data files.
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
SHARE_DIR = "@SHARE_DIR@"
LOCALE_DIR = "@LOCALE_DIR@" LOCALE_DIR = "@LOCALE_DIR@"
DATA_DIR = "@DATA_DIR@"
if SHARE_DIR != '': IMAGE_DIR = "@IMAGE_DIR@"
DATA_DIR = os.path.join(SHARE_DIR, 'gramps') DOC_DIR = "@DOC_DIR@"
IMAGE_DIR = os.path.join(SHARE_DIR, 'gramps', 'icons', 'hicolor')
DOC_DIR = os.path.join(SHARE_DIR, 'doc', 'gramps')
else:
DATA_DIR = 'data'
IMAGE_DIR = 'images'
DOC_DIR = os.curdir
TIP_DATA = os.path.join(DATA_DIR, "tips.xml") TIP_DATA = os.path.join(DATA_DIR, "tips.xml")
PAPERSIZE = os.path.join(DATA_DIR, "papersize.xml") PAPERSIZE = os.path.join(DATA_DIR, "papersize.xml")

View File

@ -242,18 +242,26 @@ def write_const_py(command):
if hasattr(command, 'install_data'): if hasattr(command, 'install_data'):
#during install #during install
share_dir = os.path.join(command.install_data, 'share') share_dir = os.path.join(command.install_data, 'share')
locale_dir = os.path.join(command.install_data, 'share', 'locale') locale_dir = os.path.join(share_dir, 'locale')
data_dir = os.path.join(share_dir, 'gramps')
image_dir = os.path.join(share_dir, 'gramps', 'icons', 'hicolor')
doc_dir = os.path.join(share_dir, 'doc', 'gramps')
else: else:
#in build #in build
if 'install' in command.distribution.command_obj: if 'install' in command.distribution.command_obj:
# Prevent overwriting version created during install # Prevent overwriting version created during install
return return
share_dir = '' base_dir = os.path.abspath(os.path.dirname(__file__))
locale_dir = os.path.join(command.build_base, 'mo') locale_dir = os.path.abspath(os.path.join(command.build_base, 'mo'))
data_dir = os.path.join(base_dir, 'data')
image_dir = os.path.join(base_dir, 'images')
doc_dir = base_dir
subst_vars = (('@VERSIONSTRING@', VERSION), subst_vars = (('@VERSIONSTRING@', VERSION),
('@SHARE_DIR@', share_dir), ('@LOCALE_DIR@', locale_dir),
('@LOCALE_DIR@', locale_dir)) ('@DATA_DIR@', data_dir),
('@IMAGE_DIR@', image_dir),
('@DOC_DIR@', doc_dir),)
substitute_variables(const_py_in, const_py, subst_vars) substitute_variables(const_py_in, const_py, subst_vars)