openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #06177
[Merge] lp:~meths/openlp/trivialfixes into lp:openlp
Jon Tibble has proposed merging lp:~meths/openlp/trivialfixes into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
For more details, see:
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/49440
Fix my bad with the data dirs.
--
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/49440
Your team OpenLP Core is requested to review the proposed merge of lp:~meths/openlp/trivialfixes into lp:openlp.
=== modified file 'openlp/core/utils/__init__.py'
--- openlp/core/utils/__init__.py 2011-02-10 05:56:34 +0000
+++ openlp/core/utils/__init__.py 2011-02-11 17:59:55 +0000
@@ -165,6 +165,8 @@
Return a path based on which OS and environment we are running in.
"""
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')
elif sys.platform == u'darwin':
if dir_type == AppLocation.DataDir:
@@ -177,11 +179,13 @@
if dir_type == AppLocation.ConfigDir:
return os.path.join(BaseDirectory.xdg_config_home, u'openlp')
elif dir_type == AppLocation.DataDir:
- return os.path.join(BaseDirectory.xdg_data_home, u'openlp')
+ return os.path.join(BaseDirectory.xdg_data_home, u'openlp',
+ u'data')
elif dir_type == AppLocation.CacheDir:
return os.path.join(BaseDirectory.xdg_cache_home, u'openlp')
- else:
- return os.path.join(os.getenv(u'HOME'), u'.openlp')
+ if dir_type == AppLocation.DataDir:
+ return os.path.join(os.getenv(u'HOME'), u'openlp', u'data')
+ return os.path.join(os.getenv(u'HOME'), u'.openlp')
def _get_frozen_path(frozen_option, non_frozen_option):
"""
@@ -189,8 +193,7 @@
"""
if hasattr(sys, u'frozen') and sys.frozen == 1:
return frozen_option
- else:
- return non_frozen_option
+ return non_frozen_option
def check_latest_version(current_version):
"""
Follow ups