AppLocation.PluginsDir changes

This commit is contained in:
Jon Tibble 2010-03-18 15:43:27 +00:00
parent 93ced465b6
commit fea160c5c4

View File

@ -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):