forked from openlp/openlp
Implemented recommended changes
This commit is contained in:
parent
9516588f62
commit
184b0e538a
@ -313,7 +313,7 @@ class SongFormat(object):
|
|||||||
},
|
},
|
||||||
ProPresenter: {
|
ProPresenter: {
|
||||||
'class': ProPresenterImport,
|
'class': ProPresenterImport,
|
||||||
'name': 'ProPresenter 4 -> 6',
|
'name': 'ProPresenter 4, 5 and 6',
|
||||||
'prefix': 'proPresenter',
|
'prefix': 'proPresenter',
|
||||||
'filter': '%s (*.pro4 *.pro5 *.pro6)' % translate('SongsPlugin.ImportWizardForm', 'ProPresenter Song Files')
|
'filter': '%s (*.pro4 *.pro5 *.pro6)' % translate('SongsPlugin.ImportWizardForm', 'ProPresenter Song Files')
|
||||||
},
|
},
|
||||||
|
@ -39,7 +39,7 @@ log = logging.getLogger(__name__)
|
|||||||
class ProPresenterImport(SongImport):
|
class ProPresenterImport(SongImport):
|
||||||
"""
|
"""
|
||||||
The :class:`ProPresenterImport` class provides OpenLP with the
|
The :class:`ProPresenterImport` class provides OpenLP with the
|
||||||
ability to import ProPresenter *4-6* song files.
|
ability to import ProPresenter 4-6 song files.
|
||||||
"""
|
"""
|
||||||
def do_import(self):
|
def do_import(self):
|
||||||
self.import_wizard.progress_bar.setMaximum(len(self.import_source))
|
self.import_wizard.progress_bar.setMaximum(len(self.import_source))
|
||||||
@ -52,7 +52,6 @@ class ProPresenterImport(SongImport):
|
|||||||
|
|
||||||
def process_song(self, root, filename):
|
def process_song(self, root, filename):
|
||||||
self.set_defaults()
|
self.set_defaults()
|
||||||
self.title = os.path.basename(filename)
|
|
||||||
|
|
||||||
# Extract ProPresenter versionNumber
|
# Extract ProPresenter versionNumber
|
||||||
try:
|
try:
|
||||||
@ -61,8 +60,15 @@ class ProPresenterImport(SongImport):
|
|||||||
log.debug('ProPresenter versionNumber invalid or missing')
|
log.debug('ProPresenter versionNumber invalid or missing')
|
||||||
return
|
return
|
||||||
|
|
||||||
# Common settings
|
# Title
|
||||||
|
self.title = root.get('CCLISongTitle')
|
||||||
|
if not self.title or self.title == '':
|
||||||
|
self.title = os.path.basename(filename)
|
||||||
|
if self.title[-5:-1] == '.pro':
|
||||||
|
self.title = self.title[:-5]
|
||||||
|
# Notes
|
||||||
self.comments = root.get('notes')
|
self.comments = root.get('notes')
|
||||||
|
# Author
|
||||||
for author_key in ['author', 'CCLIAuthor', 'artist', 'CCLIArtistCredits']:
|
for author_key in ['author', 'CCLIAuthor', 'artist', 'CCLIArtistCredits']:
|
||||||
author = root.get(author_key)
|
author = root.get(author_key)
|
||||||
if author and len(author) > 0:
|
if author and len(author) > 0:
|
||||||
@ -70,8 +76,6 @@ class ProPresenterImport(SongImport):
|
|||||||
|
|
||||||
# ProPresenter 4
|
# ProPresenter 4
|
||||||
if(self.version >= 400 and self.version < 500):
|
if(self.version >= 400 and self.version < 500):
|
||||||
if self.title.endswith('.pro4'):
|
|
||||||
self.title = self.title[:-5]
|
|
||||||
self.copyright = root.get('CCLICopyrightInfo')
|
self.copyright = root.get('CCLICopyrightInfo')
|
||||||
self.ccli_number = root.get('CCLILicenseNumber')
|
self.ccli_number = root.get('CCLILicenseNumber')
|
||||||
count = 0
|
count = 0
|
||||||
@ -87,8 +91,6 @@ class ProPresenterImport(SongImport):
|
|||||||
|
|
||||||
# ProPresenter 5
|
# ProPresenter 5
|
||||||
elif(self.version >= 500 and self.version < 600):
|
elif(self.version >= 500 and self.version < 600):
|
||||||
if self.title.endswith('.pro5'):
|
|
||||||
self.title = self.title[:-5]
|
|
||||||
self.copyright = root.get('CCLICopyrightInfo')
|
self.copyright = root.get('CCLICopyrightInfo')
|
||||||
self.ccli_number = root.get('CCLILicenseNumber')
|
self.ccli_number = root.get('CCLILicenseNumber')
|
||||||
count = 0
|
count = 0
|
||||||
@ -105,8 +107,6 @@ class ProPresenterImport(SongImport):
|
|||||||
|
|
||||||
# ProPresenter 6
|
# ProPresenter 6
|
||||||
elif(self.version >= 600 and self.version < 700):
|
elif(self.version >= 600 and self.version < 700):
|
||||||
if self.title.endswith('.pro6'):
|
|
||||||
self.title = self.title[:-5]
|
|
||||||
self.copyright = root.get('CCLICopyrightYear')
|
self.copyright = root.get('CCLICopyrightYear')
|
||||||
self.ccli_number = root.get('CCLISongNumber')
|
self.ccli_number = root.get('CCLISongNumber')
|
||||||
count = 0
|
count = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user