Fix Windows data dir

This commit is contained in:
Jon Tibble 2011-02-11 17:50:34 +00:00
parent 186eec0eb3
commit dd62045678

View File

@ -165,6 +165,8 @@ def _get_os_dir_path(dir_type):
Return a path based on which OS and environment we are running in. Return a path based on which OS and environment we are running in.
""" """
if sys.platform == u'win32': if sys.platform == u'win32':
if dir_type == AppLocation.DataDir:
return os.path.join(os.getenv(u'APPDATA'), u'openlp', u'data')
return os.path.join(os.getenv(u'APPDATA'), u'openlp') return os.path.join(os.getenv(u'APPDATA'), u'openlp')
elif sys.platform == u'darwin': elif sys.platform == u'darwin':
if dir_type == AppLocation.DataDir: if dir_type == AppLocation.DataDir:
@ -180,8 +182,7 @@ def _get_os_dir_path(dir_type):
return os.path.join(BaseDirectory.xdg_data_home, u'openlp') return os.path.join(BaseDirectory.xdg_data_home, u'openlp')
elif dir_type == AppLocation.CacheDir: elif dir_type == AppLocation.CacheDir:
return os.path.join(BaseDirectory.xdg_cache_home, u'openlp') return os.path.join(BaseDirectory.xdg_cache_home, u'openlp')
else: return os.path.join(os.getenv(u'HOME'), u'.openlp')
return os.path.join(os.getenv(u'HOME'), u'.openlp')
def _get_frozen_path(frozen_option, non_frozen_option): def _get_frozen_path(frozen_option, non_frozen_option):
""" """
@ -189,8 +190,7 @@ def _get_frozen_path(frozen_option, non_frozen_option):
""" """
if hasattr(sys, u'frozen') and sys.frozen == 1: if hasattr(sys, u'frozen') and sys.frozen == 1:
return frozen_option return frozen_option
else: return non_frozen_option
return non_frozen_option
def check_latest_version(current_version): def check_latest_version(current_version):
""" """