1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2024-10-31 22:05:58 +00:00

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 import os.path as op
from hscommon.plat import ISWINDOWS, ISOSX, ISLINUX 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 if op.exists(__file__):
# qt/base, so we just fo back two levels. # We want to get the absolute path or our root folder. We know that in that folder we're
BASE_PATH = op.abspath(op.join(op.dirname(__file__), '..', '..')) # 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') HELP_PATH = op.join(BASE_PATH, 'help')
if ISWINDOWS: if ISWINDOWS:

View File

@ -29,7 +29,11 @@ if __name__ == "__main__":
QCoreApplication.setApplicationVersion(__version__) QCoreApplication.setApplicationVersion(__version__)
settings = QSettings() settings = QSettings()
lang = settings.value('Language').toString() 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) 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 # Many strings are translated at import time, so this is why we only import after the translator
# has been installed # has been installed