From 54ed6aeea02a6a5076049d8e6c1334b52b71e94e Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Sun, 20 Apr 2014 21:03:35 +0200 Subject: [PATCH] Made the EWS import a seperate point. Also some small updates to comments. --- openlp/plugins/songs/lib/ewimport.py | 10 +----- openlp/plugins/songs/lib/importer.py | 46 ++++++++++++++++------------ 2 files changed, 27 insertions(+), 29 deletions(-) diff --git a/openlp/plugins/songs/lib/ewimport.py b/openlp/plugins/songs/lib/ewimport.py index 1bbe5fed4..faa4122c8 100644 --- a/openlp/plugins/songs/lib/ewimport.py +++ b/openlp/plugins/songs/lib/ewimport.py @@ -78,8 +78,6 @@ class EasyWorshipSongImport(SongImport): def do_import(self): """ Determines the type of file to import and calls the appropiate method - - :return: """ if self.import_source.lower().endswith('ews'): self.import_ews() @@ -92,8 +90,6 @@ class EasyWorshipSongImport(SongImport): The full spec of the ews files can be found here: https://github.com/meinders/lithium-ews/blob/master/docs/ews%20file%20format.md or here: http://wiki.openlp.org/Development:EasyWorship_EWS_Format - - :return: """ # Open ews file if it exists if not os.path.isfile(self.import_source): @@ -196,8 +192,6 @@ class EasyWorshipSongImport(SongImport): def import_db(self): """ Import the songs from the database - - :return: """ # Open the DB and MB files if they exist import_source_mb = self.import_source.replace('.DB', '.MB') @@ -322,7 +316,6 @@ class EasyWorshipSongImport(SongImport): :param authors: String with authons :param words: Bytes with rtf-encoding - :return: """ if authors: # Split up the authors @@ -380,7 +373,6 @@ class EasyWorshipSongImport(SongImport): Find a field in the descriptions :param field_name: field to find - :return: """ return [i for i, x in enumerate(self.field_descriptions) if x.name == field_name][0] @@ -417,7 +409,7 @@ class EasyWorshipSongImport(SongImport): Extract the field :param field_desc_index: Field index value - :return: + :return: The field value """ field = self.fields[field_desc_index] field_desc = self.field_descriptions[field_desc_index] diff --git a/openlp/plugins/songs/lib/importer.py b/openlp/plugins/songs/lib/importer.py index 0f04075d5..ed32a43ee 100644 --- a/openlp/plugins/songs/lib/importer.py +++ b/openlp/plugins/songs/lib/importer.py @@ -153,19 +153,20 @@ class SongFormat(object): CCLI = 3 DreamBeam = 4 EasySlides = 5 - EasyWorship = 6 - FoilPresenter = 7 - MediaShout = 8 - OpenSong = 9 - PowerSong = 10 - SongBeamer = 11 - SongPro = 12 - SongShowPlus = 13 - SongsOfFellowship = 14 - SundayPlus = 15 - WordsOfWorship = 16 - WorshipCenterPro = 17 - ZionWorx = 18 + EasyWorshipDB = 6 + EasyWorshipService = 7 + FoilPresenter = 8 + MediaShout = 9 + OpenSong = 10 + PowerSong = 11 + SongBeamer = 12 + SongPro = 13 + SongShowPlus = 14 + SongsOfFellowship = 15 + SundayPlus = 16 + WordsOfWorship = 17 + WorshipCenterPro = 18 + ZionWorx = 19 # Set optional attribute defaults __defaults__ = { @@ -224,15 +225,19 @@ class SongFormat(object): 'selectMode': SongFormatSelect.SingleFile, 'filter': '%s (*.xml)' % translate('SongsPlugin.ImportWizardForm', 'EasySlides XML File') }, - EasyWorship: { + EasyWorshipDB: { 'class': EasyWorshipSongImport, - 'name': 'EasyWorship', + 'name': 'EasyWorship Song Database', 'prefix': 'ew', 'selectMode': SongFormatSelect.SingleFile, - 'filter': '%s (*.db);; %s (*.ews)' % (translate('SongsPlugin.ImportWizardForm', - 'EasyWorship Song Database'), - translate('SongsPlugin.ImportWizardForm', - 'EasyWorship Service File')) + 'filter': '%s (*.db)' % translate('SongsPlugin.ImportWizardForm', 'EasyWorship Song Database') + }, + EasyWorshipService: { + 'class': EasyWorshipSongImport, + 'name': 'EasyWorship Service File', + 'prefix': 'ew', + 'selectMode': SongFormatSelect.SingleFile, + 'filter': '%s (*.ews)' % translate('SongsPlugin.ImportWizardForm', 'EasyWorship Service File') }, FoilPresenter: { 'class': FoilPresenterImport, @@ -344,7 +349,8 @@ class SongFormat(object): SongFormat.CCLI, SongFormat.DreamBeam, SongFormat.EasySlides, - SongFormat.EasyWorship, + SongFormat.EasyWorshipDB, + SongFormat.EasyWorshipService, SongFormat.FoilPresenter, SongFormat.MediaShout, SongFormat.OpenSong,