From 8124f0e8fe1f12d2be5b5df82b1ba214696a1e99 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 11 Mar 2010 14:02:43 +0000 Subject: [PATCH 1/5] Import and weird character cleanups --- openlp.pyw | 1 - openlp/core/ui/mainwindow.py | 1 - openlp/core/utils/__init__.py | 2 +- .../hook-openlp.plugins.presentations.presentationplugin.py | 2 +- resources/pyinstaller/hook-openlp.py | 2 +- 5 files changed, 3 insertions(+), 5 deletions(-) diff --git a/openlp.pyw b/openlp.pyw index c4a5fb428..1de9c8417 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -34,7 +34,6 @@ from PyQt4 import QtCore, QtGui log = logging.getLogger() -import openlp from openlp.core.lib import Receiver, str_to_bool from openlp.core.resources import qInitResources from openlp.core.ui import MainWindow, SplashScreen, ScreenList diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 41b6d245f..808c4ad4c 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -23,7 +23,6 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -import os import logging import time diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index 4083300a6..042b8d88e 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -100,4 +100,4 @@ def check_latest_version(config, current_version): from registry import Registry from confighelper import ConfigHelper -__all__ = [u'Registry', u'ConfigHelper', u'AppLocations', u'check_latest_version'] +__all__ = [u'Registry', u'ConfigHelper', u'AppLocation', u'check_latest_version'] diff --git a/resources/pyinstaller/hook-openlp.plugins.presentations.presentationplugin.py b/resources/pyinstaller/hook-openlp.plugins.presentations.presentationplugin.py index 8b7d6b8a2..0ede06f90 100644 --- a/resources/pyinstaller/hook-openlp.plugins.presentations.presentationplugin.py +++ b/resources/pyinstaller/hook-openlp.plugins.presentations.presentationplugin.py @@ -1,3 +1,3 @@ -hiddenimports = ['openlp.plugins.presentations.lib.impresscontroller', +hiddenimports = ['openlp.plugins.presentations.lib.impresscontroller', 'openlp.plugins.presentations.lib.powerpointcontroller', 'openlp.plugins.presentations.lib.pptviewcontroller'] \ No newline at end of file diff --git a/resources/pyinstaller/hook-openlp.py b/resources/pyinstaller/hook-openlp.py index bd97e4aec..b77ec8b62 100644 --- a/resources/pyinstaller/hook-openlp.py +++ b/resources/pyinstaller/hook-openlp.py @@ -1,4 +1,4 @@ -hiddenimports = ['plugins.songs.songsplugin', +hiddenimports = ['plugins.songs.songsplugin', 'plugins.bibles.bibleplugin', 'plugins.presentations.presentationplugin', 'plugins.media.mediaplugin', From a81c39ca659e8692b1e25e3f04beed23c16690ad Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Tue, 16 Mar 2010 21:13:23 +0000 Subject: [PATCH 2/5] Import fix --- openlp/plugins/bibles/lib/manager.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openlp/plugins/bibles/lib/manager.py b/openlp/plugins/bibles/lib/manager.py index 90401a3e1..10ee7b9f9 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -24,7 +24,6 @@ ############################################################################### import logging -import os from common import parse_reference from opensong import OpenSongBible From fea160c5c4a0b89ab6f10f5556a5e14d3965ca7b Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 18 Mar 2010 15:43:27 +0000 Subject: [PATCH 3/5] 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): From 5d2fe81d712cfe34c2d043b5f66d2bf6f7ffe36e Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 18 Mar 2010 15:52:37 +0000 Subject: [PATCH 4/5] Fix for AppLocation changes --- openlp/core/utils/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index 61c38af87..9cd539169 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -81,7 +81,8 @@ class AppLocation(object): elif sys.platform == u'darwin': plugin_path = os.path.join(app_path, u'plugins') else: - plugin_path = os.path.join(openlp.__file__, u'plugins') + plugin_path = os.path.join( + os.path.split(openlp.__file__)[0], u'plugins') return plugin_path From de767459bd4f4594498bbcf18218e46020db723b Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 18 Mar 2010 16:25:25 +0000 Subject: [PATCH 5/5] Fix 2 for AppLocation changes --- openlp/core/utils/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index 9cd539169..3ffb9ee8d 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -23,6 +23,7 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### +import openlp import os import sys import logging