From d32ece04a5304120b8afa014aea92b2a7eb03bc6 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 23 Jun 2013 20:51:17 +0100 Subject: [PATCH] add missing imports --- openlp/core/lib/plugin.py | 10 +++++++--- openlp/core/ui/maindisplay.py | 1 + openlp/core/ui/media/mediaplayer.py | 2 ++ openlp/core/ui/pluginform.py | 1 + openlp/plugins/bibles/forms/editbibleform.py | 1 + openlp/plugins/bibles/lib/http.py | 2 ++ openlp/plugins/songs/forms/songmaintenanceform.py | 1 + 7 files changed, 15 insertions(+), 3 deletions(-) diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index b4f851b24..4a82783e3 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -30,6 +30,7 @@ Provide the generic plugin functionality for OpenLP plugins. """ import logging +import os from PyQt4 import QtCore @@ -424,8 +425,11 @@ class Plugin(QtCore.QObject): """ Adds the openlp to the class dynamically """ - if not hasattr(self, u'_application'): - self._application = Registry().get(u'application') - return self._application + if os.name == u'nt': + Registry().get(u'application') + else: + if not hasattr(self, u'_application'): + self._application = Registry().get(u'application') + return self._application application = property(_get_application) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 74cea4f1f..ee3ddd6b5 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -38,6 +38,7 @@ Some of the code for this form is based on the examples at: from __future__ import division import cgi import logging +import os import sys from PyQt4 import QtCore, QtGui, QtWebKit, QtOpenGL diff --git a/openlp/core/ui/media/mediaplayer.py b/openlp/core/ui/media/mediaplayer.py index d76bbef58..bfa3bb5da 100644 --- a/openlp/core/ui/media/mediaplayer.py +++ b/openlp/core/ui/media/mediaplayer.py @@ -29,6 +29,8 @@ """ The :mod:`~openlp.core.ui.media.mediaplayer` module contains the MediaPlayer class. """ +import os + from openlp.core.lib import Registry from openlp.core.ui.media import MediaState diff --git a/openlp/core/ui/pluginform.py b/openlp/core/ui/pluginform.py index d54bb8b6d..4e766c15b 100644 --- a/openlp/core/ui/pluginform.py +++ b/openlp/core/ui/pluginform.py @@ -30,6 +30,7 @@ The actual plugin view form """ import logging +import os from PyQt4 import QtGui diff --git a/openlp/plugins/bibles/forms/editbibleform.py b/openlp/plugins/bibles/forms/editbibleform.py index 36e41eb51..53ab37e0f 100644 --- a/openlp/plugins/bibles/forms/editbibleform.py +++ b/openlp/plugins/bibles/forms/editbibleform.py @@ -28,6 +28,7 @@ ############################################################################### import logging +import os import re from PyQt4 import QtGui diff --git a/openlp/plugins/bibles/lib/http.py b/openlp/plugins/bibles/lib/http.py index 332194049..7e441becc 100644 --- a/openlp/plugins/bibles/lib/http.py +++ b/openlp/plugins/bibles/lib/http.py @@ -29,6 +29,7 @@ """ The :mod:`http` module enables OpenLP to retrieve scripture from bible websites. """ +import os import logging import re import socket @@ -691,6 +692,7 @@ class HTTPBible(BibleDB): application = property(_get_application) + def get_soup_for_bible_ref(reference_url, header=None, pre_parse_regex=None, pre_parse_substitute=None): """ Gets a webpage and returns a parsed and optionally cleaned soup or None. diff --git a/openlp/plugins/songs/forms/songmaintenanceform.py b/openlp/plugins/songs/forms/songmaintenanceform.py index 9c2d49a5d..ff9e2d562 100644 --- a/openlp/plugins/songs/forms/songmaintenanceform.py +++ b/openlp/plugins/songs/forms/songmaintenanceform.py @@ -27,6 +27,7 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### import logging +import os from PyQt4 import QtGui, QtCore from sqlalchemy.sql import and_