diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index 46ad0b773..be8f9bde1 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -226,7 +226,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): def onCurrentIdChanged(self, pageId): """ - Detects Page changes and updates as approprate. + Detects Page changes and updates as appropriate. """ enabled = self.page(pageId) == self.areaPositionPage self.setOption(QtGui.QWizard.HaveCustomButton1, enabled) diff --git a/openlp/plugins/songs/lib/easyslidesimport.py b/openlp/plugins/songs/lib/easyslidesimport.py index 6e3b937ed..c7c169a1e 100644 --- a/openlp/plugins/songs/lib/easyslidesimport.py +++ b/openlp/plugins/songs/lib/easyslidesimport.py @@ -48,15 +48,8 @@ class EasySlidesImport(SongImport): Initialise the class. """ SongImport.__init__(self, manager, **kwargs) - self.commit = True def doImport(self): - """ - Import either each of the files in self.importSources - each element of - which can be either a single opensong file, or a zipfile containing - multiple opensong files. If `self.commit` is set False, the - import will not be committed to the database (useful for test scripts). - """ log.info(u'Importing EasySlides XML file %s', self.importSource) parser = etree.XMLParser(remove_blank_text=True) parsed_file = etree.parse(self.importSource, parser) diff --git a/openlp/plugins/songs/lib/importer.py b/openlp/plugins/songs/lib/importer.py index 209539475..0c3a0f07f 100644 --- a/openlp/plugins/songs/lib/importer.py +++ b/openlp/plugins/songs/lib/importer.py @@ -109,6 +109,7 @@ class SongFormat(object): ``u'canDisable'`` Whether song format importer is disablable. + If ``True``, then ``u'disabledLabelText'`` must also be defined. ``u'availability'`` Whether song format importer is available. diff --git a/openlp/plugins/songs/lib/zionworximport.py b/openlp/plugins/songs/lib/zionworximport.py index 0e7a1b425..1a00b3a7c 100644 --- a/openlp/plugins/songs/lib/zionworximport.py +++ b/openlp/plugins/songs/lib/zionworximport.py @@ -37,6 +37,9 @@ from openlp.plugins.songs.lib.songimport import SongImport log = logging.getLogger(__name__) +# Used to strip control chars (except 10=LF, 13=CR) +CONTROL_CHARS_MAP = dict.fromkeys(range(10) + [11, 12] + range(14,32) + [127]) + class ZionWorxImport(SongImport): """ The :class:`ZionWorxImport` class provides the ability to import songs @@ -78,13 +81,10 @@ class ZionWorxImport(SongImport): """ Receive a CSV file (from a ZionWorx database dump) to import. """ - # Used to strip control chars (10=LF, 13=CR, 127=DEL) - self.control_chars_map = dict.fromkeys( - range(10) + [11, 12] + range(14,32) + [127]) with open(self.importSource, 'rb') as songs_file: - fieldnames = [u'SongNum', u'Title1', u'Title2', u'Lyrics', + field_names = [u'SongNum', u'Title1', u'Title2', u'Lyrics', u'Writer', u'Copyright', u'Keywords', u'DefaultStyle'] - songs_reader = csv.DictReader(songs_file, fieldnames) + songs_reader = csv.DictReader(songs_file, field_names) try: records = list(songs_reader) except csv.Error, e: @@ -140,4 +140,4 @@ class ZionWorxImport(SongImport): """ # This encoding choice seems OK. ZionWorx has no option for setting the # encoding for its songs, so we assume encoding is always the same. - return unicode(str, u'cp1252').translate(self.control_chars_map) + return unicode(str, u'cp1252').translate(CONTROL_CHARS_MAP)