Fixed help paths under a windows frozen environment.

This commit is contained in:
Virgil Dupras 2011-11-30 16:36:29 +00:00
parent 66303a2076
commit 28e5924633
2 changed files with 12 additions and 4 deletions

View File

@ -9,9 +9,13 @@
import os.path as op
from hscommon.plat import ISWINDOWS, ISOSX, ISLINUX
# We want to get the absolute path or our root folder. We know that in that folder we're inside
# qt/base, so we just fo back two levels.
BASE_PATH = op.abspath(op.join(op.dirname(__file__), '..', '..'))
if op.exists(__file__):
# We want to get the absolute path or our root folder. We know that in that folder we're
# inside qt/base, so we just fo back two levels.
BASE_PATH = op.abspath(op.join(op.dirname(__file__), '..', '..'))
else:
# We're under a freezed environment. Our base path is ''.
BASE_PATH = ''
HELP_PATH = op.join(BASE_PATH, 'help')
if ISWINDOWS:

View File

@ -29,7 +29,11 @@ if __name__ == "__main__":
QCoreApplication.setApplicationVersion(__version__)
settings = QSettings()
lang = settings.value('Language').toString()
locale_folder = op.join(op.dirname(__file__), 'locale')
try:
locale_folder = op.join(op.dirname(__file__), 'locale')
except NameError:
# We're in a freezed environment (no __file__)
locale_folder = 'locale'
install_gettext_trans_under_qt(locale_folder, lang)
# Many strings are translated at import time, so this is why we only import after the translator
# has been installed