From fea160c5c4a0b89ab6f10f5556a5e14d3965ca7b Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 18 Mar 2010 15:43:27 +0000 Subject: [PATCH] AppLocation.PluginsDir changes --- openlp/core/utils/__init__.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index 5d97dd8f2..61c38af87 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -43,7 +43,7 @@ class AppLocation(object): @staticmethod def get_directory(dir_type): if dir_type == AppLocation.AppDir: - return os.path.abspath(os.path.split(sys.argv[0])[0]) + return os.path.abspath(os.path.split(sys.argv[0])[0]) elif dir_type == AppLocation.ConfigDir: if sys.platform == u'win32': path = os.path.join(os.getenv(u'APPDATA'), u'openlp') @@ -71,11 +71,18 @@ class AppLocation(object): path = os.path.join(os.getenv(u'HOME'), u'.openlp', u'data') return path elif dir_type == AppLocation.PluginsDir: + plugin_path = None app_path = os.path.abspath(os.path.split(sys.argv[0])[0]) - if hasattr(sys, u'frozen') and sys.frozen == 1: - return os.path.join(app_path, u'plugins') + if sys.platform == u'win32': + if hasattr(sys, u'frozen') and sys.frozen == 1: + plugin_path = os.path.join(app_path, u'plugins') + else: + plugin_path = os.path.join(app_path, u'openlp', u'plugins') + elif sys.platform == u'darwin': + plugin_path = os.path.join(app_path, u'plugins') else: - return os.path.join(app_path, u'openlp', u'plugins') + plugin_path = os.path.join(openlp.__file__, u'plugins') + return plugin_path def check_latest_version(config, current_version):