AppLocation.PluginsDir changes

bzr-revno: 746
This commit is contained in:
Jon Tibble 2010-03-18 17:59:46 +00:00
commit 7f5862e9c2
1 changed files with 13 additions and 4 deletions

View File

@ -23,6 +23,7 @@
# Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Temple Place, Suite 330, Boston, MA 02111-1307 USA #
############################################################################### ###############################################################################
import openlp
import os import os
import sys import sys
import logging import logging
@ -71,11 +72,19 @@ class AppLocation(object):
path = os.path.join(os.getenv(u'HOME'), u'.openlp', u'data') path = os.path.join(os.getenv(u'HOME'), u'.openlp', u'data')
return path return path
elif dir_type == AppLocation.PluginsDir: elif dir_type == AppLocation.PluginsDir:
plugin_path = None
app_path = os.path.abspath(os.path.split(sys.argv[0])[0]) app_path = os.path.abspath(os.path.split(sys.argv[0])[0])
if sys.platform == u'win32':
if hasattr(sys, u'frozen') and sys.frozen == 1: if hasattr(sys, u'frozen') and sys.frozen == 1:
return os.path.join(app_path, u'plugins') plugin_path = os.path.join(app_path, u'plugins')
else: else:
return os.path.join(app_path, u'openlp', u'plugins') 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:
plugin_path = os.path.join(
os.path.split(openlp.__file__)[0], u'plugins')
return plugin_path
def check_latest_version(config, current_version): def check_latest_version(config, current_version):