forked from openlp/openlp
Allow to override data dir for tests
This commit is contained in:
parent
5c13123cef
commit
606e19734c
@ -127,6 +127,9 @@ class AppLocation(object):
|
|||||||
CacheDir = 6
|
CacheDir = 6
|
||||||
LanguageDir = 7
|
LanguageDir = 7
|
||||||
|
|
||||||
|
# Base path where data/config/cache dir is located
|
||||||
|
BaseDir = None
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_directory(dir_type=1):
|
def get_directory(dir_type=1):
|
||||||
"""
|
"""
|
||||||
@ -152,6 +155,8 @@ class AppLocation(object):
|
|||||||
os.path.abspath(os.path.split(sys.argv[0])[0]),
|
os.path.abspath(os.path.split(sys.argv[0])[0]),
|
||||||
_get_os_dir_path(dir_type))
|
_get_os_dir_path(dir_type))
|
||||||
return os.path.join(app_path, u'i18n')
|
return os.path.join(app_path, u'i18n')
|
||||||
|
elif dir_type == AppLocation.DataDir and AppLocation.BaseDir:
|
||||||
|
return os.path.join(AppLocation.BaseDir, 'data')
|
||||||
else:
|
else:
|
||||||
return _get_os_dir_path(dir_type)
|
return _get_os_dir_path(dir_type)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user