forked from openlp/openlp
removed white spaces
This commit is contained in:
parent
0dbc1c6e1a
commit
0ed7e259fc
|
@ -106,8 +106,8 @@ def translate(context, text, comment=None,
|
||||||
|
|
||||||
def get_text_file_string(text_file):
|
def get_text_file_string(text_file):
|
||||||
"""
|
"""
|
||||||
Open a file and return its content as unicode string. If the supplied file
|
Open a file and return its content as unicode string. If the supplied file
|
||||||
name is not a file then the function returns False. If there is an error
|
name is not a file then the function returns False. If there is an error
|
||||||
loading the file or the content can't be decoded then the function will
|
loading the file or the content can't be decoded then the function will
|
||||||
return None.
|
return None.
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ def delete_database(plugin_name, db_file_name=None):
|
||||||
The name of the plugin to remove the database for
|
The name of the plugin to remove the database for
|
||||||
|
|
||||||
``db_file_name``
|
``db_file_name``
|
||||||
The database file name. Defaults to None resulting in the
|
The database file name. Defaults to None resulting in the
|
||||||
plugin_name being used.
|
plugin_name being used.
|
||||||
"""
|
"""
|
||||||
db_file_path = None
|
db_file_path = None
|
||||||
|
@ -107,7 +107,7 @@ class Manager(object):
|
||||||
The init_schema function for this database
|
The init_schema function for this database
|
||||||
|
|
||||||
``db_file_name``
|
``db_file_name``
|
||||||
The file name to use for this database. Defaults to None resulting
|
The file name to use for this database. Defaults to None resulting
|
||||||
in the plugin_name being used.
|
in the plugin_name being used.
|
||||||
"""
|
"""
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
|
@ -211,11 +211,11 @@ class Manager(object):
|
||||||
The type of objects to return
|
The type of objects to return
|
||||||
|
|
||||||
``filter_clause``
|
``filter_clause``
|
||||||
The filter governing selection of objects to return. Defaults to
|
The filter governing selection of objects to return. Defaults to
|
||||||
None.
|
None.
|
||||||
|
|
||||||
``order_by_ref``
|
``order_by_ref``
|
||||||
Any parameters to order the returned objects by. Defaults to None.
|
Any parameters to order the returned objects by. Defaults to None.
|
||||||
"""
|
"""
|
||||||
query = self.session.query(object_class)
|
query = self.session.query(object_class)
|
||||||
if filter_clause is not None:
|
if filter_clause is not None:
|
||||||
|
@ -232,7 +232,7 @@ class Manager(object):
|
||||||
The type of objects to return.
|
The type of objects to return.
|
||||||
|
|
||||||
``filter_clause``
|
``filter_clause``
|
||||||
The filter governing selection of objects to return. Defaults to
|
The filter governing selection of objects to return. Defaults to
|
||||||
None.
|
None.
|
||||||
"""
|
"""
|
||||||
query = self.session.query(object_class)
|
query = self.session.query(object_class)
|
||||||
|
|
|
@ -64,7 +64,7 @@ class SettingsManager(object):
|
||||||
Read the last directory used for plugin.
|
Read the last directory used for plugin.
|
||||||
|
|
||||||
``section``
|
``section``
|
||||||
The section of code calling the method. This is used in the
|
The section of code calling the method. This is used in the
|
||||||
settings key.
|
settings key.
|
||||||
|
|
||||||
``num``
|
``num``
|
||||||
|
@ -84,7 +84,7 @@ class SettingsManager(object):
|
||||||
Save the last directory used for plugin.
|
Save the last directory used for plugin.
|
||||||
|
|
||||||
``section``
|
``section``
|
||||||
The section of code calling the method. This is used in the
|
The section of code calling the method. This is used in the
|
||||||
settings key.
|
settings key.
|
||||||
|
|
||||||
``directory``
|
``directory``
|
||||||
|
@ -160,11 +160,11 @@ class SettingsManager(object):
|
||||||
Get a list of files from the data files path.
|
Get a list of files from the data files path.
|
||||||
|
|
||||||
``section``
|
``section``
|
||||||
Defaults to *None*. The section of code getting the files - used
|
Defaults to *None*. The section of code getting the files - used
|
||||||
to load from a section's data subdirectory.
|
to load from a section's data subdirectory.
|
||||||
|
|
||||||
``extension``
|
``extension``
|
||||||
Defaults to *None*. The extension to search for.
|
Defaults to *None*. The extension to search for.
|
||||||
"""
|
"""
|
||||||
path = AppLocation.get_data_path()
|
path = AppLocation.get_data_path()
|
||||||
if section:
|
if section:
|
||||||
|
|
|
@ -130,7 +130,7 @@ def create_accept_reject_button_box(parent, okay=False):
|
||||||
methods to handle the default ``accepted()`` and ``rejected()`` signals.
|
methods to handle the default ``accepted()`` and ``rejected()`` signals.
|
||||||
|
|
||||||
``parent``
|
``parent``
|
||||||
The parent object. This should be a ``QWidget`` descendant.
|
The parent object. This should be a ``QWidget`` descendant.
|
||||||
|
|
||||||
``okay``
|
``okay``
|
||||||
If true creates an okay/cancel combination instead of save/cancel.
|
If true creates an okay/cancel combination instead of save/cancel.
|
||||||
|
@ -185,15 +185,15 @@ def media_item_combo_box(parent, name):
|
||||||
|
|
||||||
def create_delete_push_button(parent, icon=None):
|
def create_delete_push_button(parent, icon=None):
|
||||||
"""
|
"""
|
||||||
Creates a standard push button with a delete label and optional icon. The
|
Creates a standard push button with a delete label and optional icon. The
|
||||||
button is connected to the parent's ``onDeleteButtonClicked()`` method to
|
button is connected to the parent's ``onDeleteButtonClicked()`` method to
|
||||||
handle the ``clicked()`` signal.
|
handle the ``clicked()`` signal.
|
||||||
|
|
||||||
``parent``
|
``parent``
|
||||||
The parent object. This should be a ``QWidget`` descendant.
|
The parent object. This should be a ``QWidget`` descendant.
|
||||||
|
|
||||||
``icon``
|
``icon``
|
||||||
An icon to display on the button. This can be either a ``QIcon``, a
|
An icon to display on the button. This can be either a ``QIcon``, a
|
||||||
resource path or a file name.
|
resource path or a file name.
|
||||||
"""
|
"""
|
||||||
delete_button = QtGui.QPushButton(parent)
|
delete_button = QtGui.QPushButton(parent)
|
||||||
|
@ -210,12 +210,12 @@ def create_delete_push_button(parent, icon=None):
|
||||||
def create_up_down_push_button_set(parent):
|
def create_up_down_push_button_set(parent):
|
||||||
"""
|
"""
|
||||||
Creates a standard set of two push buttons, one for up and the other for
|
Creates a standard set of two push buttons, one for up and the other for
|
||||||
down, for use with lists. The buttons use arrow icons and no text and are
|
down, for use with lists. The buttons use arrow icons and no text and are
|
||||||
connected to the parent's ``onUpButtonClicked()`` and
|
connected to the parent's ``onUpButtonClicked()`` and
|
||||||
``onDownButtonClicked()`` to handle their respective ``clicked()`` signals.
|
``onDownButtonClicked()`` to handle their respective ``clicked()`` signals.
|
||||||
|
|
||||||
``parent``
|
``parent``
|
||||||
The parent object. This should be a ``QWidget`` descendant.
|
The parent object. This should be a ``QWidget`` descendant.
|
||||||
"""
|
"""
|
||||||
up_button = QtGui.QPushButton(parent)
|
up_button = QtGui.QPushButton(parent)
|
||||||
up_button.setIcon(build_icon(u':/services/service_up.png'))
|
up_button.setIcon(build_icon(u':/services/service_up.png'))
|
||||||
|
@ -295,7 +295,7 @@ def create_valign_combo(form, parent, layout):
|
||||||
The UI screen that the label and combo will appear on.
|
The UI screen that the label and combo will appear on.
|
||||||
|
|
||||||
``parent``
|
``parent``
|
||||||
The parent object. This should be a ``QWidget`` descendant.
|
The parent object. This should be a ``QWidget`` descendant.
|
||||||
|
|
||||||
``layout``
|
``layout``
|
||||||
A layout object to add the label and combo widgets to.
|
A layout object to add the label and combo widgets to.
|
||||||
|
|
|
@ -92,7 +92,7 @@ class Theme(object):
|
||||||
* ``solid`` - color
|
* ``solid`` - color
|
||||||
|
|
||||||
``BackgroundParameter2``
|
``BackgroundParameter2``
|
||||||
Extra information about the background. The contents of this attribute
|
Extra information about the background. The contents of this attribute
|
||||||
depend on the BackgroundType:
|
depend on the BackgroundType:
|
||||||
|
|
||||||
* ``image`` - border color
|
* ``image`` - border color
|
||||||
|
@ -100,7 +100,7 @@ class Theme(object):
|
||||||
* ``solid`` - N/A
|
* ``solid`` - N/A
|
||||||
|
|
||||||
``BackgroundParameter3``
|
``BackgroundParameter3``
|
||||||
Extra information about the background. The contents of this attribute
|
Extra information about the background. The contents of this attribute
|
||||||
depend on the BackgroundType:
|
depend on the BackgroundType:
|
||||||
|
|
||||||
* ``image`` - N/A
|
* ``image`` - N/A
|
||||||
|
@ -142,7 +142,7 @@ class Theme(object):
|
||||||
Color for the outline (or None if Outline is 0)
|
Color for the outline (or None if Outline is 0)
|
||||||
|
|
||||||
``HorizontalAlign``
|
``HorizontalAlign``
|
||||||
The horizontal alignment to apply to text. Valid alignments are:
|
The horizontal alignment to apply to text. Valid alignments are:
|
||||||
|
|
||||||
* ``0`` - left align
|
* ``0`` - left align
|
||||||
* ``1`` - right align
|
* ``1`` - right align
|
||||||
|
@ -156,7 +156,7 @@ class Theme(object):
|
||||||
* ``2`` - centre align
|
* ``2`` - centre align
|
||||||
|
|
||||||
``WrapStyle``
|
``WrapStyle``
|
||||||
The wrap style to apply to the text. Valid styles are:
|
The wrap style to apply to the text. Valid styles are:
|
||||||
|
|
||||||
* ``0`` - normal
|
* ``0`` - normal
|
||||||
* ``1`` - lyrics
|
* ``1`` - lyrics
|
||||||
|
|
|
@ -72,7 +72,7 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog):
|
||||||
def preLoad(self):
|
def preLoad(self):
|
||||||
"""
|
"""
|
||||||
Load the Tags from store so can be used in the system or used to
|
Load the Tags from store so can be used in the system or used to
|
||||||
update the display. If Cancel was selected this is needed to reset the
|
update the display. If Cancel was selected this is needed to reset the
|
||||||
dsiplay to the correct version.
|
dsiplay to the correct version.
|
||||||
"""
|
"""
|
||||||
# Initial Load of the Tags
|
# Initial Load of the Tags
|
||||||
|
|
|
@ -45,7 +45,7 @@ class ValidEdit(QtGui.QLineEdit):
|
||||||
|
|
||||||
def validText(self):
|
def validText(self):
|
||||||
"""
|
"""
|
||||||
Only return Integers. Space is 0
|
Only return Integers. Space is 0
|
||||||
"""
|
"""
|
||||||
if self.text().isEmpty():
|
if self.text().isEmpty():
|
||||||
return QtCore.QString(u'0')
|
return QtCore.QString(u'0')
|
||||||
|
|
|
@ -266,7 +266,7 @@ class ThemeManager(QtGui.QWidget):
|
||||||
oldThemeName = unicode(item.data(QtCore.Qt.UserRole).toString())
|
oldThemeName = unicode(item.data(QtCore.Qt.UserRole).toString())
|
||||||
self.fileRenameForm.fileNameEdit.setText(oldThemeName)
|
self.fileRenameForm.fileNameEdit.setText(oldThemeName)
|
||||||
if self.fileRenameForm.exec_():
|
if self.fileRenameForm.exec_():
|
||||||
newThemeName = unicode(self.fileRenameForm.fileNameEdit.text())
|
newThemeName = unicode(self.fileRenameForm.fileNameEdit.text())
|
||||||
if self.checkIfThemeExists(newThemeName):
|
if self.checkIfThemeExists(newThemeName):
|
||||||
oldThemeData = self.getThemeData(oldThemeName)
|
oldThemeData = self.getThemeData(oldThemeName)
|
||||||
self.cloneThemeData(oldThemeData, newThemeName)
|
self.cloneThemeData(oldThemeData, newThemeName)
|
||||||
|
@ -284,7 +284,7 @@ class ThemeManager(QtGui.QWidget):
|
||||||
oldThemeName = unicode(item.data(QtCore.Qt.UserRole).toString())
|
oldThemeName = unicode(item.data(QtCore.Qt.UserRole).toString())
|
||||||
self.fileRenameForm.fileNameEdit.setText(oldThemeName)
|
self.fileRenameForm.fileNameEdit.setText(oldThemeName)
|
||||||
if self.fileRenameForm.exec_(True):
|
if self.fileRenameForm.exec_(True):
|
||||||
newThemeName = unicode(self.fileRenameForm.fileNameEdit.text())
|
newThemeName = unicode(self.fileRenameForm.fileNameEdit.text())
|
||||||
if self.checkIfThemeExists(newThemeName):
|
if self.checkIfThemeExists(newThemeName):
|
||||||
themeData = self.getThemeData(oldThemeName)
|
themeData = self.getThemeData(oldThemeName)
|
||||||
self.cloneThemeData(themeData, newThemeName)
|
self.cloneThemeData(themeData, newThemeName)
|
||||||
|
@ -399,7 +399,7 @@ class ThemeManager(QtGui.QWidget):
|
||||||
def onImportTheme(self):
|
def onImportTheme(self):
|
||||||
"""
|
"""
|
||||||
Opens a file dialog to select the theme file(s) to import before
|
Opens a file dialog to select the theme file(s) to import before
|
||||||
attempting to extract OpenLP themes from those files. This process
|
attempting to extract OpenLP themes from those files. This process
|
||||||
will load both OpenLP version 1 and version 2 themes.
|
will load both OpenLP version 1 and version 2 themes.
|
||||||
"""
|
"""
|
||||||
files = QtGui.QFileDialog.getOpenFileNames(self,
|
files = QtGui.QFileDialog.getOpenFileNames(self,
|
||||||
|
|
|
@ -242,7 +242,7 @@ def add_actions(target, actions):
|
||||||
The menu or toolbar to add actions to.
|
The menu or toolbar to add actions to.
|
||||||
|
|
||||||
``actions``
|
``actions``
|
||||||
The actions to be added. An action consisting of the keyword 'None'
|
The actions to be added. An action consisting of the keyword 'None'
|
||||||
will result in a separator being inserted into the target.
|
will result in a separator being inserted into the target.
|
||||||
"""
|
"""
|
||||||
for action in actions:
|
for action in actions:
|
||||||
|
@ -318,7 +318,7 @@ def get_web_page(url, header=None, update_openlp=False):
|
||||||
Tells OpenLP to update itself if the page is successfully downloaded.
|
Tells OpenLP to update itself if the page is successfully downloaded.
|
||||||
Defaults to False.
|
Defaults to False.
|
||||||
"""
|
"""
|
||||||
# TODO: Add proxy usage. Get proxy info from OpenLP settings, add to a
|
# TODO: Add proxy usage. Get proxy info from OpenLP settings, add to a
|
||||||
# proxy_handler, build into an opener and install the opener into urllib2.
|
# proxy_handler, build into an opener and install the opener into urllib2.
|
||||||
# http://docs.python.org/library/urllib2.html
|
# http://docs.python.org/library/urllib2.html
|
||||||
if not url:
|
if not url:
|
||||||
|
|
|
@ -322,7 +322,7 @@ class BibleDB(QtCore.QObject, Manager):
|
||||||
def get_books(self):
|
def get_books(self):
|
||||||
"""
|
"""
|
||||||
A wrapper so both local and web bibles have a get_books() method that
|
A wrapper so both local and web bibles have a get_books() method that
|
||||||
manager can call. Used in the media manager advanced search tab.
|
manager can call. Used in the media manager advanced search tab.
|
||||||
"""
|
"""
|
||||||
return self.get_all_objects(Book, order_by_ref=Book.id)
|
return self.get_all_objects(Book, order_by_ref=Book.id)
|
||||||
|
|
||||||
|
|
|
@ -238,8 +238,8 @@ class BGExtract(object):
|
||||||
raw_verse_num = content.next
|
raw_verse_num = content.next
|
||||||
clean_verse_num = 0
|
clean_verse_num = 0
|
||||||
# Not all verses exist in all translations and may or may not be
|
# Not all verses exist in all translations and may or may not be
|
||||||
# represented by a verse number. If they are not fine, if they are
|
# represented by a verse number. If they are not fine, if they are
|
||||||
# it will probably be in a format that breaks int(). We will then
|
# it will probably be in a format that breaks int(). We will then
|
||||||
# have no idea what garbage may be sucked in to the verse text so
|
# have no idea what garbage may be sucked in to the verse text so
|
||||||
# if we do not get a clean int() then ignore the verse completely.
|
# if we do not get a clean int() then ignore the verse completely.
|
||||||
try:
|
try:
|
||||||
|
@ -384,7 +384,7 @@ class HTTPBible(BibleDB):
|
||||||
BibleDB.__init__(self, parent, **kwargs)
|
BibleDB.__init__(self, parent, **kwargs)
|
||||||
self.download_source = kwargs[u'download_source']
|
self.download_source = kwargs[u'download_source']
|
||||||
self.download_name = kwargs[u'download_name']
|
self.download_name = kwargs[u'download_name']
|
||||||
# TODO: Clean up proxy stuff. We probably want one global proxy per
|
# TODO: Clean up proxy stuff. We probably want one global proxy per
|
||||||
# connection type (HTTP and HTTPS) at most.
|
# connection type (HTTP and HTTPS) at most.
|
||||||
self.proxy_server = None
|
self.proxy_server = None
|
||||||
self.proxy_username = None
|
self.proxy_username = None
|
||||||
|
@ -458,8 +458,8 @@ class HTTPBible(BibleDB):
|
||||||
search_results = self.get_chapter(book, reference[1])
|
search_results = self.get_chapter(book, reference[1])
|
||||||
if search_results and search_results.has_verselist():
|
if search_results and search_results.has_verselist():
|
||||||
## We have found a book of the bible lets check to see
|
## We have found a book of the bible lets check to see
|
||||||
## if it was there. By reusing the returned book name
|
## if it was there. By reusing the returned book name
|
||||||
## we get a correct book. For example it is possible
|
## we get a correct book. For example it is possible
|
||||||
## to request ac and get Acts back.
|
## to request ac and get Acts back.
|
||||||
bookname = search_results.book
|
bookname = search_results.book
|
||||||
Receiver.send_message(u'openlp_process_events')
|
Receiver.send_message(u'openlp_process_events')
|
||||||
|
|
|
@ -275,7 +275,7 @@ class BibleManager(object):
|
||||||
'Scripture Reference Error'),
|
'Scripture Reference Error'),
|
||||||
u'message': translate('BiblesPlugin.BibleManager',
|
u'message': translate('BiblesPlugin.BibleManager',
|
||||||
'Your scripture reference is either not supported by OpenLP '
|
'Your scripture reference is either not supported by OpenLP '
|
||||||
'or is invalid. Please make sure your reference conforms to '
|
'or is invalid. Please make sure your reference conforms to '
|
||||||
'one of the following patterns:\n\n'
|
'one of the following patterns:\n\n'
|
||||||
'Book Chapter\n'
|
'Book Chapter\n'
|
||||||
'Book Chapter-Chapter\n'
|
'Book Chapter-Chapter\n'
|
||||||
|
|
|
@ -63,7 +63,7 @@ class MediaPlugin(Plugin):
|
||||||
if ext not in list:
|
if ext not in list:
|
||||||
list.append(ext)
|
list.append(ext)
|
||||||
self.serviceManager.supportedSuffixes(extension[1:])
|
self.serviceManager.supportedSuffixes(extension[1:])
|
||||||
log.info(u'MediaPlugin: %s extensions: %s' % (mimetype,
|
log.info(u'MediaPlugin: %s extensions: %s' % (mimetype,
|
||||||
u' '.join(extensions)))
|
u' '.join(extensions)))
|
||||||
|
|
||||||
def about(self):
|
def about(self):
|
||||||
|
|
|
@ -211,8 +211,8 @@ class ImpressDocument(PresentationDocument):
|
||||||
"""
|
"""
|
||||||
Called when a presentation is added to the SlideController.
|
Called when a presentation is added to the SlideController.
|
||||||
It builds the environment, starts communcations with the background
|
It builds the environment, starts communcations with the background
|
||||||
OpenOffice task started earlier. If OpenOffice is not present is is
|
OpenOffice task started earlier. If OpenOffice is not present is is
|
||||||
started. Once the environment is available the presentation is loaded
|
started. Once the environment is available the presentation is loaded
|
||||||
and started.
|
and started.
|
||||||
|
|
||||||
``presentation``
|
``presentation``
|
||||||
|
|
|
@ -357,7 +357,7 @@ class PresentationController(object):
|
||||||
def __init__(self, plugin=None, name=u'PresentationController',
|
def __init__(self, plugin=None, name=u'PresentationController',
|
||||||
document_class=PresentationDocument):
|
document_class=PresentationDocument):
|
||||||
"""
|
"""
|
||||||
This is the constructor for the presentationcontroller object. This
|
This is the constructor for the presentationcontroller object. This
|
||||||
provides an easy way for descendent plugins to populate common data.
|
provides an easy way for descendent plugins to populate common data.
|
||||||
This method *must* be overridden, like so::
|
This method *must* be overridden, like so::
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ log = logging.getLogger(__name__)
|
||||||
class HttpServer(object):
|
class HttpServer(object):
|
||||||
"""
|
"""
|
||||||
Ability to control OpenLP via a webbrowser
|
Ability to control OpenLP via a webbrowser
|
||||||
e.g. http://localhost:4316/send/slidecontroller_live_next
|
e.g. http://localhost:4316/send/slidecontroller_live_next
|
||||||
http://localhost:4316/send/alerts_text?q=your%20alert%20text
|
http://localhost:4316/send/alerts_text?q=your%20alert%20text
|
||||||
"""
|
"""
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
|
|
|
@ -557,7 +557,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||||
"""
|
"""
|
||||||
Check the validity of the song.
|
Check the validity of the song.
|
||||||
"""
|
"""
|
||||||
# This checks data in the form *not* self.song. self.song is still
|
# This checks data in the form *not* self.song. self.song is still
|
||||||
# None at this point.
|
# None at this point.
|
||||||
log.debug(u'Validate Song')
|
log.debug(u'Validate Song')
|
||||||
# Lets be nice and assume the data is correct.
|
# Lets be nice and assume the data is correct.
|
||||||
|
@ -714,14 +714,14 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||||
def saveSong(self, preview=False):
|
def saveSong(self, preview=False):
|
||||||
"""
|
"""
|
||||||
Get all the data from the widgets on the form, and then save it to the
|
Get all the data from the widgets on the form, and then save it to the
|
||||||
database. The form has been validated and all reference items
|
database. The form has been validated and all reference items
|
||||||
(Authors, Books and Topics) have been saved before this function is
|
(Authors, Books and Topics) have been saved before this function is
|
||||||
called.
|
called.
|
||||||
|
|
||||||
``preview``
|
``preview``
|
||||||
Should be ``True`` if the song is also previewed (boolean).
|
Should be ``True`` if the song is also previewed (boolean).
|
||||||
"""
|
"""
|
||||||
# The Song() assignment. No database calls should be made while a
|
# The Song() assignment. No database calls should be made while a
|
||||||
# Song() is in a partially complete state.
|
# Song() is in a partially complete state.
|
||||||
if not self.song:
|
if not self.song:
|
||||||
self.song = Song()
|
self.song = Song()
|
||||||
|
|
|
@ -96,7 +96,7 @@ class EasiSlidesImport(SongImport):
|
||||||
mandatory=False):
|
mandatory=False):
|
||||||
"""
|
"""
|
||||||
Add imported values to the song model converting them to unicode at the
|
Add imported values to the song model converting them to unicode at the
|
||||||
same time. If the unicode decode fails or a mandatory attribute is not
|
same time. If the unicode decode fails or a mandatory attribute is not
|
||||||
present _success is set to False so the importer can react
|
present _success is set to False so the importer can react
|
||||||
appropriately.
|
appropriately.
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ def strip_rtf(blob, encoding):
|
||||||
elif control_str == 'tab':
|
elif control_str == 'tab':
|
||||||
clear_text.append(u'\t')
|
clear_text.append(u'\t')
|
||||||
# Prefer the encoding specified by the RTF data to that
|
# Prefer the encoding specified by the RTF data to that
|
||||||
# specified by the Paradox table header
|
# specified by the Paradox table header
|
||||||
# West European encoding
|
# West European encoding
|
||||||
elif control_str == 'fcharset0':
|
elif control_str == 'fcharset0':
|
||||||
encoding = u'cp1252'
|
encoding = u'cp1252'
|
||||||
|
@ -163,7 +163,7 @@ class EasyWorshipSongImport(SongImport):
|
||||||
if code_page == 852:
|
if code_page == 852:
|
||||||
self.encoding = u'cp1250'
|
self.encoding = u'cp1250'
|
||||||
# The following codepage to actual encoding mappings have not been
|
# The following codepage to actual encoding mappings have not been
|
||||||
# observed, but merely guessed. Actual example files are needed.
|
# observed, but merely guessed. Actual example files are needed.
|
||||||
elif code_page == 737:
|
elif code_page == 737:
|
||||||
self.encoding = u'cp1253'
|
self.encoding = u'cp1253'
|
||||||
elif code_page == 775:
|
elif code_page == 775:
|
||||||
|
|
|
@ -296,7 +296,7 @@ class FoilPresenter(object):
|
||||||
u'Text +u\.?n?d? +Musik', u'T & M', u'Melodie und Satz',
|
u'Text +u\.?n?d? +Musik', u'T & M', u'Melodie und Satz',
|
||||||
u'Text[\w\,\. ]*:', u'Melodie', u'Musik', u'Satz',
|
u'Text[\w\,\. ]*:', u'Melodie', u'Musik', u'Satz',
|
||||||
u'Weise', u'[dD]eutsch', u'[dD]t[\.\:]', u'Englisch',
|
u'Weise', u'[dD]eutsch', u'[dD]t[\.\:]', u'Englisch',
|
||||||
u'[oO]riginal', u'Bearbeitung', u'[R|r]efrain']
|
u'[oO]riginal', u'Bearbeitung', u'[R|r]efrain']
|
||||||
for marker in markers:
|
for marker in markers:
|
||||||
copyright = re.compile(marker).sub(u'<marker>', copyright, re.U)
|
copyright = re.compile(marker).sub(u'<marker>', copyright, re.U)
|
||||||
copyright = re.compile(u'(?<=<marker>) *:').sub(u'', copyright)
|
copyright = re.compile(u'(?<=<marker>) *:').sub(u'', copyright)
|
||||||
|
@ -411,7 +411,7 @@ class FoilPresenter(object):
|
||||||
temp_verse_order_backup = []
|
temp_verse_order_backup = []
|
||||||
temp_sortnr_backup = 1
|
temp_sortnr_backup = 1
|
||||||
temp_sortnr_liste = []
|
temp_sortnr_liste = []
|
||||||
versenumber = {u'V': 1, u'C': 1, u'B': 1, u'E': 1, u'O': 1, u'I': 1,
|
versenumber = {u'V': 1, u'C': 1, u'B': 1, u'E': 1, u'O': 1, u'I': 1,
|
||||||
u'P': 1}
|
u'P': 1}
|
||||||
for strophe in foilpresenterfolie.strophen.strophe:
|
for strophe in foilpresenterfolie.strophen.strophe:
|
||||||
text = self._child(strophe.text_)
|
text = self._child(strophe.text_)
|
||||||
|
|
|
@ -199,7 +199,7 @@ class SongMediaItem(MediaManagerItem):
|
||||||
"""
|
"""
|
||||||
log.debug(u'onSongListLoad')
|
log.debug(u'onSongListLoad')
|
||||||
# Called to redisplay the song list screen edit from a search
|
# Called to redisplay the song list screen edit from a search
|
||||||
# or from the exit of the Song edit dialog. If remote editing is active
|
# or from the exit of the Song edit dialog. If remote editing is active
|
||||||
# Trigger it and clean up so it will not update again.
|
# Trigger it and clean up so it will not update again.
|
||||||
if self.remoteTriggered == u'L':
|
if self.remoteTriggered == u'L':
|
||||||
self.onAddClick()
|
self.onAddClick()
|
||||||
|
|
|
@ -347,7 +347,7 @@ class SongImport(QtCore.QObject):
|
||||||
"""
|
"""
|
||||||
For debugging
|
For debugging
|
||||||
"""
|
"""
|
||||||
print u'========================================' \
|
print u'========================================' \
|
||||||
+ u'========================================'
|
+ u'========================================'
|
||||||
print u'TITLE: ' + self.title
|
print u'TITLE: ' + self.title
|
||||||
print u'ALT TITLE: ' + self.alternate_title
|
print u'ALT TITLE: ' + self.alternate_title
|
||||||
|
|
Loading…
Reference in New Issue