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``
|
||||
specify a recipient to be copied on the e-mail
|
||||
|
||||
``bcc``
|
||||
``bcc``
|
||||
specify a recipient to be blindly copied on the e-mail
|
||||
|
||||
``subject``
|
||||
``subject``
|
||||
specify a subject for the e-mail
|
||||
|
||||
``body``
|
||||
``body``
|
||||
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
|
||||
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):
|
||||
openlp_version = self.parent().applicationVersion[u'full']
|
||||
traceback = unicode(self.exceptionTextEdit.toPlainText())
|
||||
traceback = unicode(self.exceptionTextEdit.toPlainText())
|
||||
system = unicode(translate('OpenLP.ExceptionForm',
|
||||
'Platform: %s\n')) % platform.platform()
|
||||
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'):
|
||||
system = system + u'Desktop: GNOME\n'
|
||||
return (openlp_version, traceback, system, libraries)
|
||||
|
||||
|
||||
def onSaveReportButtonPressed(self):
|
||||
"""
|
||||
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')
|
||||
if old_bible != bible or old_second_bible != second_bible or \
|
||||
old_book != book:
|
||||
# The bible, second bible or book has changed.
|
||||
# The bible, second bible or book has changed.
|
||||
return True
|
||||
elif old_verse + 1 != verse and old_chapter == chapter:
|
||||
# We are still in the same chapter, but a verse has been skipped.
|
||||
|
@ -75,42 +75,42 @@ class ImagePlugin(Plugin):
|
||||
## Load Button ##
|
||||
self.textStrings[StringContent.Load] = {
|
||||
u'title': translate('ImagePlugin', 'Load'),
|
||||
u'tooltip': translate('ImagePlugin',
|
||||
u'tooltip': translate('ImagePlugin',
|
||||
'Load a new Image')
|
||||
}
|
||||
## New Button ##
|
||||
self.textStrings[StringContent.New] = {
|
||||
u'title': translate('ImagePlugin', 'Add'),
|
||||
u'tooltip': translate('ImagePlugin',
|
||||
u'tooltip': translate('ImagePlugin',
|
||||
'Add a new Image')
|
||||
}
|
||||
## Edit Button ##
|
||||
self.textStrings[StringContent.Edit] = {
|
||||
u'title': translate('ImagePlugin', 'Edit'),
|
||||
u'tooltip': translate('ImagePlugin',
|
||||
u'tooltip': translate('ImagePlugin',
|
||||
'Edit the selected Image')
|
||||
}
|
||||
## Delete Button ##
|
||||
self.textStrings[StringContent.Delete] = {
|
||||
u'title': translate('ImagePlugin', 'Delete'),
|
||||
u'tooltip': translate('ImagePlugin',
|
||||
u'tooltip': translate('ImagePlugin',
|
||||
'Delete the selected Image')
|
||||
}
|
||||
## Preview ##
|
||||
self.textStrings[StringContent.Preview] = {
|
||||
u'title': translate('ImagePlugin', 'Preview'),
|
||||
u'tooltip': translate('ImagePlugin',
|
||||
u'tooltip': translate('ImagePlugin',
|
||||
'Preview the selected Image')
|
||||
}
|
||||
## Live Button ##
|
||||
self.textStrings[StringContent.Live] = {
|
||||
u'title': translate('ImagePlugin', 'Live'),
|
||||
u'tooltip': translate('ImagePlugin',
|
||||
u'tooltip': translate('ImagePlugin',
|
||||
'Send the selected Image live')
|
||||
}
|
||||
## Add to service Button ##
|
||||
self.textStrings[StringContent.Service] = {
|
||||
u'title': translate('ImagePlugin', 'Service'),
|
||||
u'tooltip': translate('ImagePlugin',
|
||||
u'tooltip': translate('ImagePlugin',
|
||||
'Add the selected Image to the service')
|
||||
}
|
@ -48,7 +48,7 @@ else:
|
||||
uno_available = True
|
||||
except ImportError:
|
||||
uno_available = False
|
||||
|
||||
|
||||
from PyQt4 import QtCore
|
||||
|
||||
from presentationcontroller import PresentationController, PresentationDocument
|
||||
@ -210,12 +210,12 @@ class ImpressController(PresentationController):
|
||||
class ImpressDocument(PresentationDocument):
|
||||
"""
|
||||
Class which holds information and controls a single 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')
|
||||
PresentationDocument.__init__(self, controller, presentation)
|
||||
self.document = None
|
||||
@ -287,7 +287,7 @@ class ImpressDocument(PresentationDocument):
|
||||
page = pages.getByIndex(idx)
|
||||
doc.getCurrentController().setCurrentPage(page)
|
||||
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')
|
||||
try:
|
||||
doc.storeToURL(urlpath, props)
|
||||
|
@ -51,7 +51,7 @@ class Controller(object):
|
||||
|
||||
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
|
||||
then load the presentation.
|
||||
"""
|
||||
@ -362,7 +362,7 @@ class MessageListener(object):
|
||||
|
||||
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
|
||||
to check which slide is currently displayed so the slidecontroller
|
||||
view can be updated
|
||||
|
@ -108,7 +108,7 @@ class PptviewDocument(PresentationDocument):
|
||||
"""
|
||||
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')
|
||||
PresentationDocument.__init__(self, controller, presentation)
|
||||
|
@ -133,7 +133,7 @@ class PresentationTab(SettingsTab):
|
||||
self.settingsSection + u'/' + controller.name,
|
||||
QtCore.QVariant(QtCore.Qt.Checked)).toInt()[0])
|
||||
self.OverrideAppCheckBox.setChecked(QtCore.QSettings().value(
|
||||
self.settingsSection + u'/override app',
|
||||
self.settingsSection + u'/override app',
|
||||
QtCore.QVariant(QtCore.Qt.Unchecked)).toInt()[0])
|
||||
|
||||
def save(self):
|
||||
|
@ -163,30 +163,30 @@ class PresentationPlugin(Plugin):
|
||||
## Load Button ##
|
||||
self.textStrings[StringContent.Load] = {
|
||||
u'title': translate('PresentationPlugin', 'Load'),
|
||||
u'tooltip': translate('PresentationPlugin',
|
||||
u'tooltip': translate('PresentationPlugin',
|
||||
'Load a new Presentation')
|
||||
}
|
||||
## Delete Button ##
|
||||
self.textStrings[StringContent.Delete] = {
|
||||
u'title': translate('PresentationPlugin', 'Delete'),
|
||||
u'tooltip': translate('PresentationPlugin',
|
||||
u'tooltip': translate('PresentationPlugin',
|
||||
'Delete the selected Presentation')
|
||||
}
|
||||
## Preview ##
|
||||
self.textStrings[StringContent.Preview] = {
|
||||
u'title': translate('PresentationPlugin', 'Preview'),
|
||||
u'tooltip': translate('PresentationPlugin',
|
||||
u'tooltip': translate('PresentationPlugin',
|
||||
'Preview the selected Presentation')
|
||||
}
|
||||
## Live Button ##
|
||||
self.textStrings[StringContent.Live] = {
|
||||
u'title': translate('PresentationPlugin', 'Live'),
|
||||
u'tooltip': translate('PresentationPlugin',
|
||||
u'tooltip': translate('PresentationPlugin',
|
||||
'Send the selected Presentation live')
|
||||
}
|
||||
## Add to service Button ##
|
||||
self.textStrings[StringContent.Service] = {
|
||||
u'title': translate('PresentationPlugin', 'Service'),
|
||||
u'tooltip': translate('PresentationPlugin',
|
||||
u'tooltip': translate('PresentationPlugin',
|
||||
'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 '
|
||||
'browser or through the remote API.')
|
||||
return about_text
|
||||
|
||||
|
||||
def setPluginTextStrings(self):
|
||||
"""
|
||||
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,
|
||||
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))
|
||||
songs = self.manager.get_all_objects(Song,
|
||||
Song.authors.contains(old_author))
|
||||
|
@ -41,7 +41,7 @@ def strip_rtf(blob, encoding):
|
||||
control_word = []
|
||||
for c in blob:
|
||||
if control:
|
||||
# for delimiters, set control to False
|
||||
# for delimiters, set control to False
|
||||
if c == '{':
|
||||
if len(control_word) > 0:
|
||||
depth += 1
|
||||
|
@ -46,7 +46,7 @@ else:
|
||||
|
||||
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):
|
||||
"""
|
||||
@ -122,7 +122,7 @@ class OooImport(SongImport):
|
||||
manager = ctx.ServiceManager
|
||||
self.desktop = manager.createInstanceWithContext(
|
||||
"com.sun.star.frame.Desktop", ctx)
|
||||
|
||||
|
||||
def start_ooo_process(self):
|
||||
try:
|
||||
if os.name == u'nt':
|
||||
@ -168,11 +168,11 @@ class OooImport(SongImport):
|
||||
u'Processing file ' + filepath, 0)
|
||||
except:
|
||||
pass
|
||||
return
|
||||
return
|
||||
|
||||
def close_ooo_file(self):
|
||||
"""
|
||||
Close file.
|
||||
Close file.
|
||||
"""
|
||||
self.document.close(True)
|
||||
self.document = None
|
||||
@ -187,7 +187,7 @@ class OooImport(SongImport):
|
||||
def process_pres(self):
|
||||
"""
|
||||
Process the file
|
||||
"""
|
||||
"""
|
||||
doc = self.document
|
||||
slides = doc.getDrawPages()
|
||||
text = u''
|
||||
@ -195,7 +195,7 @@ class OooImport(SongImport):
|
||||
if self.abort:
|
||||
self.import_wizard.incrementProgressBar(u'Import cancelled', 0)
|
||||
return
|
||||
slide = slides.getByIndex(slide_no)
|
||||
slide = slides.getByIndex(slide_no)
|
||||
slidetext = u''
|
||||
for idx in range(slide.getCount()):
|
||||
shape = slide.getByIndex(idx)
|
||||
@ -209,12 +209,12 @@ class OooImport(SongImport):
|
||||
songs = SongImport.process_songs_text(self.manager, text)
|
||||
for song in songs:
|
||||
song.finish()
|
||||
return
|
||||
return
|
||||
|
||||
def process_doc(self):
|
||||
"""
|
||||
Process the doc file, a paragraph at a time
|
||||
"""
|
||||
"""
|
||||
text = u''
|
||||
paragraphs = self.document.getText().createEnumeration()
|
||||
while paragraphs.hasMoreElements():
|
||||
|
@ -249,7 +249,7 @@ class OpenSongImport(SongImport):
|
||||
words = thisline[1:].strip()
|
||||
if words is None:
|
||||
words = thisline
|
||||
if not versenum:
|
||||
if not versenum:
|
||||
versenum = u'1'
|
||||
if versenum is not None:
|
||||
versetag = u'%s%s' % (versetype, versenum)
|
||||
@ -298,7 +298,7 @@ class OpenSongImport(SongImport):
|
||||
for tag in order:
|
||||
if tag[0].isdigit():
|
||||
# Assume it's a verse if it has no prefix
|
||||
tag = u'V' + tag
|
||||
tag = u'V' + tag
|
||||
elif not re.search('\d+', tag):
|
||||
# Assume it's no.1 if there's no digits
|
||||
tag = tag + u'1'
|
||||
|
@ -56,13 +56,13 @@ class SofImport(OooImport):
|
||||
"""
|
||||
Import songs provided on disks with the Songs of Fellowship music books
|
||||
VOLS1_2.RTF, sof3words.rtf and sof4words.rtf
|
||||
|
||||
|
||||
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
|
||||
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!
|
||||
|
||||
It attempts to detect italiced verses, and treats these as choruses in
|
||||
@ -96,7 +96,7 @@ class SofImport(OooImport):
|
||||
def process_sof_file(self):
|
||||
"""
|
||||
Process the RTF file, a paragraph at a time
|
||||
"""
|
||||
"""
|
||||
self.blanklines = 0
|
||||
self.new_song()
|
||||
paragraphs = self.document.getText().createEnumeration()
|
||||
@ -113,11 +113,11 @@ class SofImport(OooImport):
|
||||
|
||||
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
|
||||
they may contain multiple lines.
|
||||
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.
|
||||
In later books, there may not be line breaks, so check for 3 or more
|
||||
newlines
|
||||
@ -136,7 +136,7 @@ class SofImport(OooImport):
|
||||
self.new_song()
|
||||
text = u''
|
||||
self.process_paragraph_text(text)
|
||||
|
||||
|
||||
def process_paragraph_text(self, text):
|
||||
"""
|
||||
Split the paragraph text into multiple lines and process
|
||||
@ -147,12 +147,12 @@ class SofImport(OooImport):
|
||||
self.new_song()
|
||||
|
||||
def process_paragraph_line(self, text):
|
||||
"""
|
||||
"""
|
||||
Process a single line. Throw away that text which isn't relevant, i.e.
|
||||
stuff that appears at the end of the song.
|
||||
Anything that is OK, append to the current verse
|
||||
"""
|
||||
text = text.strip()
|
||||
text = text.strip()
|
||||
if text == u'':
|
||||
self.blanklines += 1
|
||||
if self.blanklines > 1:
|
||||
@ -164,7 +164,7 @@ class SofImport(OooImport):
|
||||
if self.skip_to_close_bracket:
|
||||
if text.endswith(u')'):
|
||||
self.skip_to_close_bracket = False
|
||||
return
|
||||
return
|
||||
if text.startswith(u'CCL Licence'):
|
||||
self.italics = False
|
||||
return
|
||||
@ -264,7 +264,7 @@ class SofImport(OooImport):
|
||||
"""
|
||||
Add the author. OpenLP stores them individually so split by 'and', '&'
|
||||
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".
|
||||
"""
|
||||
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
|
||||
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.finish_verse()
|
||||
if self.italics:
|
||||
@ -307,7 +307,7 @@ class SofImport(OooImport):
|
||||
ln = 0
|
||||
if line:
|
||||
verse = line + u'\n'
|
||||
else:
|
||||
else:
|
||||
verse = u''
|
||||
else:
|
||||
verse += line + u'\n'
|
||||
@ -320,34 +320,34 @@ class SofImport(OooImport):
|
||||
|
||||
|
||||
def uncap_text(self, text):
|
||||
"""
|
||||
"""
|
||||
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.
|
||||
|
||||
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.
|
||||
"""
|
||||
textarr = re.split(u'(\W+)', text)
|
||||
textarr[0] = textarr[0].capitalize()
|
||||
for i in range(1, len(textarr)):
|
||||
# Do not translate these. Fixed strings in SOF song file
|
||||
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'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'HIM', u'ZION', u'EMMANUEL', u'MAJESTY', u'JESUS\'', u'JIREH',
|
||||
u'JUDAH', u'LION', u'LORD\'S', u'ABRAHAM', u'GOD\'S',
|
||||
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'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'HIM', u'ZION', u'EMMANUEL', u'MAJESTY', u'JESUS\'', u'JIREH',
|
||||
u'JUDAH', u'LION', u'LORD\'S', u'ABRAHAM', u'GOD\'S',
|
||||
u'FATHER\'S', u'ELIJAH'):
|
||||
textarr[i] = textarr[i].capitalize()
|
||||
else:
|
||||
textarr[i] = textarr[i].lower()
|
||||
text = u''.join(textarr)
|
||||
return text
|
||||
|
||||
|
||||
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.
|
||||
"""
|
||||
if song_number == 11:
|
||||
|
@ -24,7 +24,7 @@
|
||||
# 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.
|
||||
"""
|
||||
import logging
|
||||
@ -90,7 +90,7 @@ class SongBeamerImport(SongImport):
|
||||
len(self.import_source))
|
||||
for file in self.import_source:
|
||||
# TODO: check that it is a valid SongBeamer file
|
||||
self.current_verse = u''
|
||||
self.current_verse = u''
|
||||
self.current_verse_type = u'V'
|
||||
read_verses = False
|
||||
self.file_name = os.path.split(file)[1]
|
||||
@ -115,7 +115,7 @@ class SongBeamerImport(SongImport):
|
||||
self.replace_html_tags()
|
||||
self.add_verse(self.current_verse,
|
||||
self.current_verse_type)
|
||||
self.current_verse = u''
|
||||
self.current_verse = u''
|
||||
self.current_verse_type = u'V'
|
||||
read_verses = 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 ",
|
||||
default="localhost")
|
||||
parser.add_option("-e", "--event",
|
||||
help="Action to be performed",
|
||||
help="Action to be performed",
|
||||
default="alerts_text")
|
||||
parser.add_option("-m", "--message",
|
||||
help="Message to be passed for the action",
|
||||
|
Loading…
Reference in New Issue
Block a user