Fixes and cleanups

bzr-revno: 1329
This commit is contained in:
Jon Tibble 2011-02-24 14:36:33 +00:00
commit 3526e8c7a1
13 changed files with 31 additions and 41 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -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']

View File

@ -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
@ -107,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):
@ -340,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)
@ -349,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):
@ -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])

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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