forked from openlp/openlp
whitespaces
This commit is contained in:
parent
78a752b77c
commit
d9768b6536
@ -300,13 +300,13 @@ def mailto(address, to=None, cc=None, bcc=None, subject=None, body=None,
|
|||||||
``cc``
|
``cc``
|
||||||
specify a recipient to be copied on the e-mail
|
specify a recipient to be copied on the e-mail
|
||||||
|
|
||||||
``bcc``
|
``bcc``
|
||||||
specify a recipient to be blindly copied on the e-mail
|
specify a recipient to be blindly copied on the e-mail
|
||||||
|
|
||||||
``subject``
|
``subject``
|
||||||
specify a subject for the e-mail
|
specify a subject for the e-mail
|
||||||
|
|
||||||
``body``
|
``body``
|
||||||
specify a body for the e-mail. Since the user will be able to make
|
specify a body for the e-mail. Since the user will be able to make
|
||||||
changes before actually sending the e-mail, this can be used to provide
|
changes before actually sending the e-mail, this can be used to provide
|
||||||
the user with a template for the e-mail text may contain linebreaks
|
the user with a template for the e-mail text may contain linebreaks
|
||||||
|
@ -70,7 +70,7 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog):
|
|||||||
|
|
||||||
def _createReport(self):
|
def _createReport(self):
|
||||||
openlp_version = self.parent().applicationVersion[u'full']
|
openlp_version = self.parent().applicationVersion[u'full']
|
||||||
traceback = unicode(self.exceptionTextEdit.toPlainText())
|
traceback = unicode(self.exceptionTextEdit.toPlainText())
|
||||||
system = unicode(translate('OpenLP.ExceptionForm',
|
system = unicode(translate('OpenLP.ExceptionForm',
|
||||||
'Platform: %s\n')) % platform.platform()
|
'Platform: %s\n')) % platform.platform()
|
||||||
libraries = u'Python: %s\n' % platform.python_version() + \
|
libraries = u'Python: %s\n' % platform.python_version() + \
|
||||||
@ -89,7 +89,7 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog):
|
|||||||
elif os.environ.get(u'GNOME_DESKTOP_SESSION_ID'):
|
elif os.environ.get(u'GNOME_DESKTOP_SESSION_ID'):
|
||||||
system = system + u'Desktop: GNOME\n'
|
system = system + u'Desktop: GNOME\n'
|
||||||
return (openlp_version, traceback, system, libraries)
|
return (openlp_version, traceback, system, libraries)
|
||||||
|
|
||||||
def onSaveReportButtonPressed(self):
|
def onSaveReportButtonPressed(self):
|
||||||
"""
|
"""
|
||||||
Saving exception log and system informations to a file.
|
Saving exception log and system informations to a file.
|
||||||
|
@ -875,7 +875,7 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
old_second_bible = self._decodeQtObject(old_bitem, 'second_bible')
|
old_second_bible = self._decodeQtObject(old_bitem, 'second_bible')
|
||||||
if old_bible != bible or old_second_bible != second_bible or \
|
if old_bible != bible or old_second_bible != second_bible or \
|
||||||
old_book != book:
|
old_book != book:
|
||||||
# The bible, second bible or book has changed.
|
# The bible, second bible or book has changed.
|
||||||
return True
|
return True
|
||||||
elif old_verse + 1 != verse and old_chapter == chapter:
|
elif old_verse + 1 != verse and old_chapter == chapter:
|
||||||
# We are still in the same chapter, but a verse has been skipped.
|
# We are still in the same chapter, but a verse has been skipped.
|
||||||
|
@ -75,42 +75,42 @@ class ImagePlugin(Plugin):
|
|||||||
## Load Button ##
|
## Load Button ##
|
||||||
self.textStrings[StringContent.Load] = {
|
self.textStrings[StringContent.Load] = {
|
||||||
u'title': translate('ImagePlugin', 'Load'),
|
u'title': translate('ImagePlugin', 'Load'),
|
||||||
u'tooltip': translate('ImagePlugin',
|
u'tooltip': translate('ImagePlugin',
|
||||||
'Load a new Image')
|
'Load a new Image')
|
||||||
}
|
}
|
||||||
## New Button ##
|
## New Button ##
|
||||||
self.textStrings[StringContent.New] = {
|
self.textStrings[StringContent.New] = {
|
||||||
u'title': translate('ImagePlugin', 'Add'),
|
u'title': translate('ImagePlugin', 'Add'),
|
||||||
u'tooltip': translate('ImagePlugin',
|
u'tooltip': translate('ImagePlugin',
|
||||||
'Add a new Image')
|
'Add a new Image')
|
||||||
}
|
}
|
||||||
## Edit Button ##
|
## Edit Button ##
|
||||||
self.textStrings[StringContent.Edit] = {
|
self.textStrings[StringContent.Edit] = {
|
||||||
u'title': translate('ImagePlugin', 'Edit'),
|
u'title': translate('ImagePlugin', 'Edit'),
|
||||||
u'tooltip': translate('ImagePlugin',
|
u'tooltip': translate('ImagePlugin',
|
||||||
'Edit the selected Image')
|
'Edit the selected Image')
|
||||||
}
|
}
|
||||||
## Delete Button ##
|
## Delete Button ##
|
||||||
self.textStrings[StringContent.Delete] = {
|
self.textStrings[StringContent.Delete] = {
|
||||||
u'title': translate('ImagePlugin', 'Delete'),
|
u'title': translate('ImagePlugin', 'Delete'),
|
||||||
u'tooltip': translate('ImagePlugin',
|
u'tooltip': translate('ImagePlugin',
|
||||||
'Delete the selected Image')
|
'Delete the selected Image')
|
||||||
}
|
}
|
||||||
## Preview ##
|
## Preview ##
|
||||||
self.textStrings[StringContent.Preview] = {
|
self.textStrings[StringContent.Preview] = {
|
||||||
u'title': translate('ImagePlugin', 'Preview'),
|
u'title': translate('ImagePlugin', 'Preview'),
|
||||||
u'tooltip': translate('ImagePlugin',
|
u'tooltip': translate('ImagePlugin',
|
||||||
'Preview the selected Image')
|
'Preview the selected Image')
|
||||||
}
|
}
|
||||||
## Live Button ##
|
## Live Button ##
|
||||||
self.textStrings[StringContent.Live] = {
|
self.textStrings[StringContent.Live] = {
|
||||||
u'title': translate('ImagePlugin', 'Live'),
|
u'title': translate('ImagePlugin', 'Live'),
|
||||||
u'tooltip': translate('ImagePlugin',
|
u'tooltip': translate('ImagePlugin',
|
||||||
'Send the selected Image live')
|
'Send the selected Image live')
|
||||||
}
|
}
|
||||||
## Add to service Button ##
|
## Add to service Button ##
|
||||||
self.textStrings[StringContent.Service] = {
|
self.textStrings[StringContent.Service] = {
|
||||||
u'title': translate('ImagePlugin', 'Service'),
|
u'title': translate('ImagePlugin', 'Service'),
|
||||||
u'tooltip': translate('ImagePlugin',
|
u'tooltip': translate('ImagePlugin',
|
||||||
'Add the selected Image to the service')
|
'Add the selected Image to the service')
|
||||||
}
|
}
|
@ -48,7 +48,7 @@ else:
|
|||||||
uno_available = True
|
uno_available = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
uno_available = False
|
uno_available = False
|
||||||
|
|
||||||
from PyQt4 import QtCore
|
from PyQt4 import QtCore
|
||||||
|
|
||||||
from presentationcontroller import PresentationController, PresentationDocument
|
from presentationcontroller import PresentationController, PresentationDocument
|
||||||
@ -210,12 +210,12 @@ class ImpressController(PresentationController):
|
|||||||
class ImpressDocument(PresentationDocument):
|
class ImpressDocument(PresentationDocument):
|
||||||
"""
|
"""
|
||||||
Class which holds information and controls a single presentation
|
Class which holds information and controls a single presentation
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, controller, presentation):
|
def __init__(self, controller, presentation):
|
||||||
"""
|
"""
|
||||||
Constructor, store information about the file and initialise
|
Constructor, store information about the file and initialise
|
||||||
"""
|
"""
|
||||||
log.debug(u'Init Presentation OpenOffice')
|
log.debug(u'Init Presentation OpenOffice')
|
||||||
PresentationDocument.__init__(self, controller, presentation)
|
PresentationDocument.__init__(self, controller, presentation)
|
||||||
self.document = None
|
self.document = None
|
||||||
@ -287,7 +287,7 @@ class ImpressDocument(PresentationDocument):
|
|||||||
page = pages.getByIndex(idx)
|
page = pages.getByIndex(idx)
|
||||||
doc.getCurrentController().setCurrentPage(page)
|
doc.getCurrentController().setCurrentPage(page)
|
||||||
urlpath = u'%s/%s.png' % (thumbdirurl, unicode(idx + 1))
|
urlpath = u'%s/%s.png' % (thumbdirurl, unicode(idx + 1))
|
||||||
path = os.path.join(self.get_temp_folder(),
|
path = os.path.join(self.get_temp_folder(),
|
||||||
unicode(idx + 1) + u'.png')
|
unicode(idx + 1) + u'.png')
|
||||||
try:
|
try:
|
||||||
doc.storeToURL(urlpath, props)
|
doc.storeToURL(urlpath, props)
|
||||||
|
@ -51,7 +51,7 @@ class Controller(object):
|
|||||||
|
|
||||||
def add_handler(self, controller, file, is_blank):
|
def add_handler(self, controller, file, is_blank):
|
||||||
"""
|
"""
|
||||||
Add a handler, which is an instance of a presentation and
|
Add a handler, which is an instance of a presentation and
|
||||||
slidecontroller combination. If the slidecontroller has a display
|
slidecontroller combination. If the slidecontroller has a display
|
||||||
then load the presentation.
|
then load the presentation.
|
||||||
"""
|
"""
|
||||||
@ -362,7 +362,7 @@ class MessageListener(object):
|
|||||||
|
|
||||||
def timeout(self):
|
def timeout(self):
|
||||||
"""
|
"""
|
||||||
The presentation may be timed or might be controlled by the
|
The presentation may be timed or might be controlled by the
|
||||||
application directly, rather than through OpenLP. Poll occassionally
|
application directly, rather than through OpenLP. Poll occassionally
|
||||||
to check which slide is currently displayed so the slidecontroller
|
to check which slide is currently displayed so the slidecontroller
|
||||||
view can be updated
|
view can be updated
|
||||||
|
@ -108,7 +108,7 @@ class PptviewDocument(PresentationDocument):
|
|||||||
"""
|
"""
|
||||||
def __init__(self, controller, presentation):
|
def __init__(self, controller, presentation):
|
||||||
"""
|
"""
|
||||||
Constructor, store information about the file and initialise
|
Constructor, store information about the file and initialise
|
||||||
"""
|
"""
|
||||||
log.debug(u'Init Presentation PowerPoint')
|
log.debug(u'Init Presentation PowerPoint')
|
||||||
PresentationDocument.__init__(self, controller, presentation)
|
PresentationDocument.__init__(self, controller, presentation)
|
||||||
|
@ -133,7 +133,7 @@ class PresentationTab(SettingsTab):
|
|||||||
self.settingsSection + u'/' + controller.name,
|
self.settingsSection + u'/' + controller.name,
|
||||||
QtCore.QVariant(QtCore.Qt.Checked)).toInt()[0])
|
QtCore.QVariant(QtCore.Qt.Checked)).toInt()[0])
|
||||||
self.OverrideAppCheckBox.setChecked(QtCore.QSettings().value(
|
self.OverrideAppCheckBox.setChecked(QtCore.QSettings().value(
|
||||||
self.settingsSection + u'/override app',
|
self.settingsSection + u'/override app',
|
||||||
QtCore.QVariant(QtCore.Qt.Unchecked)).toInt()[0])
|
QtCore.QVariant(QtCore.Qt.Unchecked)).toInt()[0])
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
|
@ -163,30 +163,30 @@ class PresentationPlugin(Plugin):
|
|||||||
## Load Button ##
|
## Load Button ##
|
||||||
self.textStrings[StringContent.Load] = {
|
self.textStrings[StringContent.Load] = {
|
||||||
u'title': translate('PresentationPlugin', 'Load'),
|
u'title': translate('PresentationPlugin', 'Load'),
|
||||||
u'tooltip': translate('PresentationPlugin',
|
u'tooltip': translate('PresentationPlugin',
|
||||||
'Load a new Presentation')
|
'Load a new Presentation')
|
||||||
}
|
}
|
||||||
## Delete Button ##
|
## Delete Button ##
|
||||||
self.textStrings[StringContent.Delete] = {
|
self.textStrings[StringContent.Delete] = {
|
||||||
u'title': translate('PresentationPlugin', 'Delete'),
|
u'title': translate('PresentationPlugin', 'Delete'),
|
||||||
u'tooltip': translate('PresentationPlugin',
|
u'tooltip': translate('PresentationPlugin',
|
||||||
'Delete the selected Presentation')
|
'Delete the selected Presentation')
|
||||||
}
|
}
|
||||||
## Preview ##
|
## Preview ##
|
||||||
self.textStrings[StringContent.Preview] = {
|
self.textStrings[StringContent.Preview] = {
|
||||||
u'title': translate('PresentationPlugin', 'Preview'),
|
u'title': translate('PresentationPlugin', 'Preview'),
|
||||||
u'tooltip': translate('PresentationPlugin',
|
u'tooltip': translate('PresentationPlugin',
|
||||||
'Preview the selected Presentation')
|
'Preview the selected Presentation')
|
||||||
}
|
}
|
||||||
## Live Button ##
|
## Live Button ##
|
||||||
self.textStrings[StringContent.Live] = {
|
self.textStrings[StringContent.Live] = {
|
||||||
u'title': translate('PresentationPlugin', 'Live'),
|
u'title': translate('PresentationPlugin', 'Live'),
|
||||||
u'tooltip': translate('PresentationPlugin',
|
u'tooltip': translate('PresentationPlugin',
|
||||||
'Send the selected Presentation live')
|
'Send the selected Presentation live')
|
||||||
}
|
}
|
||||||
## Add to service Button ##
|
## Add to service Button ##
|
||||||
self.textStrings[StringContent.Service] = {
|
self.textStrings[StringContent.Service] = {
|
||||||
u'title': translate('PresentationPlugin', 'Service'),
|
u'title': translate('PresentationPlugin', 'Service'),
|
||||||
u'tooltip': translate('PresentationPlugin',
|
u'tooltip': translate('PresentationPlugin',
|
||||||
'Add the selected Presentation to the service')
|
'Add the selected Presentation to the service')
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ class RemotesPlugin(Plugin):
|
|||||||
'a running version of OpenLP on a different computer via a web '
|
'a running version of OpenLP on a different computer via a web '
|
||||||
'browser or through the remote API.')
|
'browser or through the remote API.')
|
||||||
return about_text
|
return about_text
|
||||||
|
|
||||||
def setPluginTextStrings(self):
|
def setPluginTextStrings(self):
|
||||||
"""
|
"""
|
||||||
Called to define all translatable texts of the plugin
|
Called to define all translatable texts of the plugin
|
||||||
|
@ -411,7 +411,7 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
|
|||||||
"""
|
"""
|
||||||
existing_author = self.manager.get_object_filtered(Author,
|
existing_author = self.manager.get_object_filtered(Author,
|
||||||
and_(Author.first_name == old_author.first_name,
|
and_(Author.first_name == old_author.first_name,
|
||||||
Author.last_name == old_author.last_name,
|
Author.last_name == old_author.last_name,
|
||||||
Author.display_name == old_author.display_name))
|
Author.display_name == old_author.display_name))
|
||||||
songs = self.manager.get_all_objects(Song,
|
songs = self.manager.get_all_objects(Song,
|
||||||
Song.authors.contains(old_author))
|
Song.authors.contains(old_author))
|
||||||
|
@ -41,7 +41,7 @@ def strip_rtf(blob, encoding):
|
|||||||
control_word = []
|
control_word = []
|
||||||
for c in blob:
|
for c in blob:
|
||||||
if control:
|
if control:
|
||||||
# for delimiters, set control to False
|
# for delimiters, set control to False
|
||||||
if c == '{':
|
if c == '{':
|
||||||
if len(control_word) > 0:
|
if len(control_word) > 0:
|
||||||
depth += 1
|
depth += 1
|
||||||
|
@ -46,7 +46,7 @@ else:
|
|||||||
|
|
||||||
class OooImport(SongImport):
|
class OooImport(SongImport):
|
||||||
"""
|
"""
|
||||||
Import songs from Impress/Powerpoint docs using Impress
|
Import songs from Impress/Powerpoint docs using Impress
|
||||||
"""
|
"""
|
||||||
def __init__(self, master_manager, **kwargs):
|
def __init__(self, master_manager, **kwargs):
|
||||||
"""
|
"""
|
||||||
@ -122,7 +122,7 @@ class OooImport(SongImport):
|
|||||||
manager = ctx.ServiceManager
|
manager = ctx.ServiceManager
|
||||||
self.desktop = manager.createInstanceWithContext(
|
self.desktop = manager.createInstanceWithContext(
|
||||||
"com.sun.star.frame.Desktop", ctx)
|
"com.sun.star.frame.Desktop", ctx)
|
||||||
|
|
||||||
def start_ooo_process(self):
|
def start_ooo_process(self):
|
||||||
try:
|
try:
|
||||||
if os.name == u'nt':
|
if os.name == u'nt':
|
||||||
@ -168,11 +168,11 @@ class OooImport(SongImport):
|
|||||||
u'Processing file ' + filepath, 0)
|
u'Processing file ' + filepath, 0)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
return
|
return
|
||||||
|
|
||||||
def close_ooo_file(self):
|
def close_ooo_file(self):
|
||||||
"""
|
"""
|
||||||
Close file.
|
Close file.
|
||||||
"""
|
"""
|
||||||
self.document.close(True)
|
self.document.close(True)
|
||||||
self.document = None
|
self.document = None
|
||||||
@ -187,7 +187,7 @@ class OooImport(SongImport):
|
|||||||
def process_pres(self):
|
def process_pres(self):
|
||||||
"""
|
"""
|
||||||
Process the file
|
Process the file
|
||||||
"""
|
"""
|
||||||
doc = self.document
|
doc = self.document
|
||||||
slides = doc.getDrawPages()
|
slides = doc.getDrawPages()
|
||||||
text = u''
|
text = u''
|
||||||
@ -195,7 +195,7 @@ class OooImport(SongImport):
|
|||||||
if self.abort:
|
if self.abort:
|
||||||
self.import_wizard.incrementProgressBar(u'Import cancelled', 0)
|
self.import_wizard.incrementProgressBar(u'Import cancelled', 0)
|
||||||
return
|
return
|
||||||
slide = slides.getByIndex(slide_no)
|
slide = slides.getByIndex(slide_no)
|
||||||
slidetext = u''
|
slidetext = u''
|
||||||
for idx in range(slide.getCount()):
|
for idx in range(slide.getCount()):
|
||||||
shape = slide.getByIndex(idx)
|
shape = slide.getByIndex(idx)
|
||||||
@ -209,12 +209,12 @@ class OooImport(SongImport):
|
|||||||
songs = SongImport.process_songs_text(self.manager, text)
|
songs = SongImport.process_songs_text(self.manager, text)
|
||||||
for song in songs:
|
for song in songs:
|
||||||
song.finish()
|
song.finish()
|
||||||
return
|
return
|
||||||
|
|
||||||
def process_doc(self):
|
def process_doc(self):
|
||||||
"""
|
"""
|
||||||
Process the doc file, a paragraph at a time
|
Process the doc file, a paragraph at a time
|
||||||
"""
|
"""
|
||||||
text = u''
|
text = u''
|
||||||
paragraphs = self.document.getText().createEnumeration()
|
paragraphs = self.document.getText().createEnumeration()
|
||||||
while paragraphs.hasMoreElements():
|
while paragraphs.hasMoreElements():
|
||||||
|
@ -249,7 +249,7 @@ class OpenSongImport(SongImport):
|
|||||||
words = thisline[1:].strip()
|
words = thisline[1:].strip()
|
||||||
if words is None:
|
if words is None:
|
||||||
words = thisline
|
words = thisline
|
||||||
if not versenum:
|
if not versenum:
|
||||||
versenum = u'1'
|
versenum = u'1'
|
||||||
if versenum is not None:
|
if versenum is not None:
|
||||||
versetag = u'%s%s' % (versetype, versenum)
|
versetag = u'%s%s' % (versetype, versenum)
|
||||||
@ -298,7 +298,7 @@ class OpenSongImport(SongImport):
|
|||||||
for tag in order:
|
for tag in order:
|
||||||
if tag[0].isdigit():
|
if tag[0].isdigit():
|
||||||
# Assume it's a verse if it has no prefix
|
# Assume it's a verse if it has no prefix
|
||||||
tag = u'V' + tag
|
tag = u'V' + tag
|
||||||
elif not re.search('\d+', tag):
|
elif not re.search('\d+', tag):
|
||||||
# Assume it's no.1 if there's no digits
|
# Assume it's no.1 if there's no digits
|
||||||
tag = tag + u'1'
|
tag = tag + u'1'
|
||||||
|
@ -56,13 +56,13 @@ class SofImport(OooImport):
|
|||||||
"""
|
"""
|
||||||
Import songs provided on disks with the Songs of Fellowship music books
|
Import songs provided on disks with the Songs of Fellowship music books
|
||||||
VOLS1_2.RTF, sof3words.rtf and sof4words.rtf
|
VOLS1_2.RTF, sof3words.rtf and sof4words.rtf
|
||||||
|
|
||||||
Use OpenOffice.org Writer for processing the rtf file
|
Use OpenOffice.org Writer for processing the rtf file
|
||||||
|
|
||||||
The three books are not only inconsistant with each other, they are
|
The three books are not only inconsistant with each other, they are
|
||||||
inconsistant in themselves too with their formatting. Not only this, but
|
inconsistant in themselves too with their formatting. Not only this, but
|
||||||
the 1+2 book does not space out verses correctly. This script attempts
|
the 1+2 book does not space out verses correctly. This script attempts
|
||||||
to sort it out, but doesn't get it 100% right. But better than having to
|
to sort it out, but doesn't get it 100% right. But better than having to
|
||||||
type them all out!
|
type them all out!
|
||||||
|
|
||||||
It attempts to detect italiced verses, and treats these as choruses in
|
It attempts to detect italiced verses, and treats these as choruses in
|
||||||
@ -96,7 +96,7 @@ class SofImport(OooImport):
|
|||||||
def process_sof_file(self):
|
def process_sof_file(self):
|
||||||
"""
|
"""
|
||||||
Process the RTF file, a paragraph at a time
|
Process the RTF file, a paragraph at a time
|
||||||
"""
|
"""
|
||||||
self.blanklines = 0
|
self.blanklines = 0
|
||||||
self.new_song()
|
self.new_song()
|
||||||
paragraphs = self.document.getText().createEnumeration()
|
paragraphs = self.document.getText().createEnumeration()
|
||||||
@ -113,11 +113,11 @@ class SofImport(OooImport):
|
|||||||
|
|
||||||
def process_paragraph(self, paragraph):
|
def process_paragraph(self, paragraph):
|
||||||
"""
|
"""
|
||||||
Process a paragraph.
|
Process a paragraph.
|
||||||
In the first book, a paragraph is a single line. In the latter ones
|
In the first book, a paragraph is a single line. In the latter ones
|
||||||
they may contain multiple lines.
|
they may contain multiple lines.
|
||||||
Each paragraph contains textportions. Each textportion has it's own
|
Each paragraph contains textportions. Each textportion has it's own
|
||||||
styling, e.g. italics, bold etc.
|
styling, e.g. italics, bold etc.
|
||||||
Also check for page breaks, which indicates a new song in books 1+2.
|
Also check for page breaks, which indicates a new song in books 1+2.
|
||||||
In later books, there may not be line breaks, so check for 3 or more
|
In later books, there may not be line breaks, so check for 3 or more
|
||||||
newlines
|
newlines
|
||||||
@ -136,7 +136,7 @@ class SofImport(OooImport):
|
|||||||
self.new_song()
|
self.new_song()
|
||||||
text = u''
|
text = u''
|
||||||
self.process_paragraph_text(text)
|
self.process_paragraph_text(text)
|
||||||
|
|
||||||
def process_paragraph_text(self, text):
|
def process_paragraph_text(self, text):
|
||||||
"""
|
"""
|
||||||
Split the paragraph text into multiple lines and process
|
Split the paragraph text into multiple lines and process
|
||||||
@ -147,12 +147,12 @@ class SofImport(OooImport):
|
|||||||
self.new_song()
|
self.new_song()
|
||||||
|
|
||||||
def process_paragraph_line(self, text):
|
def process_paragraph_line(self, text):
|
||||||
"""
|
"""
|
||||||
Process a single line. Throw away that text which isn't relevant, i.e.
|
Process a single line. Throw away that text which isn't relevant, i.e.
|
||||||
stuff that appears at the end of the song.
|
stuff that appears at the end of the song.
|
||||||
Anything that is OK, append to the current verse
|
Anything that is OK, append to the current verse
|
||||||
"""
|
"""
|
||||||
text = text.strip()
|
text = text.strip()
|
||||||
if text == u'':
|
if text == u'':
|
||||||
self.blanklines += 1
|
self.blanklines += 1
|
||||||
if self.blanklines > 1:
|
if self.blanklines > 1:
|
||||||
@ -164,7 +164,7 @@ class SofImport(OooImport):
|
|||||||
if self.skip_to_close_bracket:
|
if self.skip_to_close_bracket:
|
||||||
if text.endswith(u')'):
|
if text.endswith(u')'):
|
||||||
self.skip_to_close_bracket = False
|
self.skip_to_close_bracket = False
|
||||||
return
|
return
|
||||||
if text.startswith(u'CCL Licence'):
|
if text.startswith(u'CCL Licence'):
|
||||||
self.italics = False
|
self.italics = False
|
||||||
return
|
return
|
||||||
@ -264,7 +264,7 @@ class SofImport(OooImport):
|
|||||||
"""
|
"""
|
||||||
Add the author. OpenLP stores them individually so split by 'and', '&'
|
Add the author. OpenLP stores them individually so split by 'and', '&'
|
||||||
and comma.
|
and comma.
|
||||||
However need to check for "Mr and Mrs Smith" and turn it to
|
However need to check for "Mr and Mrs Smith" and turn it to
|
||||||
"Mr Smith" and "Mrs Smith".
|
"Mr Smith" and "Mrs Smith".
|
||||||
"""
|
"""
|
||||||
text = text.replace(u' and ', u' & ')
|
text = text.replace(u' and ', u' & ')
|
||||||
@ -276,7 +276,7 @@ class SofImport(OooImport):
|
|||||||
we're beyond the second line of first verse, then this indicates
|
we're beyond the second line of first verse, then this indicates
|
||||||
a change of verse. Italics are a chorus
|
a change of verse. Italics are a chorus
|
||||||
"""
|
"""
|
||||||
if self.italics != self.is_chorus and ((len(self.song.verses) > 0) or
|
if self.italics != self.is_chorus and ((len(self.song.verses) > 0) or
|
||||||
(self.currentverse.count(u'\n') > 1)):
|
(self.currentverse.count(u'\n') > 1)):
|
||||||
self.finish_verse()
|
self.finish_verse()
|
||||||
if self.italics:
|
if self.italics:
|
||||||
@ -307,7 +307,7 @@ class SofImport(OooImport):
|
|||||||
ln = 0
|
ln = 0
|
||||||
if line:
|
if line:
|
||||||
verse = line + u'\n'
|
verse = line + u'\n'
|
||||||
else:
|
else:
|
||||||
verse = u''
|
verse = u''
|
||||||
else:
|
else:
|
||||||
verse += line + u'\n'
|
verse += line + u'\n'
|
||||||
@ -320,34 +320,34 @@ class SofImport(OooImport):
|
|||||||
|
|
||||||
|
|
||||||
def uncap_text(self, text):
|
def uncap_text(self, text):
|
||||||
"""
|
"""
|
||||||
Words in the title are in all capitals, so we lowercase them.
|
Words in the title are in all capitals, so we lowercase them.
|
||||||
However some of these words, e.g. referring to God need a leading
|
However some of these words, e.g. referring to God need a leading
|
||||||
capital letter.
|
capital letter.
|
||||||
|
|
||||||
There is a complicated word "One", which is sometimes lower and
|
There is a complicated word "One", which is sometimes lower and
|
||||||
sometimes upper depending on context. Never mind, keep it lower.
|
sometimes upper depending on context. Never mind, keep it lower.
|
||||||
"""
|
"""
|
||||||
textarr = re.split(u'(\W+)', text)
|
textarr = re.split(u'(\W+)', text)
|
||||||
textarr[0] = textarr[0].capitalize()
|
textarr[0] = textarr[0].capitalize()
|
||||||
for i in range(1, len(textarr)):
|
for i in range(1, len(textarr)):
|
||||||
# Do not translate these. Fixed strings in SOF song file
|
# Do not translate these. Fixed strings in SOF song file
|
||||||
if textarr[i] in (u'JESUS', u'CHRIST', u'KING', u'ALMIGHTY',
|
if textarr[i] in (u'JESUS', u'CHRIST', u'KING', u'ALMIGHTY',
|
||||||
u'REDEEMER', u'SHEPHERD', u'SON', u'GOD', u'LORD', u'FATHER',
|
u'REDEEMER', u'SHEPHERD', u'SON', u'GOD', u'LORD', u'FATHER',
|
||||||
u'HOLY', u'SPIRIT', u'LAMB', u'YOU', u'YOUR', u'I', u'I\'VE',
|
u'HOLY', u'SPIRIT', u'LAMB', u'YOU', u'YOUR', u'I', u'I\'VE',
|
||||||
u'I\'M', u'I\'LL', u'SAVIOUR', u'O', u'YOU\'RE', u'HE', u'HIS',
|
u'I\'M', u'I\'LL', u'SAVIOUR', u'O', u'YOU\'RE', u'HE', u'HIS',
|
||||||
u'HIM', u'ZION', u'EMMANUEL', u'MAJESTY', u'JESUS\'', u'JIREH',
|
u'HIM', u'ZION', u'EMMANUEL', u'MAJESTY', u'JESUS\'', u'JIREH',
|
||||||
u'JUDAH', u'LION', u'LORD\'S', u'ABRAHAM', u'GOD\'S',
|
u'JUDAH', u'LION', u'LORD\'S', u'ABRAHAM', u'GOD\'S',
|
||||||
u'FATHER\'S', u'ELIJAH'):
|
u'FATHER\'S', u'ELIJAH'):
|
||||||
textarr[i] = textarr[i].capitalize()
|
textarr[i] = textarr[i].capitalize()
|
||||||
else:
|
else:
|
||||||
textarr[i] = textarr[i].lower()
|
textarr[i] = textarr[i].lower()
|
||||||
text = u''.join(textarr)
|
text = u''.join(textarr)
|
||||||
return text
|
return text
|
||||||
|
|
||||||
def verse_splits(self, song_number):
|
def verse_splits(self, song_number):
|
||||||
"""
|
"""
|
||||||
Because someone at Kingsway forgot to check the 1+2 RTF file,
|
Because someone at Kingsway forgot to check the 1+2 RTF file,
|
||||||
some verses were not formatted correctly.
|
some verses were not formatted correctly.
|
||||||
"""
|
"""
|
||||||
if song_number == 11:
|
if song_number == 11:
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
"""
|
"""
|
||||||
The :mod:`songbeamerimport` module provides the functionality for importing
|
The :mod:`songbeamerimport` module provides the functionality for importing
|
||||||
SongBeamer songs into the OpenLP database.
|
SongBeamer songs into the OpenLP database.
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
@ -90,7 +90,7 @@ class SongBeamerImport(SongImport):
|
|||||||
len(self.import_source))
|
len(self.import_source))
|
||||||
for file in self.import_source:
|
for file in self.import_source:
|
||||||
# TODO: check that it is a valid SongBeamer file
|
# TODO: check that it is a valid SongBeamer file
|
||||||
self.current_verse = u''
|
self.current_verse = u''
|
||||||
self.current_verse_type = u'V'
|
self.current_verse_type = u'V'
|
||||||
read_verses = False
|
read_verses = False
|
||||||
self.file_name = os.path.split(file)[1]
|
self.file_name = os.path.split(file)[1]
|
||||||
@ -115,7 +115,7 @@ class SongBeamerImport(SongImport):
|
|||||||
self.replace_html_tags()
|
self.replace_html_tags()
|
||||||
self.add_verse(self.current_verse,
|
self.add_verse(self.current_verse,
|
||||||
self.current_verse_type)
|
self.current_verse_type)
|
||||||
self.current_verse = u''
|
self.current_verse = u''
|
||||||
self.current_verse_type = u'V'
|
self.current_verse_type = u'V'
|
||||||
read_verses = True
|
read_verses = True
|
||||||
verse_start = True
|
verse_start = True
|
||||||
|
2
scripts/openlp-remoteclient.py
Executable file → Normal file
2
scripts/openlp-remoteclient.py
Executable file → Normal file
@ -47,7 +47,7 @@ def main():
|
|||||||
help="Recipient address ",
|
help="Recipient address ",
|
||||||
default="localhost")
|
default="localhost")
|
||||||
parser.add_option("-e", "--event",
|
parser.add_option("-e", "--event",
|
||||||
help="Action to be performed",
|
help="Action to be performed",
|
||||||
default="alerts_text")
|
default="alerts_text")
|
||||||
parser.add_option("-m", "--message",
|
parser.add_option("-m", "--message",
|
||||||
help="Message to be passed for the action",
|
help="Message to be passed for the action",
|
||||||
|
Loading…
Reference in New Issue
Block a user