From af6c792354e68cb4c275ced6e4bc31700dcd9a17 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sun, 20 Feb 2011 14:25:14 +0000 Subject: [PATCH 1/7] Cleanups --- openlp/core/ui/printservicedialog.py | 3 ++- openlp/core/ui/printserviceform.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/openlp/core/ui/printservicedialog.py b/openlp/core/ui/printservicedialog.py index ec4e054c3..87a8276f4 100644 --- a/openlp/core/ui/printservicedialog.py +++ b/openlp/core/ui/printservicedialog.py @@ -29,7 +29,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import build_icon, translate, SpellTextEdit from openlp.core.lib.ui import UiStrings -class ZoomSize(): +class ZoomSize(object): """ Type enumeration for Combo Box sizes """ @@ -45,6 +45,7 @@ class ZoomSize(): translate('OpenLP.PrintServiceDialog', 'Fit Width'), u'100%', u'75%', u'50%', u'25%'] + class Ui_PrintServiceDialog(object): def setupUi(self, printServiceDialog): printServiceDialog.setObjectName(u'printServiceDialog') diff --git a/openlp/core/ui/printserviceform.py b/openlp/core/ui/printserviceform.py index 882e39fca..f4ad81884 100644 --- a/openlp/core/ui/printserviceform.py +++ b/openlp/core/ui/printserviceform.py @@ -174,7 +174,7 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): self.previewWidget.zoomIn(0.25) settings = QtCore.QSettings() settings.beginGroup(u'advanced') - settings.setValue(u'display size',QtCore.QVariant(display)) + settings.setValue(u'display size', QtCore.QVariant(display)) settings.endGroup() def copyText(self): From fb120858e01f25822fd636d5d8f2af22fc15849f Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 21 Feb 2011 22:10:08 +0000 Subject: [PATCH 2/7] Cleanups --- openlp/core/ui/displaytagdialog.py | 5 +++-- openlp/core/ui/displaytagform.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/openlp/core/ui/displaytagdialog.py b/openlp/core/ui/displaytagdialog.py index edb8567cf..7e3d21856 100644 --- a/openlp/core/ui/displaytagdialog.py +++ b/openlp/core/ui/displaytagdialog.py @@ -26,7 +26,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate, build_icon +from openlp.core.lib import translate from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box class Ui_DisplayTagDialog(object): @@ -134,7 +134,8 @@ class Ui_DisplayTagDialog(object): self.tagLabel.setText(translate('OpenLP.DisplayTagDialog', 'Tag')) self.startTagLabel.setText( translate('OpenLP.DisplayTagDialog', 'Start tag')) - self.endTagLabel.setText(translate('OpenLP.DisplayTagDialog', 'End tag')) + self.endTagLabel.setText( + translate('OpenLP.DisplayTagDialog', 'End tag')) self.deletePushButton.setText(UiStrings.Delete) self.defaultPushButton.setText( translate('OpenLP.DisplayTagDialog', 'Default')) diff --git a/openlp/core/ui/displaytagform.py b/openlp/core/ui/displaytagform.py index fa05c578a..82f475338 100644 --- a/openlp/core/ui/displaytagform.py +++ b/openlp/core/ui/displaytagform.py @@ -34,7 +34,7 @@ import cPickle from PyQt4 import QtCore, QtGui from openlp.core.lib import translate, DisplayTags -from openlp.core.lib.ui import UiStrings, critical_error_message_box +from openlp.core.lib.ui import critical_error_message_box from openlp.core.ui.displaytagdialog import Ui_DisplayTagDialog class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): From 4d1f1e933ebe11247c478eebbccc55aff76fd75f Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 21 Feb 2011 22:27:27 +0000 Subject: [PATCH 3/7] Make importer inits consistent --- openlp/plugins/songs/lib/oooimport.py | 4 ++-- openlp/plugins/songs/lib/openlyricsimport.py | 6 +++--- openlp/plugins/songs/lib/sofimport.py | 4 ++-- openlp/plugins/songs/lib/songbeamerimport.py | 9 +++------ openlp/plugins/songs/lib/songshowplusimport.py | 9 +++------ openlp/plugins/songs/lib/wowimport.py | 9 +++------ 6 files changed, 16 insertions(+), 25 deletions(-) diff --git a/openlp/plugins/songs/lib/oooimport.py b/openlp/plugins/songs/lib/oooimport.py index 863fec2b8..29ab60a22 100644 --- a/openlp/plugins/songs/lib/oooimport.py +++ b/openlp/plugins/songs/lib/oooimport.py @@ -50,12 +50,12 @@ class OooImport(SongImport): """ Import songs from Impress/Powerpoint docs using Impress """ - def __init__(self, master_manager, **kwargs): + def __init__(self, manager, **kwargs): """ Initialise the class. Requires a songmanager class which is passed to SongImport for writing song to disk """ - SongImport.__init__(self, master_manager, **kwargs) + SongImport.__init__(self, manager, **kwargs) self.document = None self.process_started = False diff --git a/openlp/plugins/songs/lib/openlyricsimport.py b/openlp/plugins/songs/lib/openlyricsimport.py index 0396335b8..6dcb62699 100644 --- a/openlp/plugins/songs/lib/openlyricsimport.py +++ b/openlp/plugins/songs/lib/openlyricsimport.py @@ -43,12 +43,12 @@ class OpenLyricsImport(SongImport): """ This provides the Openlyrics import. """ - def __init__(self, master_manager, **kwargs): + def __init__(self, manager, **kwargs): """ - Initialise the import. + Initialise the Open Lyrics importer. """ log.debug(u'initialise OpenLyricsImport') - SongImport.__init__(self, master_manager, **kwargs) + SongImport.__init__(self, manager, **kwargs) self.openLyrics = OpenLyrics(self.manager) def do_import(self): diff --git a/openlp/plugins/songs/lib/sofimport.py b/openlp/plugins/songs/lib/sofimport.py index cfb80caa3..3f329947e 100644 --- a/openlp/plugins/songs/lib/sofimport.py +++ b/openlp/plugins/songs/lib/sofimport.py @@ -66,12 +66,12 @@ class SofImport(OooImport): It attempts to detect italiced verses, and treats these as choruses in the verse ordering. Again not perfect, but a start. """ - def __init__(self, master_manager, **kwargs): + def __init__(self, manager, **kwargs): """ Initialise the class. Requires a songmanager class which is passed to SongImport for writing song to disk """ - OooImport.__init__(self, master_manager, **kwargs) + OooImport.__init__(self, manager, **kwargs) def process_ooo_document(self): """ diff --git a/openlp/plugins/songs/lib/songbeamerimport.py b/openlp/plugins/songs/lib/songbeamerimport.py index afb9f5646..ccae6a8ea 100644 --- a/openlp/plugins/songs/lib/songbeamerimport.py +++ b/openlp/plugins/songs/lib/songbeamerimport.py @@ -67,14 +67,11 @@ class SongBeamerImport(SongImport): Song Beamer file format is text based in the beginning are one or more control tags written """ - def __init__(self, master_manager, **kwargs): + def __init__(self, manager, **kwargs): """ - Initialise the import. - - ``master_manager`` - The song manager for the running OpenLP installation. + Initialise the Song Beamer importer. """ - SongImport.__init__(self, master_manager, **kwargs) + SongImport.__init__(self, manager, **kwargs) def do_import(self): """ diff --git a/openlp/plugins/songs/lib/songshowplusimport.py b/openlp/plugins/songs/lib/songshowplusimport.py index 74040bcc0..757138966 100644 --- a/openlp/plugins/songs/lib/songshowplusimport.py +++ b/openlp/plugins/songs/lib/songshowplusimport.py @@ -86,14 +86,11 @@ class SongShowPlusImport(SongImport): otherList = {} otherCount = 0 - def __init__(self, master_manager, **kwargs): + def __init__(self, manager, **kwargs): """ - Initialise the import. - - ``master_manager`` - The song manager for the running OpenLP installation. + Initialise the SongShow Plus importer. """ - SongImport.__init__(self, master_manager, **kwargs) + SongImport.__init__(self, manager, **kwargs) def do_import(self): """ diff --git a/openlp/plugins/songs/lib/wowimport.py b/openlp/plugins/songs/lib/wowimport.py index 05c9704f6..5f5f4f289 100644 --- a/openlp/plugins/songs/lib/wowimport.py +++ b/openlp/plugins/songs/lib/wowimport.py @@ -92,14 +92,11 @@ class WowImport(SongImport): * .wow-song """ - def __init__(self, master_manager, **kwargs): + def __init__(self, manager, **kwargs): """ - Initialise the import. - - ``master_manager`` - The song manager for the running OpenLP installation. + Initialise the Words of Worship importer. """ - SongImport.__init__(self, master_manager, **kwargs) + SongImport.__init__(self, manager, **kwargs) def do_import(self): """ From 44a50b035177d10eead3132626ff279fce2d5072 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Tue, 22 Feb 2011 02:30:38 +0000 Subject: [PATCH 4/7] Naming --- openlp/plugins/bibles/lib/manager.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/bibles/lib/manager.py b/openlp/plugins/bibles/lib/manager.py index 85204ac7a..e626462e0 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -40,9 +40,9 @@ from osis import OSISBible # Imports that might fail. try: from openlp1 import OpenLP1Bible - has_openlp1 = True + HAS_OPENLP1 = True except ImportError: - has_openlp1 = False + HAS_OPENLP1 = False log = logging.getLogger(__name__) @@ -367,6 +367,6 @@ class BibleManager(object): for bible in self.db_cache: self.db_cache[bible].finalise() -BibleFormat.set_availability(BibleFormat.OpenLP1, has_openlp1) +BibleFormat.set_availability(BibleFormat.OpenLP1, HAS_OPENLP1) __all__ = [u'BibleFormat'] From cca1064e42b81bdc456a878dfa1d15d9eabd3a70 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 24 Feb 2011 00:11:58 +0000 Subject: [PATCH 5/7] Cleanups --- openlp/plugins/songs/lib/foilpresenterimport.py | 4 +--- openlp/plugins/songs/lib/xml.py | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/openlp/plugins/songs/lib/foilpresenterimport.py b/openlp/plugins/songs/lib/foilpresenterimport.py index 2eded332f..46cf038be 100644 --- a/openlp/plugins/songs/lib/foilpresenterimport.py +++ b/openlp/plugins/songs/lib/foilpresenterimport.py @@ -93,7 +93,6 @@ import os from lxml import etree, objectify -from openlp.core.lib import translate from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib import VerseType from openlp.plugins.songs.lib.songimport import SongImport @@ -411,7 +410,6 @@ class FoilPresenter(object): search_text = u'' temp_verse_order = {} temp_verse_order_backup = [] - temp_verse_sort = [] temp_sortnr_backup = 1 temp_sortnr_liste = [] versenumber = {u'V': 1, u'C': 1, u'B': 1, u'E': 1, u'O': 1, u'I': 1, @@ -454,7 +452,7 @@ class FoilPresenter(object): else: verse_type = u'O' verse_number = re.compile(u'[a-zA-Z.+-_ ]*').sub(u'', verse_name) - verse_part = re.compile(u'[0-9]*').sub(u'', verse_name[1:]) + #verse_part = re.compile(u'[0-9]*').sub(u'', verse_name[1:]) # Foilpresenter allows e. g. "C", but we need "C1". if not verse_number: verse_number = unicode(versenumber[verse_type]) diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index 8f5c35c0a..f2cf4ac03 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -68,7 +68,6 @@ from lxml import etree, objectify from openlp.plugins.songs.lib import add_author_unknown, VerseType from openlp.plugins.songs.lib.db import Author, Book, Song, Topic -from openlp.plugins.songs.lib.ui import SongStrings log = logging.getLogger(__name__) From 3b31186114ba8d2a241f16f89868342795b5e7e5 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 24 Feb 2011 00:32:27 +0000 Subject: [PATCH 6/7] Complete song import init cleanup --- openlp/plugins/songs/lib/foilpresenterimport.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/lib/foilpresenterimport.py b/openlp/plugins/songs/lib/foilpresenterimport.py index 46cf038be..97aac379e 100644 --- a/openlp/plugins/songs/lib/foilpresenterimport.py +++ b/openlp/plugins/songs/lib/foilpresenterimport.py @@ -106,12 +106,12 @@ class FoilPresenterImport(SongImport): """ This provides the Foilpresenter import. """ - def __init__(self, master_manager, **kwargs): + def __init__(self, manager, **kwargs): """ Initialise the import. """ log.debug(u'initialise FoilPresenterImport') - SongImport.__init__(self, master_manager, **kwargs) + SongImport.__init__(self, manager, **kwargs) self.FoilPresenter = FoilPresenter(self.manager) def do_import(self): From 5e2a7e1cde4bb76f567b920bf555d1e9b69072e5 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 24 Feb 2011 02:38:42 +0000 Subject: [PATCH 7/7] Fixes to foilpresenter author handling --- openlp/plugins/songs/lib/foilpresenterimport.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/lib/foilpresenterimport.py b/openlp/plugins/songs/lib/foilpresenterimport.py index 97aac379e..3a6ae1764 100644 --- a/openlp/plugins/songs/lib/foilpresenterimport.py +++ b/openlp/plugins/songs/lib/foilpresenterimport.py @@ -339,7 +339,7 @@ class FoilPresenter(object): elif (len(author) > 2): authors.append(author) if not authors: - authors.append(SongStrings.AuthorUnknownUnT) + authors.append(SongStrings.AuthorUnknown) for display_name in authors: author = self.manager.get_object_filtered(Author, Author.display_name == display_name) @@ -348,7 +348,7 @@ class FoilPresenter(object): author = Author.populate(display_name=display_name, last_name = display_name.split(u' ')[-1], first_name = u' '.join(display_name.split(u' ')[:-1])) - self.manager.save_object(author) + self.manager.save_object(author) song.authors.append(author) def _process_cclinumber(self, foilpresenterfolie, song):