Merge lp:~phill-ridout/openlp/TODOne into lp:openlp

Proposed by Phill
Status: Superseded
Proposed branch: lp:~phill-ridout/openlp/TODOne
Merge into: lp:openlp
Diff against target: 1433 lines (+132/-325)
52 files modified
openlp/core/__init__.py (+1/-2)
openlp/core/common/languagemanager.py (+2/-2)
openlp/core/common/uistrings.py (+0/-2)
openlp/core/lib/exceptions.py (+0/-1)
openlp/core/lib/imagemanager.py (+3/-3)
openlp/core/ui/advancedtab.py (+1/-3)
openlp/core/ui/firsttimeform.py (+0/-4)
openlp/core/ui/formattingtagcontroller.py (+1/-2)
openlp/core/ui/formattingtagform.py (+2/-4)
openlp/core/ui/lib/pathedit.py (+1/-1)
openlp/core/ui/lib/wizard.py (+4/-4)
openlp/core/ui/mainwindow.py (+1/-3)
openlp/core/ui/media/mediacontroller.py (+4/-3)
openlp/core/ui/pluginform.py (+0/-2)
openlp/core/ui/shortcutlistform.py (+1/-3)
openlp/core/ui/thememanager.py (+5/-10)
openlp/plugins/alerts/alertsplugin.py (+13/-11)
openlp/plugins/alerts/forms/alertform.py (+2/-6)
openlp/plugins/bibles/forms/bibleimportform.py (+2/-2)
openlp/plugins/bibles/lib/__init__.py (+7/-9)
openlp/plugins/bibles/lib/db.py (+2/-3)
openlp/plugins/bibles/lib/importers/http.py (+6/-0)
openlp/plugins/custom/lib/mediaitem.py (+1/-3)
openlp/plugins/images/lib/mediaitem.py (+2/-5)
openlp/plugins/presentations/lib/pdfcontroller.py (+1/-3)
openlp/plugins/presentations/lib/powerpointcontroller.py (+21/-38)
openlp/plugins/remotes/remoteplugin.py (+1/-2)
openlp/plugins/songs/forms/duplicatesongremovalform.py (+4/-5)
openlp/plugins/songs/forms/editsongform.py (+4/-8)
openlp/plugins/songs/forms/songexportform.py (+3/-4)
openlp/plugins/songs/forms/songimportform.py (+7/-10)
openlp/plugins/songs/forms/songselectform.py (+2/-4)
openlp/plugins/songs/lib/importer.py (+1/-1)
openlp/plugins/songs/lib/importers/foilpresenter.py (+2/-2)
openlp/plugins/songs/lib/importers/openlp.py (+2/-4)
openlp/plugins/songs/lib/importers/openlyrics.py (+2/-2)
openlp/plugins/songs/lib/importers/powerpraise.py (+2/-2)
openlp/plugins/songs/lib/importers/presentationmanager.py (+2/-2)
openlp/plugins/songs/lib/importers/propresenter.py (+2/-2)
openlp/plugins/songs/lib/importers/songimport.py (+1/-2)
openlp/plugins/songs/lib/importers/songshowplus.py (+1/-2)
openlp/plugins/songs/lib/mediaitem.py (+1/-2)
openlp/plugins/songs/lib/openlyricsxml.py (+7/-14)
openlp/plugins/songusage/forms/songusagedeleteform.py (+1/-3)
tests/functional/openlp_core_ui/test_formattingtagsform.py (+0/-6)
tests/functional/openlp_core_ui/test_thememanager.py (+2/-2)
tests/functional/openlp_plugins/bibles/test_bibleserver.py (+0/-34)
tests/functional/openlp_plugins/bibles/test_mediaitem.py (+0/-5)
tests/functional/openlp_plugins/presentations/test_pptviewcontroller.py (+0/-23)
tests/functional/openlp_plugins/presentations/test_presentationcontroller.py (+0/-39)
tests/functional/openlp_plugins/songs/test_foilpresenterimport.py (+0/-12)
tests/functional/openlp_plugins/songs/test_songselect.py (+2/-4)
To merge this branch: bzr merge lp:~phill-ridout/openlp/TODOne
Reviewer Review Type Date Requested Status
Raoul Snyman Needs Fixing
Review via email: mp+324887@code.launchpad.net

This proposal supersedes a proposal from 2017-05-30.

This proposal has been superseded by a proposal from 2017-06-01.

To post a comment you must log in.
Revision history for this message
Raoul Snyman (raoul-snyman) wrote : Posted in a previous version of this proposal

Just one minor edit.

review: Needs Fixing
Revision history for this message
Raoul Snyman (raoul-snyman) wrote :

I'm afraid you have a conflict :-(

Text conflict in openlp/core/ui/lib/pathedit.py

review: Needs Fixing
lp:~phill-ridout/openlp/TODOne updated
2744. By Phill

Head

2745. By Phill

HEAD

2746. By Phill

HEAD

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'openlp/core/__init__.py'
--- openlp/core/__init__.py 2017-04-11 08:05:13 +0000
+++ openlp/core/__init__.py 2017-06-01 06:24:55 +0000
@@ -251,8 +251,7 @@
251 if QtWidgets.QMessageBox.question(None, translate('OpenLP', 'Backup'),251 if QtWidgets.QMessageBox.question(None, translate('OpenLP', 'Backup'),
252 translate('OpenLP', 'OpenLP has been upgraded, do you want to create\n'252 translate('OpenLP', 'OpenLP has been upgraded, do you want to create\n'
253 'a backup of the old data folder?'),253 'a backup of the old data folder?'),
254 QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No,254 defaultButton=QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.Yes:
255 QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.Yes:
256 # Create copy of data folder255 # Create copy of data folder
257 data_folder_path = AppLocation.get_data_path()256 data_folder_path = AppLocation.get_data_path()
258 timestamp = time.strftime("%Y%m%d-%H%M%S")257 timestamp = time.strftime("%Y%m%d-%H%M%S")
259258
=== modified file 'openlp/core/common/languagemanager.py'
--- openlp/core/common/languagemanager.py 2017-03-28 00:36:54 +0000
+++ openlp/core/common/languagemanager.py 2017-06-01 06:24:55 +0000
@@ -140,8 +140,8 @@
140 reg_ex = QtCore.QRegExp("^.*i18n/(.*).qm")140 reg_ex = QtCore.QRegExp("^.*i18n/(.*).qm")
141 if reg_ex.exactMatch(qmf):141 if reg_ex.exactMatch(qmf):
142 name = '{regex}'.format(regex=reg_ex.cap(1))142 name = '{regex}'.format(regex=reg_ex.cap(1))
143 # TODO: Test before converting to python3 string format143 LanguageManager.__qm_list__[
144 LanguageManager.__qm_list__['%#2i %s' % (counter + 1, LanguageManager.language_name(qmf))] = name144 '{count:>2i} {name}'.format(count=counter + 1, name=LanguageManager.language_name(qmf))] = name
145145
146 @staticmethod146 @staticmethod
147 def get_qm_list():147 def get_qm_list():
148148
=== modified file 'openlp/core/common/uistrings.py'
--- openlp/core/common/uistrings.py 2017-01-08 19:12:12 +0000
+++ openlp/core/common/uistrings.py 2017-06-01 06:24:55 +0000
@@ -154,8 +154,6 @@
154 self.Split = translate('OpenLP.Ui', 'Optional &Split')154 self.Split = translate('OpenLP.Ui', 'Optional &Split')
155 self.SplitToolTip = translate('OpenLP.Ui',155 self.SplitToolTip = translate('OpenLP.Ui',
156 'Split a slide into two only if it does not fit on the screen as one slide.')156 'Split a slide into two only if it does not fit on the screen as one slide.')
157 # TODO: WHERE is this used at? cannot find where it's used at in code.
158 self.StartTimeCode = translate('OpenLP.Ui', 'Start {code}')
159 self.StopPlaySlidesInLoop = translate('OpenLP.Ui', 'Stop Play Slides in Loop')157 self.StopPlaySlidesInLoop = translate('OpenLP.Ui', 'Stop Play Slides in Loop')
160 self.StopPlaySlidesToEnd = translate('OpenLP.Ui', 'Stop Play Slides to End')158 self.StopPlaySlidesToEnd = translate('OpenLP.Ui', 'Stop Play Slides to End')
161 self.Theme = translate('OpenLP.Ui', 'Theme', 'Singular')159 self.Theme = translate('OpenLP.Ui', 'Theme', 'Singular')
162160
=== modified file 'openlp/core/lib/exceptions.py'
--- openlp/core/lib/exceptions.py 2016-12-31 11:01:36 +0000
+++ openlp/core/lib/exceptions.py 2017-06-01 06:24:55 +0000
@@ -24,7 +24,6 @@
24"""24"""
2525
2626
27# TODO: Test __init__ & __str__
28class ValidationError(Exception):27class ValidationError(Exception):
29 """28 """
30 The :class:`~openlp.core.lib.exceptions.ValidationError` exception provides a custom exception for validating29 The :class:`~openlp.core.lib.exceptions.ValidationError` exception provides a custom exception for validating
3130
=== modified file 'openlp/core/lib/imagemanager.py'
--- openlp/core/lib/imagemanager.py 2016-12-31 11:01:36 +0000
+++ openlp/core/lib/imagemanager.py 2017-06-01 06:24:55 +0000
@@ -110,6 +110,8 @@
110 :param width: The width of the image, defaults to -1 meaning that the screen width will be used.110 :param width: The width of the image, defaults to -1 meaning that the screen width will be used.
111 :param height: The height of the image, defaults to -1 meaning that the screen height will be used.111 :param height: The height of the image, defaults to -1 meaning that the screen height will be used.
112 """112 """
113 if not os.path.exists(path):
114 raise FileNotFoundError('{path} not found'.format(path=path))
113 self.path = path115 self.path = path
114 self.image = None116 self.image = None
115 self.image_bytes = None117 self.image_bytes = None
@@ -119,9 +121,7 @@
119 self.timestamp = 0121 self.timestamp = 0
120 self.width = width122 self.width = width
121 self.height = height123 self.height = height
122 # FIXME: We assume that the path exist. The caller has to take care that it exists!124 self.timestamp = os.stat(path).st_mtime
123 if os.path.exists(path):
124 self.timestamp = os.stat(path).st_mtime
125 self.secondary_priority = Image.secondary_priority125 self.secondary_priority = Image.secondary_priority
126 Image.secondary_priority += 1126 Image.secondary_priority += 1
127127
128128
=== modified file 'openlp/core/ui/advancedtab.py'
--- openlp/core/ui/advancedtab.py 2017-05-22 18:22:43 +0000
+++ openlp/core/ui/advancedtab.py 2017-06-01 06:24:55 +0000
@@ -495,9 +495,7 @@
495 'location of the OpenLP data directory to:\n\n{path}'495 'location of the OpenLP data directory to:\n\n{path}'
496 '\n\nThe data directory will be changed when OpenLP is '496 '\n\nThe data directory will be changed when OpenLP is '
497 'closed.').format(path=new_data_path),497 'closed.').format(path=new_data_path),
498 QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Yes |498 defaultButton=QtWidgets.QMessageBox.No)
499 QtWidgets.QMessageBox.No),
500 QtWidgets.QMessageBox.No)
501 if answer != QtWidgets.QMessageBox.Yes:499 if answer != QtWidgets.QMessageBox.Yes:
502 self.data_directory_path_edit.path = AppLocation.get_data_path()500 self.data_directory_path_edit.path = AppLocation.get_data_path()
503 return501 return
504502
=== modified file 'openlp/core/ui/firsttimeform.py'
--- openlp/core/ui/firsttimeform.py 2016-12-31 11:01:36 +0000
+++ openlp/core/ui/firsttimeform.py 2017-06-01 06:24:55 +0000
@@ -206,7 +206,6 @@
206 trace_error_handler(log)206 trace_error_handler(log)
207 self.update_screen_list_combo()207 self.update_screen_list_combo()
208 self.application.process_events()208 self.application.process_events()
209 # TODO: Tested at home
210 self.downloading = translate('OpenLP.FirstTimeWizard', 'Downloading {name}...')209 self.downloading = translate('OpenLP.FirstTimeWizard', 'Downloading {name}...')
211 if self.has_run_wizard:210 if self.has_run_wizard:
212 self.songs_check_box.setChecked(self.plugin_manager.get_plugin_by_name('songs').is_active())211 self.songs_check_box.setChecked(self.plugin_manager.get_plugin_by_name('songs').is_active())
@@ -563,7 +562,6 @@
563 item = self.songs_list_widget.item(i)562 item = self.songs_list_widget.item(i)
564 if item.checkState() == QtCore.Qt.Checked:563 if item.checkState() == QtCore.Qt.Checked:
565 filename, sha256 = item.data(QtCore.Qt.UserRole)564 filename, sha256 = item.data(QtCore.Qt.UserRole)
566 # TODO: Tested at home
567 self._increment_progress_bar(self.downloading.format(name=filename), 0)565 self._increment_progress_bar(self.downloading.format(name=filename), 0)
568 self.previous_size = 0566 self.previous_size = 0
569 destination = os.path.join(songs_destination, str(filename))567 destination = os.path.join(songs_destination, str(filename))
@@ -576,7 +574,6 @@
576 item = bibles_iterator.value()574 item = bibles_iterator.value()
577 if item.parent() and item.checkState(0) == QtCore.Qt.Checked:575 if item.parent() and item.checkState(0) == QtCore.Qt.Checked:
578 bible, sha256 = item.data(0, QtCore.Qt.UserRole)576 bible, sha256 = item.data(0, QtCore.Qt.UserRole)
579 # TODO: Tested at home
580 self._increment_progress_bar(self.downloading.format(name=bible), 0)577 self._increment_progress_bar(self.downloading.format(name=bible), 0)
581 self.previous_size = 0578 self.previous_size = 0
582 if not url_get_file(self, '{path}{name}'.format(path=self.bibles_url, name=bible),579 if not url_get_file(self, '{path}{name}'.format(path=self.bibles_url, name=bible),
@@ -589,7 +586,6 @@
589 item = self.themes_list_widget.item(i)586 item = self.themes_list_widget.item(i)
590 if item.checkState() == QtCore.Qt.Checked:587 if item.checkState() == QtCore.Qt.Checked:
591 theme, sha256 = item.data(QtCore.Qt.UserRole)588 theme, sha256 = item.data(QtCore.Qt.UserRole)
592 # TODO: Tested at home
593 self._increment_progress_bar(self.downloading.format(name=theme), 0)589 self._increment_progress_bar(self.downloading.format(name=theme), 0)
594 self.previous_size = 0590 self.previous_size = 0
595 if not url_get_file(self, '{path}{name}'.format(path=self.themes_url, name=theme),591 if not url_get_file(self, '{path}{name}'.format(path=self.themes_url, name=theme),
596592
=== modified file 'openlp/core/ui/formattingtagcontroller.py'
--- openlp/core/ui/formattingtagcontroller.py 2016-12-31 11:01:36 +0000
+++ openlp/core/ui/formattingtagcontroller.py 2017-06-01 06:24:55 +0000
@@ -130,8 +130,7 @@
130 elif not match.group('empty'):130 elif not match.group('empty'):
131 end_tags.append(tag)131 end_tags.append(tag)
132 match = self.html_tag_regex.search(start_html, match.end())132 match = self.html_tag_regex.search(start_html, match.end())
133 # TODO: Verify format() works with lambda133 return ''.join(map(lambda tag: '</{tag}>'.format(tag=tag), reversed(end_tags)))
134 return ''.join(map(lambda tag: '</%s>' % tag, reversed(end_tags)))
135134
136 def start_tag_changed(self, start_html, end_html):135 def start_tag_changed(self, start_html, end_html):
137 """136 """
138137
=== modified file 'openlp/core/ui/formattingtagform.py'
--- openlp/core/ui/formattingtagform.py 2016-12-31 11:01:36 +0000
+++ openlp/core/ui/formattingtagform.py 2017-06-01 06:24:55 +0000
@@ -122,8 +122,7 @@
122 self.tag_table_widget.item(count, 2).text(),122 self.tag_table_widget.item(count, 2).text(),
123 self.tag_table_widget.item(count, 3).text())123 self.tag_table_widget.item(count, 3).text())
124 if error:124 if error:
125 QtWidgets.QMessageBox.warning(self, translate('OpenLP.FormattingTagForm', 'Validation Error'), error,125 QtWidgets.QMessageBox.warning(self, translate('OpenLP.FormattingTagForm', 'Validation Error'), error)
126 QtWidgets.QMessageBox.Ok)
127 self.tag_table_widget.selectRow(count)126 self.tag_table_widget.selectRow(count)
128 return127 return
129 count += 1128 count += 1
@@ -198,6 +197,5 @@
198 if tag:197 if tag:
199 self.tag_table_widget.setItem(pre_row, 3, QtWidgets.QTableWidgetItem(tag))198 self.tag_table_widget.setItem(pre_row, 3, QtWidgets.QTableWidgetItem(tag))
200 if errors:199 if errors:
201 QtWidgets.QMessageBox.warning(self, translate('OpenLP.FormattingTagForm', 'Validation Error'), errors,200 QtWidgets.QMessageBox.warning(self, translate('OpenLP.FormattingTagForm', 'Validation Error'), errors)
202 QtWidgets.QMessageBox.Ok)
203 self.tag_table_widget.resizeRowsToContents()201 self.tag_table_widget.resizeRowsToContents()
204202
=== modified file 'openlp/core/ui/lib/pathedit.py'
--- openlp/core/ui/lib/pathedit.py 2017-05-30 20:50:26 +0000
+++ openlp/core/ui/lib/pathedit.py 2017-06-01 06:24:55 +0000
@@ -48,7 +48,7 @@
48 :type parent: QWidget or None48 :type parent: QWidget or None
4949
50 :param dialog_caption: Used to customise the caption in the QFileDialog.50 :param dialog_caption: Used to customise the caption in the QFileDialog.
51 :param dialog_caption: str51 :type dialog_caption: str
5252
53 :param default_path: The default path. This is set as the path when the revert button is clicked53 :param default_path: The default path. This is set as the path when the revert button is clicked
54 :type default_path: str54 :type default_path: str
5555
=== modified file 'openlp/core/ui/lib/wizard.py'
--- openlp/core/ui/lib/wizard.py 2016-12-31 11:01:36 +0000
+++ openlp/core/ui/lib/wizard.py 2017-06-01 06:24:55 +0000
@@ -50,13 +50,13 @@
50 # These strings should need a good reason to be retranslated elsewhere.50 # These strings should need a good reason to be retranslated elsewhere.
51 FinishedImport = translate('OpenLP.Ui', 'Finished import.')51 FinishedImport = translate('OpenLP.Ui', 'Finished import.')
52 FormatLabel = translate('OpenLP.Ui', 'Format:')52 FormatLabel = translate('OpenLP.Ui', 'Format:')
53 HeaderStyle = '<span style="font-size:14pt; font-weight:600;">%s</span>'53 HeaderStyle = '<span style="font-size:14pt; font-weight:600;">{text}</span>'
54 Importing = translate('OpenLP.Ui', 'Importing')54 Importing = translate('OpenLP.Ui', 'Importing')
55 ImportingType = translate('OpenLP.Ui', 'Importing "%s"...')55 ImportingType = translate('OpenLP.Ui', 'Importing "{source}"...')
56 ImportSelect = translate('OpenLP.Ui', 'Select Import Source')56 ImportSelect = translate('OpenLP.Ui', 'Select Import Source')
57 ImportSelectLong = translate('OpenLP.Ui', 'Select the import format and the location to import from.')57 ImportSelectLong = translate('OpenLP.Ui', 'Select the import format and the location to import from.')
58 OpenTypeFile = translate('OpenLP.Ui', 'Open %s File')58 OpenTypeFile = translate('OpenLP.Ui', 'Open {file_type} File')
59 OpenTypeFolder = translate('OpenLP.Ui', 'Open %s Folder')59 OpenTypeFolder = translate('OpenLP.Ui', 'Open {folder_name} Folder')
60 PercentSymbolFormat = translate('OpenLP.Ui', '%p%')60 PercentSymbolFormat = translate('OpenLP.Ui', '%p%')
61 Ready = translate('OpenLP.Ui', 'Ready.')61 Ready = translate('OpenLP.Ui', 'Ready.')
62 StartingImport = translate('OpenLP.Ui', 'Starting import...')62 StartingImport = translate('OpenLP.Ui', 'Starting import...')
6363
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py 2017-03-23 04:43:13 +0000
+++ openlp/core/ui/mainwindow.py 2017-06-01 06:24:55 +0000
@@ -920,8 +920,7 @@
920 QtWidgets.QMessageBox.information(self, translate('OpenLP.MainWindow', 'Import settings'),920 QtWidgets.QMessageBox.information(self, translate('OpenLP.MainWindow', 'Import settings'),
921 translate('OpenLP.MainWindow',921 translate('OpenLP.MainWindow',
922 'OpenLP will now close. Imported settings will '922 'OpenLP will now close. Imported settings will '
923 'be applied the next time you start OpenLP.'),923 'be applied the next time you start OpenLP.'))
924 QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Ok))
925 self.settings_imported = True924 self.settings_imported = True
926 self.clean_up()925 self.clean_up()
927 QtCore.QCoreApplication.exit()926 QtCore.QCoreApplication.exit()
@@ -1316,7 +1315,6 @@
1316 self.recent_files_menu.clear()1315 self.recent_files_menu.clear()
1317 for file_id, filename in enumerate(recent_files_to_display):1316 for file_id, filename in enumerate(recent_files_to_display):
1318 log.debug('Recent file name: {name}'.format(name=filename))1317 log.debug('Recent file name: {name}'.format(name=filename))
1319 # TODO: Should be good
1320 action = create_action(self, '',1318 action = create_action(self, '',
1321 text='&{n} {name}'.format(n=file_id + 1,1319 text='&{n} {name}'.format(n=file_id + 1,
1322 name=os.path.splitext(os.path.basename(str(filename)))[0]),1320 name=os.path.splitext(os.path.basename(str(filename)))[0]),
13231321
=== modified file 'openlp/core/ui/media/mediacontroller.py'
--- openlp/core/ui/media/mediacontroller.py 2017-05-15 10:09:59 +0000
+++ openlp/core/ui/media/mediacontroller.py 2017-06-01 06:24:55 +0000
@@ -466,9 +466,10 @@
466 player = self.media_players[used_players[0]]466 player = self.media_players[used_players[0]]
467 if suffix not in player.video_extensions_list and suffix not in player.audio_extensions_list:467 if suffix not in player.video_extensions_list and suffix not in player.audio_extensions_list:
468 # Media could not be loaded correctly468 # Media could not be loaded correctly
469 critical_error_message_box(translate('MediaPlugin.MediaItem', 'Unsupported Media File'),469 critical_error_message_box(
470 translate('MediaPlugin.MediaItem', 'File %s not supported using player %s') %470 translate('MediaPlugin.MediaItem', 'Unsupported Media File'),
471 (service_item.get_frame_path(), used_players[0]))471 translate('MediaPlugin.MediaItem', 'File {file_path} not supported using player {player_name}'
472 ).format(file_path=service_item.get_frame_path(), player_name=used_players[0]))
472 return False473 return False
473 media_data = MediaInfoWrapper.parse(service_item.get_frame_path())474 media_data = MediaInfoWrapper.parse(service_item.get_frame_path())
474 # duration returns in milli seconds475 # duration returns in milli seconds
475476
=== modified file 'openlp/core/ui/pluginform.py'
--- openlp/core/ui/pluginform.py 2016-12-31 11:01:36 +0000
+++ openlp/core/ui/pluginform.py 2017-06-01 06:24:55 +0000
@@ -60,7 +60,6 @@
60 self._clear_details()60 self._clear_details()
61 self.programatic_change = True61 self.programatic_change = True
62 plugin_list_width = 062 plugin_list_width = 0
63 # TODO: Tested at home
64 for plugin in self.plugin_manager.plugins:63 for plugin in self.plugin_manager.plugins:
65 item = QtWidgets.QListWidgetItem(self.plugin_list_widget)64 item = QtWidgets.QListWidgetItem(self.plugin_list_widget)
66 # We do this just to make 100% sure the status is an integer as65 # We do this just to make 100% sure the status is an integer as
@@ -137,7 +136,6 @@
137 self.active_plugin.app_startup()136 self.active_plugin.app_startup()
138 else:137 else:
139 self.active_plugin.toggle_status(PluginStatus.Inactive)138 self.active_plugin.toggle_status(PluginStatus.Inactive)
140 # TODO: Tested at home
141 status_text = translate('OpenLP.PluginForm', '{name} (Inactive)')139 status_text = translate('OpenLP.PluginForm', '{name} (Inactive)')
142 if self.active_plugin.status == PluginStatus.Active:140 if self.active_plugin.status == PluginStatus.Active:
143 status_text = translate('OpenLP.PluginForm', '{name} (Active)')141 status_text = translate('OpenLP.PluginForm', '{name} (Active)')
144142
=== modified file 'openlp/core/ui/shortcutlistform.py'
--- openlp/core/ui/shortcutlistform.py 2016-12-31 11:01:36 +0000
+++ openlp/core/ui/shortcutlistform.py 2017-06-01 06:24:55 +0000
@@ -279,9 +279,7 @@
279 return279 return
280 if QtWidgets.QMessageBox.question(self, translate('OpenLP.ShortcutListDialog', 'Restore Default Shortcuts'),280 if QtWidgets.QMessageBox.question(self, translate('OpenLP.ShortcutListDialog', 'Restore Default Shortcuts'),
281 translate('OpenLP.ShortcutListDialog', 'Do you want to restore all '281 translate('OpenLP.ShortcutListDialog', 'Do you want to restore all '
282 'shortcuts to their defaults?'),282 'shortcuts to their defaults?')
283 QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Yes |
284 QtWidgets.QMessageBox.No)
285 ) == QtWidgets.QMessageBox.No:283 ) == QtWidgets.QMessageBox.No:
286 return284 return
287 self._adjust_button(self.primary_push_button, False, text='')285 self._adjust_button(self.primary_push_button, False, text='')
288286
=== modified file 'openlp/core/ui/thememanager.py'
--- openlp/core/ui/thememanager.py 2017-05-30 13:55:39 +0000
+++ openlp/core/ui/thememanager.py 2017-06-01 06:24:55 +0000
@@ -257,10 +257,9 @@
257 Renames an existing theme to a new name257 Renames an existing theme to a new name
258 :param field:258 :param field:
259 """259 """
260 # TODO: Check for delayed format() conversions
261 if self._validate_theme_action(translate('OpenLP.ThemeManager', 'You must select a theme to rename.'),260 if self._validate_theme_action(translate('OpenLP.ThemeManager', 'You must select a theme to rename.'),
262 translate('OpenLP.ThemeManager', 'Rename Confirmation'),261 translate('OpenLP.ThemeManager', 'Rename Confirmation'),
263 translate('OpenLP.ThemeManager', 'Rename %s theme?'), False, False):262 translate('OpenLP.ThemeManager', 'Rename {theme_name} theme?'), False, False):
264 item = self.theme_list_widget.currentItem()263 item = self.theme_list_widget.currentItem()
265 old_theme_name = item.data(QtCore.Qt.UserRole)264 old_theme_name = item.data(QtCore.Qt.UserRole)
266 self.file_rename_form.file_name_edit.setText(old_theme_name)265 self.file_rename_form.file_name_edit.setText(old_theme_name)
@@ -334,10 +333,9 @@
334 Delete a theme triggered by the UI.333 Delete a theme triggered by the UI.
335 :param field:334 :param field:
336 """335 """
337 # TODO: Verify delayed format() conversions
338 if self._validate_theme_action(translate('OpenLP.ThemeManager', 'You must select a theme to delete.'),336 if self._validate_theme_action(translate('OpenLP.ThemeManager', 'You must select a theme to delete.'),
339 translate('OpenLP.ThemeManager', 'Delete Confirmation'),337 translate('OpenLP.ThemeManager', 'Delete Confirmation'),
340 translate('OpenLP.ThemeManager', 'Delete %s theme?')):338 translate('OpenLP.ThemeManager', 'Delete {theme_name} theme?')):
341 item = self.theme_list_widget.currentItem()339 item = self.theme_list_widget.currentItem()
342 theme = item.text()340 theme = item.text()
343 row = self.theme_list_widget.row(item)341 row = self.theme_list_widget.row(item)
@@ -539,9 +537,7 @@
539 translate('OpenLP.ThemeManager',537 translate('OpenLP.ThemeManager',
540 'Theme {name} already exists. '538 'Theme {name} already exists. '
541 'Do you want to replace it?').format(name=theme_name),539 'Do you want to replace it?').format(name=theme_name),
542 QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Yes |540 defaultButton=QtWidgets.QMessageBox.No)
543 QtWidgets.QMessageBox.No),
544 QtWidgets.QMessageBox.No)
545 return ret == QtWidgets.QMessageBox.Yes541 return ret == QtWidgets.QMessageBox.Yes
546542
547 def unzip_theme(self, file_name, directory):543 def unzip_theme(self, file_name, directory):
@@ -785,9 +781,8 @@
785 # confirm deletion781 # confirm deletion
786 if confirm:782 if confirm:
787 answer = QtWidgets.QMessageBox.question(783 answer = QtWidgets.QMessageBox.question(
788 self, confirm_title, confirm_text % theme,784 self, confirm_title, confirm_text.format(theme_name=theme),
789 QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No),785 defaultButton=QtWidgets.QMessageBox.No)
790 QtWidgets.QMessageBox.No)
791 if answer == QtWidgets.QMessageBox.No:786 if answer == QtWidgets.QMessageBox.No:
792 return False787 return False
793 # should be the same unless default788 # should be the same unless default
794789
=== modified file 'openlp/plugins/alerts/alertsplugin.py'
--- openlp/plugins/alerts/alertsplugin.py 2016-12-31 11:01:36 +0000
+++ openlp/plugins/alerts/alertsplugin.py 2017-06-01 06:24:55 +0000
@@ -88,21 +88,20 @@
88 }88 }
89 }89 }
90"""90"""
91# TODO: Verify format() with variable templates
92CSS = """91CSS = """
93 #alert {92 #alert {{
94 position: absolute;93 position: absolute;
95 left: 0px;94 left: 0px;
96 top: 0px;95 top: 0px;
97 z-index: 10;96 z-index: 10;
98 width: 100%%;97 width: 100%;
99 vertical-align: %s;98 vertical-align: {vertical_align};
100 font-family: %s;99 font-family: {font_family};
101 font-size: %spt;100 font-size: {font_size:d}pt;
102 color: %s;101 color: {color};
103 background-color: %s;102 background-color: {background_color};
104 word-wrap: break-word;103 word-wrap: break-word;
105 }104 }}
106"""105"""
107106
108HTML = """107HTML = """
@@ -228,8 +227,11 @@
228 Add CSS to the main display.227 Add CSS to the main display.
229 """228 """
230 align = VerticalType.Names[self.settings_tab.location]229 align = VerticalType.Names[self.settings_tab.location]
231 return CSS % (align, self.settings_tab.font_face, self.settings_tab.font_size, self.settings_tab.font_color,230 return CSS.format(vertical_align=align,
232 self.settings_tab.background_color)231 font_family=self.settings_tab.font_face,
232 font_size=self.settings_tab.font_size,
233 color=self.settings_tab.font_color,
234 background_color=self.settings_tab.background_color)
233235
234 @staticmethod236 @staticmethod
235 def get_display_html():237 def get_display_html():
236238
=== modified file 'openlp/plugins/alerts/forms/alertform.py'
--- openlp/plugins/alerts/forms/alertform.py 2016-12-31 11:01:36 +0000
+++ openlp/plugins/alerts/forms/alertform.py 2017-06-01 06:24:55 +0000
@@ -180,9 +180,7 @@
180 translate('AlertsPlugin.AlertForm', 'No Parameter Found'),180 translate('AlertsPlugin.AlertForm', 'No Parameter Found'),
181 translate('AlertsPlugin.AlertForm',181 translate('AlertsPlugin.AlertForm',
182 'You have not entered a parameter to be replaced.\n'182 'You have not entered a parameter to be replaced.\n'
183 'Do you want to continue anyway?'),183 'Do you want to continue anyway?')
184 QtWidgets.QMessageBox.StandardButtons(
185 QtWidgets.QMessageBox.No | QtWidgets.QMessageBox.Yes)
186 ) == QtWidgets.QMessageBox.No:184 ) == QtWidgets.QMessageBox.No:
187 self.parameter_edit.setFocus()185 self.parameter_edit.setFocus()
188 return False186 return False
@@ -193,9 +191,7 @@
193 translate('AlertsPlugin.AlertForm', 'No Placeholder Found'),191 translate('AlertsPlugin.AlertForm', 'No Placeholder Found'),
194 translate('AlertsPlugin.AlertForm',192 translate('AlertsPlugin.AlertForm',
195 'The alert text does not contain \'<>\'.\n'193 'The alert text does not contain \'<>\'.\n'
196 'Do you want to continue anyway?'),194 'Do you want to continue anyway?')
197 QtWidgets.QMessageBox.StandardButtons(
198 QtWidgets.QMessageBox.No | QtWidgets.QMessageBox.Yes)
199 ) == QtWidgets.QMessageBox.No:195 ) == QtWidgets.QMessageBox.No:
200 self.parameter_edit.setFocus()196 self.parameter_edit.setFocus()
201 return False197 return False
202198
=== modified file 'openlp/plugins/bibles/forms/bibleimportform.py'
--- openlp/plugins/bibles/forms/bibleimportform.py 2017-05-12 21:05:50 +0000
+++ openlp/plugins/bibles/forms/bibleimportform.py 2017-06-01 06:24:55 +0000
@@ -421,8 +421,8 @@
421 Allow for localisation of the bible import wizard.421 Allow for localisation of the bible import wizard.
422 """422 """
423 self.setWindowTitle(translate('BiblesPlugin.ImportWizardForm', 'Bible Import Wizard'))423 self.setWindowTitle(translate('BiblesPlugin.ImportWizardForm', 'Bible Import Wizard'))
424 self.title_label.setText(WizardStrings.HeaderStyle % translate('OpenLP.Ui',424 self.title_label.setText(WizardStrings.HeaderStyle.format(text=translate('OpenLP.Ui',
425 'Welcome to the Bible Import Wizard'))425 'Welcome to the Bible Import Wizard')))
426 self.information_label.setText(426 self.information_label.setText(
427 translate('BiblesPlugin.ImportWizardForm',427 translate('BiblesPlugin.ImportWizardForm',
428 'This wizard will help you to import Bibles from a variety of '428 'This wizard will help you to import Bibles from a variety of '
429429
=== modified file 'openlp/plugins/bibles/lib/__init__.py'
--- openlp/plugins/bibles/lib/__init__.py 2017-05-05 21:00:59 +0000
+++ openlp/plugins/bibles/lib/__init__.py 2017-06-01 06:24:55 +0000
@@ -221,18 +221,16 @@
221 REFERENCE_SEPARATORS['sep_{role}'.format(role=role)] = '\s*(?:{source})\s*'.format(source=source_string)221 REFERENCE_SEPARATORS['sep_{role}'.format(role=role)] = '\s*(?:{source})\s*'.format(source=source_string)
222 REFERENCE_SEPARATORS['sep_{role}_default'.format(role=role)] = default_separators[index]222 REFERENCE_SEPARATORS['sep_{role}_default'.format(role=role)] = default_separators[index]
223 # verse range match: (<chapter>:)?<verse>(-((<chapter>:)?<verse>|end)?)?223 # verse range match: (<chapter>:)?<verse>(-((<chapter>:)?<verse>|end)?)?
224 # TODO: Check before converting this string224 range_regex = '(?:(?P<from_chapter>[0-9]+){sep_v})?' \
225 range_regex = '(?:(?P<from_chapter>[0-9]+)%(sep_v)s)?' \225 '(?P<from_verse>[0-9]+)(?P<range_to>{sep_r}(?:(?:(?P<to_chapter>' \
226 '(?P<from_verse>[0-9]+)(?P<range_to>%(sep_r)s(?:(?:(?P<to_chapter>' \226 '[0-9]+){sep_v})?(?P<to_verse>[0-9]+)|{sep_e})?)?'.format_map(REFERENCE_SEPARATORS)
227 '[0-9]+)%(sep_v)s)?(?P<to_verse>[0-9]+)|%(sep_e)s)?)?' % REFERENCE_SEPARATORS227 REFERENCE_MATCHES['range'] = re.compile(r'^\s*{range}\s*$'.format(range=range_regex), re.UNICODE)
228 # TODO: Test before converting re.compile strings
229 REFERENCE_MATCHES['range'] = re.compile('^\s*%s\s*$' % range_regex, re.UNICODE)
230 REFERENCE_MATCHES['range_separator'] = re.compile(REFERENCE_SEPARATORS['sep_l'], re.UNICODE)228 REFERENCE_MATCHES['range_separator'] = re.compile(REFERENCE_SEPARATORS['sep_l'], re.UNICODE)
231 # full reference match: <book>(<range>(,(?!$)|(?=$)))+229 # full reference match: <book>(<range>(,(?!$)|(?=$)))+
232 REFERENCE_MATCHES['full'] = \230 REFERENCE_MATCHES['full'] = \
233 re.compile('^\s*(?!\s)(?P<book>[\d]*[^\d\.]+)\.*(?<!\s)\s*'231 re.compile(r'^\s*(?!\s)(?P<book>[\d]*[^\d\.]+)\.*(?<!\s)\s*'
234 '(?P<ranges>(?:%(range_regex)s(?:%(sep_l)s(?!\s*$)|(?=\s*$)))+)\s*$'232 r'(?P<ranges>(?:{range_regex}(?:{sep_l}(?!\s*$)|(?=\s*$)))+)\s*$'.format(
235 % dict(list(REFERENCE_SEPARATORS.items()) + [('range_regex', range_regex)]), re.UNICODE)233 range_regex=range_regex, sep_l=REFERENCE_SEPARATORS['sep_l']), re.UNICODE)
236234
237235
238def get_reference_separator(separator_type):236def get_reference_separator(separator_type):
239237
=== modified file 'openlp/plugins/bibles/lib/db.py'
--- openlp/plugins/bibles/lib/db.py 2017-05-06 10:51:54 +0000
+++ openlp/plugins/bibles/lib/db.py 2017-06-01 06:24:55 +0000
@@ -306,9 +306,8 @@
306 book_escaped = book306 book_escaped = book
307 for character in RESERVED_CHARACTERS:307 for character in RESERVED_CHARACTERS:
308 book_escaped = book_escaped.replace(character, '\\' + character)308 book_escaped = book_escaped.replace(character, '\\' + character)
309 # TODO: Verify regex patters before using format()309 regex_book = re.compile('\\s*{book}\\s*'.format(book='\\s*'.join(book_escaped.split())),
310 regex_book = re.compile('\s*%s\s*' % '\s*'.join(310 re.UNICODE | re.IGNORECASE)
311 book_escaped.split()), re.UNICODE | re.IGNORECASE)
312 if language_selection == LanguageSelection.Bible:311 if language_selection == LanguageSelection.Bible:
313 db_book = self.get_book(book)312 db_book = self.get_book(book)
314 if db_book:313 if db_book:
315314
=== modified file 'openlp/plugins/bibles/lib/importers/http.py'
--- openlp/plugins/bibles/lib/importers/http.py 2016-12-31 11:01:36 +0000
+++ openlp/plugins/bibles/lib/importers/http.py 2017-06-01 06:24:55 +0000
@@ -90,6 +90,8 @@
90 """90 """
91 Extract verses from BibleGateway91 Extract verses from BibleGateway
92 """92 """
93 NAME = 'BibleGateway'
94
93 def __init__(self, proxy_url=None):95 def __init__(self, proxy_url=None):
94 log.debug('BGExtract.init("{url}")'.format(url=proxy_url))96 log.debug('BGExtract.init("{url}")'.format(url=proxy_url))
95 self.proxy_url = proxy_url97 self.proxy_url = proxy_url
@@ -357,6 +359,8 @@
357 """359 """
358 Extract verses from Bibleserver.com360 Extract verses from Bibleserver.com
359 """361 """
362 NAME = 'BibleServer'
363
360 def __init__(self, proxy_url=None):364 def __init__(self, proxy_url=None):
361 log.debug('BSExtract.init("{url}")'.format(url=proxy_url))365 log.debug('BSExtract.init("{url}")'.format(url=proxy_url))
362 self.proxy_url = proxy_url366 self.proxy_url = proxy_url
@@ -458,6 +462,8 @@
458 """462 """
459 Extract verses from CrossWalk/BibleStudyTools463 Extract verses from CrossWalk/BibleStudyTools
460 """464 """
465 NAME = 'Crosswalk'
466
461 def __init__(self, proxy_url=None):467 def __init__(self, proxy_url=None):
462 log.debug('CWExtract.init("{url}")'.format(url=proxy_url))468 log.debug('CWExtract.init("{url}")'.format(url=proxy_url))
463 self.proxy_url = proxy_url469 self.proxy_url = proxy_url
464470
=== modified file 'openlp/plugins/custom/lib/mediaitem.py'
--- openlp/plugins/custom/lib/mediaitem.py 2016-12-31 11:01:36 +0000
+++ openlp/plugins/custom/lib/mediaitem.py 2017-06-01 06:24:55 +0000
@@ -190,9 +190,7 @@
190 translate('CustomPlugin.MediaItem',190 translate('CustomPlugin.MediaItem',
191 'Are you sure you want to delete the "{items:d}" '191 'Are you sure you want to delete the "{items:d}" '
192 'selected custom slide(s)?').format(items=len(items)),192 'selected custom slide(s)?').format(items=len(items)),
193 QtWidgets.QMessageBox.StandardButtons(193 defaultButton=QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.No:
194 QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No),
195 QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.No:
196 return194 return
197 row_list = [item.row() for item in self.list_view.selectedIndexes()]195 row_list = [item.row() for item in self.list_view.selectedIndexes()]
198 row_list.sort(reverse=True)196 row_list.sort(reverse=True)
199197
=== modified file 'openlp/plugins/images/lib/mediaitem.py'
--- openlp/plugins/images/lib/mediaitem.py 2016-12-31 11:01:36 +0000
+++ openlp/plugins/images/lib/mediaitem.py 2017-06-01 06:24:55 +0000
@@ -246,9 +246,7 @@
246 translate('ImagePlugin.MediaItem', 'Remove group'),246 translate('ImagePlugin.MediaItem', 'Remove group'),
247 translate('ImagePlugin.MediaItem',247 translate('ImagePlugin.MediaItem',
248 'Are you sure you want to remove "{name}" and everything in it?'248 'Are you sure you want to remove "{name}" and everything in it?'
249 ).format(name=item_data.group_name),249 ).format(name=item_data.group_name)
250 QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Yes |
251 QtWidgets.QMessageBox.No)
252 ) == QtWidgets.QMessageBox.Yes:250 ) == QtWidgets.QMessageBox.Yes:
253 self.recursively_delete_group(item_data)251 self.recursively_delete_group(item_data)
254 self.manager.delete_object(ImageGroups, row_item.data(0, QtCore.Qt.UserRole).id)252 self.manager.delete_object(ImageGroups, row_item.data(0, QtCore.Qt.UserRole).id)
@@ -597,8 +595,7 @@
597 self, translate('ImagePlugin.MediaItem', 'Missing Image(s)'),595 self, translate('ImagePlugin.MediaItem', 'Missing Image(s)'),
598 translate('ImagePlugin.MediaItem', 'The following image(s) no longer exist: {names}\n'596 translate('ImagePlugin.MediaItem', 'The following image(s) no longer exist: {names}\n'
599 'Do you want to add the other images anyway?'597 'Do you want to add the other images anyway?'
600 ).format(names='\n'.join(missing_items_file_names)),598 ).format(names='\n'.join(missing_items_file_names))) == \
601 QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.No | QtWidgets.QMessageBox.Yes)) == \
602 QtWidgets.QMessageBox.No:599 QtWidgets.QMessageBox.No:
603 return False600 return False
604 # Continue with the existing images.601 # Continue with the existing images.
605602
=== modified file 'openlp/plugins/presentations/lib/pdfcontroller.py'
--- openlp/plugins/presentations/lib/pdfcontroller.py 2017-05-14 10:11:10 +0000
+++ openlp/plugins/presentations/lib/pdfcontroller.py 2017-06-01 06:24:55 +0000
@@ -253,15 +253,14 @@
253 try:253 try:
254 if not os.path.isdir(self.get_temp_folder()):254 if not os.path.isdir(self.get_temp_folder()):
255 os.makedirs(self.get_temp_folder())255 os.makedirs(self.get_temp_folder())
256 # The %03d in the file name is handled by each binary
256 if self.controller.mudrawbin:257 if self.controller.mudrawbin:
257 log.debug('loading presentation using mudraw')258 log.debug('loading presentation using mudraw')
258 # TODO: Find out where the string conversion actually happens
259 runlog = check_output([self.controller.mudrawbin, '-w', str(size.width()), '-h', str(size.height()),259 runlog = check_output([self.controller.mudrawbin, '-w', str(size.width()), '-h', str(size.height()),
260 '-o', os.path.join(self.get_temp_folder(), 'mainslide%03d.png'), self.file_path],260 '-o', os.path.join(self.get_temp_folder(), 'mainslide%03d.png'), self.file_path],
261 startupinfo=self.startupinfo)261 startupinfo=self.startupinfo)
262 elif self.controller.mutoolbin:262 elif self.controller.mutoolbin:
263 log.debug('loading presentation using mutool')263 log.debug('loading presentation using mutool')
264 # TODO: Find out where the string convertsion actually happens
265 runlog = check_output([self.controller.mutoolbin, 'draw', '-w', str(size.width()), '-h',264 runlog = check_output([self.controller.mutoolbin, 'draw', '-w', str(size.width()), '-h',
266 str(size.height()),265 str(size.height()),
267 '-o', os.path.join(self.get_temp_folder(), 'mainslide%03d.png'), self.file_path],266 '-o', os.path.join(self.get_temp_folder(), 'mainslide%03d.png'), self.file_path],
@@ -269,7 +268,6 @@
269 elif self.controller.gsbin:268 elif self.controller.gsbin:
270 log.debug('loading presentation using gs')269 log.debug('loading presentation using gs')
271 resolution = self.gs_get_resolution(size)270 resolution = self.gs_get_resolution(size)
272 # TODO: Find out where the string conversion actually happens
273 runlog = check_output([self.controller.gsbin, '-dSAFER', '-dNOPAUSE', '-dBATCH', '-sDEVICE=png16m',271 runlog = check_output([self.controller.gsbin, '-dSAFER', '-dNOPAUSE', '-dBATCH', '-sDEVICE=png16m',
274 '-r' + str(resolution), '-dTextAlphaBits=4', '-dGraphicsAlphaBits=4',272 '-r' + str(resolution), '-dTextAlphaBits=4', '-dGraphicsAlphaBits=4',
275 '-sOutputFile=' + os.path.join(self.get_temp_folder(), 'mainslide%03d.png'),273 '-sOutputFile=' + os.path.join(self.get_temp_folder(), 'mainslide%03d.png'),
276274
=== modified file 'openlp/plugins/presentations/lib/powerpointcontroller.py'
--- openlp/plugins/presentations/lib/powerpointcontroller.py 2017-05-14 10:11:10 +0000
+++ openlp/plugins/presentations/lib/powerpointcontroller.py 2017-06-01 06:24:55 +0000
@@ -81,7 +81,7 @@
81 if app_version >= 12:81 if app_version >= 12:
82 self.also_supports = ['odp']82 self.also_supports = ['odp']
83 except (OSError, ValueError):83 except (OSError, ValueError):
84 log.warning('Detection of powerpoint version using registry failed.')84 log.exception('Detection of powerpoint version using registry failed.')
85 return True85 return True
86 except OSError:86 except OSError:
87 pass87 pass
@@ -109,9 +109,8 @@
109 if self.process.Presentations.Count > 0:109 if self.process.Presentations.Count > 0:
110 return110 return
111 self.process.Quit()111 self.process.Quit()
112 except (AttributeError, pywintypes.com_error) as e:112 except (AttributeError, pywintypes.com_error):
113 log.exception('Exception caught while killing powerpoint process')113 log.exception('Exception caught while killing powerpoint process')
114 log.exception(e)
115 trace_error_handler(log)114 trace_error_handler(log)
116 self.process = None115 self.process = None
117116
@@ -154,9 +153,8 @@
154 if len(ScreenList().screen_list) > 1:153 if len(ScreenList().screen_list) > 1:
155 Registry().get('main_window').activateWindow()154 Registry().get('main_window').activateWindow()
156 return True155 return True
157 except (AttributeError, pywintypes.com_error) as e:156 except (AttributeError, pywintypes.com_error):
158 log.exception('Exception caught while loading Powerpoint presentation')157 log.exception('Exception caught while loading Powerpoint presentation')
159 log.exception(e)
160 trace_error_handler(log)158 trace_error_handler(log)
161 return False159 return False
162160
@@ -192,9 +190,8 @@
192 if self.presentation:190 if self.presentation:
193 try:191 try:
194 self.presentation.Close()192 self.presentation.Close()
195 except (AttributeError, pywintypes.com_error) as e:193 except (AttributeError, pywintypes.com_error):
196 log.exception('Caught exception while closing powerpoint presentation')194 log.exception('Caught exception while closing powerpoint presentation')
197 log.exception(e)
198 trace_error_handler(log)195 trace_error_handler(log)
199 self.presentation = None196 self.presentation = None
200 self.controller.remove_doc(self)197 self.controller.remove_doc(self)
@@ -210,9 +207,8 @@
210 try:207 try:
211 if self.controller.process.Presentations.Count == 0:208 if self.controller.process.Presentations.Count == 0:
212 return False209 return False
213 except (AttributeError, pywintypes.com_error) as e:210 except (AttributeError, pywintypes.com_error):
214 log.exception('Caught exception while in is_loaded')211 log.exception('Caught exception while in is_loaded')
215 log.exception(e)
216 trace_error_handler(log)212 trace_error_handler(log)
217 return False213 return False
218 return True214 return True
@@ -229,9 +225,8 @@
229 return False225 return False
230 if self.presentation.SlideShowWindow.View is None:226 if self.presentation.SlideShowWindow.View is None:
231 return False227 return False
232 except (AttributeError, pywintypes.com_error) as e:228 except (AttributeError, pywintypes.com_error):
233 log.exception('Caught exception while in is_active')229 log.exception('Caught exception while in is_active')
234 log.exception(e)
235 trace_error_handler(log)230 trace_error_handler(log)
236 return False231 return False
237 return True232 return True
@@ -249,9 +244,8 @@
249 self.presentation.SlideShowWindow.View.GotoSlide(self.index_map[self.blank_slide], False)244 self.presentation.SlideShowWindow.View.GotoSlide(self.index_map[self.blank_slide], False)
250 if self.blank_click:245 if self.blank_click:
251 self.presentation.SlideShowWindow.View.GotoClick(self.blank_click)246 self.presentation.SlideShowWindow.View.GotoClick(self.blank_click)
252 except (AttributeError, pywintypes.com_error) as e:247 except (AttributeError, pywintypes.com_error):
253 log.exception('Caught exception while in unblank_screen')248 log.exception('Caught exception while in unblank_screen')
254 log.exception(e)
255 trace_error_handler(log)249 trace_error_handler(log)
256 self.show_error_msg()250 self.show_error_msg()
257 # Stop powerpoint from flashing in the taskbar251 # Stop powerpoint from flashing in the taskbar
@@ -273,9 +267,8 @@
273 self.blank_click = self.presentation.SlideShowWindow.View.GetClickIndex()267 self.blank_click = self.presentation.SlideShowWindow.View.GetClickIndex()
274 # ppSlideShowBlackScreen = 3268 # ppSlideShowBlackScreen = 3
275 self.presentation.SlideShowWindow.View.State = 3269 self.presentation.SlideShowWindow.View.State = 3
276 except (AttributeError, pywintypes.com_error) as e:270 except (AttributeError, pywintypes.com_error):
277 log.exception('Caught exception while in blank_screen')271 log.exception('Caught exception while in blank_screen')
278 log.exception(e)
279 trace_error_handler(log)272 trace_error_handler(log)
280 self.show_error_msg()273 self.show_error_msg()
281274
@@ -288,9 +281,8 @@
288 try:281 try:
289 # ppSlideShowBlackScreen = 3282 # ppSlideShowBlackScreen = 3
290 return self.presentation.SlideShowWindow.View.State == 3283 return self.presentation.SlideShowWindow.View.State == 3
291 except (AttributeError, pywintypes.com_error) as e:284 except (AttributeError, pywintypes.com_error):
292 log.exception('Caught exception while in is_blank')285 log.exception('Caught exception while in is_blank')
293 log.exception(e)
294 trace_error_handler(log)286 trace_error_handler(log)
295 self.show_error_msg()287 self.show_error_msg()
296 else:288 else:
@@ -303,9 +295,8 @@
303 log.debug('stop_presentation')295 log.debug('stop_presentation')
304 try:296 try:
305 self.presentation.SlideShowWindow.View.Exit()297 self.presentation.SlideShowWindow.View.Exit()
306 except (AttributeError, pywintypes.com_error) as e:298 except (AttributeError, pywintypes.com_error):
307 log.exception('Caught exception while in stop_presentation')299 log.exception('Caught exception while in stop_presentation')
308 log.exception(e)
309 trace_error_handler(log)300 trace_error_handler(log)
310 self.show_error_msg()301 self.show_error_msg()
311302
@@ -328,9 +319,8 @@
328 ppt_window = None319 ppt_window = None
329 try:320 try:
330 ppt_window = self.presentation.SlideShowSettings.Run()321 ppt_window = self.presentation.SlideShowSettings.Run()
331 except (AttributeError, pywintypes.com_error) as e:322 except (AttributeError, pywintypes.com_error):
332 log.exception('Caught exception while in start_presentation')323 log.exception('Caught exception while in start_presentation')
333 log.exception(e)
334 trace_error_handler(log)324 trace_error_handler(log)
335 self.show_error_msg()325 self.show_error_msg()
336 if ppt_window and not Settings().value('presentations/powerpoint control window'):326 if ppt_window and not Settings().value('presentations/powerpoint control window'):
@@ -339,9 +329,8 @@
339 ppt_window.Height = size.height() * 72 / dpi329 ppt_window.Height = size.height() * 72 / dpi
340 ppt_window.Left = size.x() * 72 / dpi330 ppt_window.Left = size.x() * 72 / dpi
341 ppt_window.Width = size.width() * 72 / dpi331 ppt_window.Width = size.width() * 72 / dpi
342 except AttributeError as e:332 except AttributeError:
343 log.exception('AttributeError while in start_presentation')333 log.exception('AttributeError while in start_presentation')
344 log.exception(e)
345 # Find the presentation window and save the handle for later334 # Find the presentation window and save the handle for later
346 self.presentation_hwnd = None335 self.presentation_hwnd = None
347 if ppt_window:336 if ppt_window:
@@ -399,9 +388,8 @@
399 ret = next((key for key, slidenum in self.index_map.items() if slidenum == ret), None)388 ret = next((key for key, slidenum in self.index_map.items() if slidenum == ret), None)
400 else:389 else:
401 ret = self.presentation.SlideShowWindow.View.CurrentShowPosition390 ret = self.presentation.SlideShowWindow.View.CurrentShowPosition
402 except (AttributeError, pywintypes.com_error) as e:391 except (AttributeError, pywintypes.com_error):
403 log.exception('Caught exception while in get_slide_number')392 log.exception('Caught exception while in get_slide_number')
404 log.exception(e)
405 trace_error_handler(log)393 trace_error_handler(log)
406 self.show_error_msg()394 self.show_error_msg()
407 return ret395 return ret
@@ -431,9 +419,8 @@
431 self.next_step()419 self.next_step()
432 else:420 else:
433 self.presentation.SlideShowWindow.View.GotoSlide(self.index_map[slide_no])421 self.presentation.SlideShowWindow.View.GotoSlide(self.index_map[slide_no])
434 except (AttributeError, pywintypes.com_error) as e:422 except (AttributeError, pywintypes.com_error):
435 log.exception('Caught exception while in goto_slide')423 log.exception('Caught exception while in goto_slide')
436 log.exception(e)
437 trace_error_handler(log)424 trace_error_handler(log)
438 self.show_error_msg()425 self.show_error_msg()
439426
@@ -445,9 +432,8 @@
445 try:432 try:
446 self.presentation.SlideShowWindow.Activate()433 self.presentation.SlideShowWindow.Activate()
447 self.presentation.SlideShowWindow.View.Next()434 self.presentation.SlideShowWindow.View.Next()
448 except (AttributeError, pywintypes.com_error) as e:435 except (AttributeError, pywintypes.com_error):
449 log.exception('Caught exception while in next_step')436 log.exception('Caught exception while in next_step')
450 log.exception(e)
451 trace_error_handler(log)437 trace_error_handler(log)
452 self.show_error_msg()438 self.show_error_msg()
453 return439 return
@@ -468,9 +454,8 @@
468 log.debug('previous_step')454 log.debug('previous_step')
469 try:455 try:
470 self.presentation.SlideShowWindow.View.Previous()456 self.presentation.SlideShowWindow.View.Previous()
471 except (AttributeError, pywintypes.com_error) as e:457 except (AttributeError, pywintypes.com_error):
472 log.exception('Caught exception while in previous_step')458 log.exception('Caught exception while in previous_step')
473 log.exception(e)
474 trace_error_handler(log)459 trace_error_handler(log)
475 self.show_error_msg()460 self.show_error_msg()
476461
@@ -503,8 +488,8 @@
503 slide = self.presentation.Slides(self.index_map[num + 1])488 slide = self.presentation.Slides(self.index_map[num + 1])
504 try:489 try:
505 text = slide.Shapes.Title.TextFrame.TextRange.Text490 text = slide.Shapes.Title.TextFrame.TextRange.Text
506 except Exception as e:491 except Exception:
507 log.exception(e)492 log.exception('Exception raised when getting title text')
508 text = ''493 text = ''
509 titles.append(text.replace('\n', ' ').replace('\x0b', ' ') + '\n')494 titles.append(text.replace('\n', ' ').replace('\x0b', ' ') + '\n')
510 note = _get_text_from_shapes(slide.NotesPage.Shapes)495 note = _get_text_from_shapes(slide.NotesPage.Shapes)
@@ -519,9 +504,8 @@
519 """504 """
520 try:505 try:
521 self.presentation.SlideShowWindow.View.Exit()506 self.presentation.SlideShowWindow.View.Exit()
522 except (AttributeError, pywintypes.com_error) as e:507 except (AttributeError, pywintypes.com_error):
523 log.exception('Failed to exit Powerpoint presentation after error')508 log.exception('Failed to exit Powerpoint presentation after error')
524 log.exception(e)
525 critical_error_message_box(UiStrings().Error, translate('PresentationPlugin.PowerpointDocument',509 critical_error_message_box(UiStrings().Error, translate('PresentationPlugin.PowerpointDocument',
526 'An error occurred in the PowerPoint integration '510 'An error occurred in the PowerPoint integration '
527 'and the presentation will be stopped. '511 'and the presentation will be stopped. '
@@ -540,7 +524,6 @@
540 if shape.PlaceholderFormat.Type == 2: # 2 from is enum PpPlaceholderType.ppPlaceholderBody524 if shape.PlaceholderFormat.Type == 2: # 2 from is enum PpPlaceholderType.ppPlaceholderBody
541 if shape.HasTextFrame and shape.TextFrame.HasText:525 if shape.HasTextFrame and shape.TextFrame.HasText:
542 text += shape.TextFrame.TextRange.Text + '\n'526 text += shape.TextFrame.TextRange.Text + '\n'
543 except pywintypes.com_error as e:527 except pywintypes.com_error:
544 log.warning('Failed to extract text from powerpoint slide')528 log.exception('Failed to extract text from powerpoint slide')
545 log.warning(e)
546 return text529 return text
547530
=== modified file 'openlp/plugins/remotes/remoteplugin.py'
--- openlp/plugins/remotes/remoteplugin.py 2016-12-31 11:01:36 +0000
+++ openlp/plugins/remotes/remoteplugin.py 2017-06-01 06:24:55 +0000
@@ -122,5 +122,4 @@
122 translate('RemotePlugin', 'Server Config Change'),122 translate('RemotePlugin', 'Server Config Change'),
123 translate('RemotePlugin',123 translate('RemotePlugin',
124 'Server configuration changes will require a restart '124 'Server configuration changes will require a restart '
125 'to take effect.'),125 'to take effect.'))
126 QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Ok))
127126
=== modified file 'openlp/plugins/songs/forms/duplicatesongremovalform.py'
--- openlp/plugins/songs/forms/duplicatesongremovalform.py 2016-12-31 11:01:36 +0000
+++ openlp/plugins/songs/forms/duplicatesongremovalform.py 2017-06-01 06:24:55 +0000
@@ -130,9 +130,9 @@
130 Song wizard localisation.130 Song wizard localisation.
131 """131 """
132 self.setWindowTitle(translate('Wizard', 'Wizard'))132 self.setWindowTitle(translate('Wizard', 'Wizard'))
133 # TODO: Check format() using template strings133 self.title_label.setText(
134 self.title_label.setText(WizardStrings.HeaderStyle % translate('OpenLP.Ui',134 WizardStrings.HeaderStyle.format(text=translate('OpenLP.Ui',
135 'Welcome to the Duplicate Song Removal Wizard'))135 'Welcome to the Duplicate Song Removal Wizard')))
136 self.information_label.setText(136 self.information_label.setText(
137 translate("Wizard",137 translate("Wizard",
138 'This wizard will help you to remove duplicate songs from the song database. You will have a '138 'This wizard will help you to remove duplicate songs from the song database. You will have a '
@@ -216,8 +216,7 @@
216 self.button(QtWidgets.QWizard.CancelButton).hide()216 self.button(QtWidgets.QWizard.CancelButton).hide()
217 QtWidgets.QMessageBox.information(217 QtWidgets.QMessageBox.information(
218 self, translate('Wizard', 'Information'),218 self, translate('Wizard', 'Information'),
219 translate('Wizard', 'No duplicate songs have been found in the database.'),219 translate('Wizard', 'No duplicate songs have been found in the database.'))
220 QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Ok))
221220
222 def add_duplicates_to_song_list(self, search_song, duplicate_song):221 def add_duplicates_to_song_list(self, search_song, duplicate_song):
223 """222 """
224223
=== modified file 'openlp/plugins/songs/forms/editsongform.py'
--- openlp/plugins/songs/forms/editsongform.py 2017-03-02 04:34:24 +0000
+++ openlp/plugins/songs/forms/editsongform.py 2017-06-01 06:24:55 +0000
@@ -203,8 +203,7 @@
203 'There is no verse corresponding to "{invalid}". Valid entries are {valid}.\n'203 'There is no verse corresponding to "{invalid}". Valid entries are {valid}.\n'
204 'Please enter the verses separated by spaces.').format(invalid=invalid_verses[0],204 'Please enter the verses separated by spaces.').format(invalid=invalid_verses[0],
205 valid=valid)205 valid=valid)
206 critical_error_message_box(title=translate('SongsPlugin.EditSongForm', 'Invalid Verse Order'),206 critical_error_message_box(title=translate('SongsPlugin.EditSongForm', 'Invalid Verse Order'), message=msg)
207 message=msg)
208 return len(invalid_verses) == 0207 return len(invalid_verses) == 0
209208
210 def _validate_song(self):209 def _validate_song(self):
@@ -579,8 +578,7 @@
579 self,578 self,
580 translate('SongsPlugin.EditSongForm', 'Add Author'),579 translate('SongsPlugin.EditSongForm', 'Add Author'),
581 translate('SongsPlugin.EditSongForm', 'This author does not exist, do you want to add them?'),580 translate('SongsPlugin.EditSongForm', 'This author does not exist, do you want to add them?'),
582 QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No,581 defaultButton=QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.Yes:
583 QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.Yes:
584 if text.find(' ') == -1:582 if text.find(' ') == -1:
585 author = Author.populate(first_name='', last_name='', display_name=text)583 author = Author.populate(first_name='', last_name='', display_name=text)
586 else:584 else:
@@ -658,8 +656,7 @@
658 if QtWidgets.QMessageBox.question(656 if QtWidgets.QMessageBox.question(
659 self, translate('SongsPlugin.EditSongForm', 'Add Topic'),657 self, translate('SongsPlugin.EditSongForm', 'Add Topic'),
660 translate('SongsPlugin.EditSongForm', 'This topic does not exist, do you want to add it?'),658 translate('SongsPlugin.EditSongForm', 'This topic does not exist, do you want to add it?'),
661 QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No,659 defaultButton=QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.Yes:
662 QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.Yes:
663 topic = Topic.populate(name=text)660 topic = Topic.populate(name=text)
664 self.manager.save_object(topic)661 self.manager.save_object(topic)
665 topic_item = QtWidgets.QListWidgetItem(str(topic.name))662 topic_item = QtWidgets.QListWidgetItem(str(topic.name))
@@ -705,8 +702,7 @@
705 if QtWidgets.QMessageBox.question(702 if QtWidgets.QMessageBox.question(
706 self, translate('SongsPlugin.EditSongForm', 'Add Songbook'),703 self, translate('SongsPlugin.EditSongForm', 'Add Songbook'),
707 translate('SongsPlugin.EditSongForm', 'This Songbook does not exist, do you want to add it?'),704 translate('SongsPlugin.EditSongForm', 'This Songbook does not exist, do you want to add it?'),
708 QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No,705 defaultButton=QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.Yes:
709 QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.Yes:
710 songbook = Book.populate(name=text)706 songbook = Book.populate(name=text)
711 self.manager.save_object(songbook)707 self.manager.save_object(songbook)
712 self.add_songbook_entry_to_list(songbook.id, songbook.name, self.songbook_entry_edit.text())708 self.add_songbook_entry_to_list(songbook.id, songbook.name, self.songbook_entry_edit.text())
713709
=== modified file 'openlp/plugins/songs/forms/songexportform.py'
--- openlp/plugins/songs/forms/songexportform.py 2016-12-31 11:01:36 +0000
+++ openlp/plugins/songs/forms/songexportform.py 2017-06-01 06:24:55 +0000
@@ -121,7 +121,7 @@
121 self.selected_list_widget = QtWidgets.QListWidget(self.export_song_page)121 self.selected_list_widget = QtWidgets.QListWidget(self.export_song_page)
122 self.selected_list_widget.setObjectName('selected_list_widget')122 self.selected_list_widget.setObjectName('selected_list_widget')
123 self.grid_layout.addWidget(self.selected_list_widget, 1, 0, 1, 1)123 self.grid_layout.addWidget(self.selected_list_widget, 1, 0, 1, 1)
124 # FIXME: self.horizontal_layout is already defined above?!?!?124 # FIXME: self.horizontal_layout is already defined above?!?!? Replace with Path Eidt!
125 self.horizontal_layout = QtWidgets.QHBoxLayout()125 self.horizontal_layout = QtWidgets.QHBoxLayout()
126 self.horizontal_layout.setObjectName('horizontal_layout')126 self.horizontal_layout.setObjectName('horizontal_layout')
127 self.directory_label = QtWidgets.QLabel(self.export_song_page)127 self.directory_label = QtWidgets.QLabel(self.export_song_page)
@@ -143,9 +143,8 @@
143 Song wizard localisation.143 Song wizard localisation.
144 """144 """
145 self.setWindowTitle(translate('SongsPlugin.ExportWizardForm', 'Song Export Wizard'))145 self.setWindowTitle(translate('SongsPlugin.ExportWizardForm', 'Song Export Wizard'))
146 # TODO: Verify format() with template variables146 self.title_label.setText(
147 self.title_label.setText(WizardStrings.HeaderStyle %147 WizardStrings.HeaderStyle.format(text=translate('OpenLP.Ui', 'Welcome to the Song Export Wizard')))
148 translate('OpenLP.Ui', 'Welcome to the Song Export Wizard'))
149 self.information_label.setText(148 self.information_label.setText(
150 translate('SongsPlugin.ExportWizardForm', 'This wizard will help to export your songs to the open and free '149 translate('SongsPlugin.ExportWizardForm', 'This wizard will help to export your songs to the open and free '
151 '<strong>OpenLyrics </strong> worship song format.'))150 '<strong>OpenLyrics </strong> worship song format.'))
152151
=== modified file 'openlp/plugins/songs/forms/songimportform.py'
--- openlp/plugins/songs/forms/songimportform.py 2016-12-31 11:01:36 +0000
+++ openlp/plugins/songs/forms/songimportform.py 2017-06-01 06:24:55 +0000
@@ -132,9 +132,8 @@
132 Song wizard localisation.132 Song wizard localisation.
133 """133 """
134 self.setWindowTitle(translate('SongsPlugin.ImportWizardForm', 'Song Import Wizard'))134 self.setWindowTitle(translate('SongsPlugin.ImportWizardForm', 'Song Import Wizard'))
135 # TODO: Verify format() with template variables135 self.title_label.setText(
136 self.title_label.setText(WizardStrings.HeaderStyle % translate('OpenLP.Ui',136 WizardStrings.HeaderStyle.format(text=translate('OpenLP.Ui', 'Welcome to the Song Import Wizard')))
137 'Welcome to the Song Import Wizard'))
138 self.information_label.setText(137 self.information_label.setText(
139 translate('SongsPlugin.ImportWizardForm',138 translate('SongsPlugin.ImportWizardForm',
140 'This wizard will help you to import songs from a variety of formats. Click the next button '139 'This wizard will help you to import songs from a variety of formats. Click the next button '
@@ -272,12 +271,11 @@
272 select_mode, format_name, ext_filter = SongFormat.get(this_format, 'selectMode', 'name', 'filter')271 select_mode, format_name, ext_filter = SongFormat.get(this_format, 'selectMode', 'name', 'filter')
273 file_path_edit = self.format_widgets[this_format]['file_path_edit']272 file_path_edit = self.format_widgets[this_format]['file_path_edit']
274 if select_mode == SongFormatSelect.SingleFile:273 if select_mode == SongFormatSelect.SingleFile:
275 # TODO: Verify format() with template variables274 self.get_file_name(WizardStrings.OpenTypeFile.format(file_type=format_name),
276 self.get_file_name(275 file_path_edit, 'last directory import', ext_filter)
277 WizardStrings.OpenTypeFile % format_name, file_path_edit, 'last directory import', ext_filter)
278 elif select_mode == SongFormatSelect.SingleFolder:276 elif select_mode == SongFormatSelect.SingleFolder:
279 # TODO: Verify format() with template variables277 self.get_folder(
280 self.get_folder(WizardStrings.OpenTypeFolder % format_name, file_path_edit, 'last directory import')278 WizardStrings.OpenTypeFolder.format(folder_name=format_name), file_path_edit, 'last directory import')
281279
282 def on_add_button_clicked(self):280 def on_add_button_clicked(self):
283 """281 """
@@ -286,8 +284,7 @@
286 this_format = self.current_format284 this_format = self.current_format
287 select_mode, format_name, ext_filter, custom_title = \285 select_mode, format_name, ext_filter, custom_title = \
288 SongFormat.get(this_format, 'selectMode', 'name', 'filter', 'getFilesTitle')286 SongFormat.get(this_format, 'selectMode', 'name', 'filter', 'getFilesTitle')
289 # TODO: Verify format() with template variables287 title = custom_title if custom_title else WizardStrings.OpenTypeFile.format(file_type=format_name)
290 title = custom_title if custom_title else WizardStrings.OpenTypeFile % format_name
291 if select_mode == SongFormatSelect.MultipleFiles:288 if select_mode == SongFormatSelect.MultipleFiles:
292 self.get_files(title, self.format_widgets[this_format]['file_list_widget'], ext_filter)289 self.get_files(title, self.format_widgets[this_format]['file_list_widget'], ext_filter)
293 self.source_page.completeChanged.emit()290 self.source_page.completeChanged.emit()
294291
=== modified file 'openlp/plugins/songs/forms/songselectform.py'
--- openlp/plugins/songs/forms/songselectform.py 2017-02-18 07:23:15 +0000
+++ openlp/plugins/songs/forms/songselectform.py 2017-06-01 06:24:55 +0000
@@ -248,8 +248,7 @@
248 translate('SongsPlugin.SongSelectForm', 'WARNING: Saving your username and password is INSECURE, your '248 translate('SongsPlugin.SongSelectForm', 'WARNING: Saving your username and password is INSECURE, your '
249 'password is stored in PLAIN TEXT. Click Yes to save your '249 'password is stored in PLAIN TEXT. Click Yes to save your '
250 'password or No to cancel this.'),250 'password or No to cancel this.'),
251 QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No),251 defaultButton=QtWidgets.QMessageBox.No)
252 QtWidgets.QMessageBox.No)
253 if answer == QtWidgets.QMessageBox.No:252 if answer == QtWidgets.QMessageBox.No:
254 self.save_password_checkbox.setChecked(False)253 self.save_password_checkbox.setChecked(False)
255254
@@ -397,8 +396,7 @@
397 translate('SongsPlugin.SongSelectForm',396 translate('SongsPlugin.SongSelectForm',
398 'Your song has been imported, would you '397 'Your song has been imported, would you '
399 'like to import more songs?'),398 'like to import more songs?'),
400 QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No,399 defaultButton=QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.Yes:
401 QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.Yes:
402 self.on_back_button_clicked()400 self.on_back_button_clicked()
403 else:401 else:
404 self.application.process_events()402 self.application.process_events()
405403
=== modified file 'openlp/plugins/songs/lib/importer.py'
--- openlp/plugins/songs/lib/importer.py 2017-05-22 19:07:07 +0000
+++ openlp/plugins/songs/lib/importer.py 2017-06-01 06:24:55 +0000
@@ -265,7 +265,7 @@
265 },265 },
266 EasyWorshipService: {266 EasyWorshipService: {
267 'class': EasyWorshipSongImport,267 'class': EasyWorshipSongImport,
268 'name': 'EasyWorship Service File',268 'name': 'EasyWorship Service',
269 'prefix': 'ew',269 'prefix': 'ew',
270 'selectMode': SongFormatSelect.SingleFile,270 'selectMode': SongFormatSelect.SingleFile,
271 'filter': '{text} (*.ews)'.format(text=translate('SongsPlugin.ImportWizardForm',271 'filter': '{text} (*.ews)'.format(text=translate('SongsPlugin.ImportWizardForm',
272272
=== modified file 'openlp/plugins/songs/lib/importers/foilpresenter.py'
--- openlp/plugins/songs/lib/importers/foilpresenter.py 2016-12-31 11:01:36 +0000
+++ openlp/plugins/songs/lib/importers/foilpresenter.py 2017-06-01 06:24:55 +0000
@@ -121,8 +121,8 @@
121 for file_path in self.import_source:121 for file_path in self.import_source:
122 if self.stop_import_flag:122 if self.stop_import_flag:
123 return123 return
124 # TODO: Verify format() with template strings124 self.import_wizard.increment_progress_bar(
125 self.import_wizard.increment_progress_bar(WizardStrings.ImportingType % os.path.basename(file_path))125 WizardStrings.ImportingType.format(source=os.path.basename(file_path)))
126 try:126 try:
127 parsed_file = etree.parse(file_path, parser)127 parsed_file = etree.parse(file_path, parser)
128 xml = etree.tostring(parsed_file).decode()128 xml = etree.tostring(parsed_file).decode()
129129
=== modified file 'openlp/plugins/songs/lib/importers/openlp.py'
--- openlp/plugins/songs/lib/importers/openlp.py 2017-03-28 05:15:05 +0000
+++ openlp/plugins/songs/lib/importers/openlp.py 2017-06-01 06:24:55 +0000
@@ -275,11 +275,9 @@
275 self.manager.save_object(new_song)275 self.manager.save_object(new_song)
276 if progress_dialog:276 if progress_dialog:
277 progress_dialog.setValue(progress_dialog.value() + 1)277 progress_dialog.setValue(progress_dialog.value() + 1)
278 # TODO: Verify format() with template strings278 progress_dialog.setLabelText(WizardStrings.ImportingType.format(source=new_song.title))
279 progress_dialog.setLabelText(WizardStrings.ImportingType % new_song.title)
280 else:279 else:
281 # TODO: Verify format() with template strings280 self.import_wizard.increment_progress_bar(WizardStrings.ImportingType.format(source=new_song.title))
282 self.import_wizard.increment_progress_bar(WizardStrings.ImportingType % new_song.title)
283 if self.stop_import_flag:281 if self.stop_import_flag:
284 break282 break
285 self.source_session.close()283 self.source_session.close()
286284
=== modified file 'openlp/plugins/songs/lib/importers/openlyrics.py'
--- openlp/plugins/songs/lib/importers/openlyrics.py 2016-12-31 11:01:36 +0000
+++ openlp/plugins/songs/lib/importers/openlyrics.py 2017-06-01 06:24:55 +0000
@@ -58,8 +58,8 @@
58 for file_path in self.import_source:58 for file_path in self.import_source:
59 if self.stop_import_flag:59 if self.stop_import_flag:
60 return60 return
61 # TODO: Verify format() with template strings61 self.import_wizard.increment_progress_bar(
62 self.import_wizard.increment_progress_bar(WizardStrings.ImportingType % os.path.basename(file_path))62 WizardStrings.ImportingType.format(source=os.path.basename(file_path)))
63 try:63 try:
64 # Pass a file object, because lxml does not cope with some64 # Pass a file object, because lxml does not cope with some
65 # special characters in the path (see lp:757673 and lp:744337).65 # special characters in the path (see lp:757673 and lp:744337).
6666
=== modified file 'openlp/plugins/songs/lib/importers/powerpraise.py'
--- openlp/plugins/songs/lib/importers/powerpraise.py 2016-12-31 11:01:36 +0000
+++ openlp/plugins/songs/lib/importers/powerpraise.py 2017-06-01 06:24:55 +0000
@@ -41,8 +41,8 @@
41 for file_path in self.import_source:41 for file_path in self.import_source:
42 if self.stop_import_flag:42 if self.stop_import_flag:
43 return43 return
44 # TODO: Verify format() with template strings44 self.import_wizard.increment_progress_bar(
45 self.import_wizard.increment_progress_bar(WizardStrings.ImportingType % os.path.basename(file_path))45 WizardStrings.ImportingType.format(source=os.path.basename(file_path)))
46 root = objectify.parse(open(file_path, 'rb')).getroot()46 root = objectify.parse(open(file_path, 'rb')).getroot()
47 self.process_song(root)47 self.process_song(root)
4848
4949
=== modified file 'openlp/plugins/songs/lib/importers/presentationmanager.py'
--- openlp/plugins/songs/lib/importers/presentationmanager.py 2017-03-23 04:43:13 +0000
+++ openlp/plugins/songs/lib/importers/presentationmanager.py 2017-06-01 06:24:55 +0000
@@ -44,8 +44,8 @@
44 for file_path in self.import_source:44 for file_path in self.import_source:
45 if self.stop_import_flag:45 if self.stop_import_flag:
46 return46 return
47 # TODO: Verify format() with template strings47 self.import_wizard.increment_progress_bar(
48 self.import_wizard.increment_progress_bar(WizardStrings.ImportingType % os.path.basename(file_path))48 WizardStrings.ImportingType.format(source=os.path.basename(file_path)))
49 try:49 try:
50 tree = etree.parse(file_path, parser=etree.XMLParser(recover=True))50 tree = etree.parse(file_path, parser=etree.XMLParser(recover=True))
51 except etree.XMLSyntaxError:51 except etree.XMLSyntaxError:
5252
=== modified file 'openlp/plugins/songs/lib/importers/propresenter.py'
--- openlp/plugins/songs/lib/importers/propresenter.py 2016-12-31 11:01:36 +0000
+++ openlp/plugins/songs/lib/importers/propresenter.py 2017-06-01 06:24:55 +0000
@@ -46,8 +46,8 @@
46 for file_path in self.import_source:46 for file_path in self.import_source:
47 if self.stop_import_flag:47 if self.stop_import_flag:
48 return48 return
49 # TODO: Verify format() with template strings49 self.import_wizard.increment_progress_bar(
50 self.import_wizard.increment_progress_bar(WizardStrings.ImportingType % os.path.basename(file_path))50 WizardStrings.ImportingType.format(source=os.path.basename(file_path)))
51 root = objectify.parse(open(file_path, 'rb')).getroot()51 root = objectify.parse(open(file_path, 'rb')).getroot()
52 self.process_song(root, file_path)52 self.process_song(root, file_path)
5353
5454
=== modified file 'openlp/plugins/songs/lib/importers/songimport.py'
--- openlp/plugins/songs/lib/importers/songimport.py 2017-05-11 20:01:43 +0000
+++ openlp/plugins/songs/lib/importers/songimport.py 2017-06-01 06:24:55 +0000
@@ -347,8 +347,7 @@
347 song = Song()347 song = Song()
348 song.title = self.title348 song.title = self.title
349 if self.import_wizard is not None:349 if self.import_wizard is not None:
350 # TODO: Verify format() with template variables350 self.import_wizard.increment_progress_bar(WizardStrings.ImportingType.format(source=song.title))
351 self.import_wizard.increment_progress_bar(WizardStrings.ImportingType % song.title)
352 song.alternate_title = self.alternate_title351 song.alternate_title = self.alternate_title
353 # Values will be set when cleaning the song.352 # Values will be set when cleaning the song.
354 song.search_title = ''353 song.search_title = ''
355354
=== modified file 'openlp/plugins/songs/lib/importers/songshowplus.py'
--- openlp/plugins/songs/lib/importers/songshowplus.py 2017-05-30 20:05:18 +0000
+++ openlp/plugins/songs/lib/importers/songshowplus.py 2017-06-01 06:24:55 +0000
@@ -100,8 +100,7 @@
100 self.other_count = 0100 self.other_count = 0
101 self.other_list = {}101 self.other_list = {}
102 file_name = os.path.split(file)[1]102 file_name = os.path.split(file)[1]
103 # TODO: Verify format() with template variables103 self.import_wizard.increment_progress_bar(WizardStrings.ImportingType.format(source=file_name), 0)
104 self.import_wizard.increment_progress_bar(WizardStrings.ImportingType % file_name, 0)
105 song_data = open(file, 'rb')104 song_data = open(file, 'rb')
106 while True:105 while True:
107 block_key, = struct.unpack("I", song_data.read(4))106 block_key, = struct.unpack("I", song_data.read(4))
108107
=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py 2017-01-25 21:17:27 +0000
+++ openlp/plugins/songs/lib/mediaitem.py 2017-06-01 06:24:55 +0000
@@ -500,8 +500,7 @@
500 translate('SongsPlugin.MediaItem',500 translate('SongsPlugin.MediaItem',
501 'Are you sure you want to delete the "{items:d}" '501 'Are you sure you want to delete the "{items:d}" '
502 'selected song(s)?').format(items=len(items)),502 'selected song(s)?').format(items=len(items)),
503 QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No),503 defaultButton=QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.No:
504 QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.No:
505 return504 return
506 self.application.set_busy_cursor()505 self.application.set_busy_cursor()
507 self.main_window.display_progress_bar(len(items))506 self.main_window.display_progress_bar(len(items))
508507
=== modified file 'openlp/plugins/songs/lib/openlyricsxml.py'
--- openlp/plugins/songs/lib/openlyricsxml.py 2017-02-26 21:14:49 +0000
+++ openlp/plugins/songs/lib/openlyricsxml.py 2017-06-01 06:24:55 +0000
@@ -70,8 +70,7 @@
70log = logging.getLogger(__name__)70log = logging.getLogger(__name__)
7171
72NAMESPACE = 'http://openlyrics.info/namespace/2009/song'72NAMESPACE = 'http://openlyrics.info/namespace/2009/song'
73# TODO: Verify format() with template variable73NSMAP = '{{' + NAMESPACE + '}}{tag}'
74NSMAP = '{' + NAMESPACE + '}' + '%s'
7574
7675
77class SongXML(object):76class SongXML(object):
@@ -616,15 +615,13 @@
616 text = ''615 text = ''
617 use_endtag = True616 use_endtag = True
618 # Skip <comment> elements - not yet supported.617 # Skip <comment> elements - not yet supported.
619 # TODO: Verify format() with template variables618 if element.tag == NSMAP.format(tag='comment'):
620 if element.tag == NSMAP % 'comment':
621 if element.tail:619 if element.tail:
622 # Append tail text at comment element.620 # Append tail text at comment element.
623 text += element.tail621 text += element.tail
624 return text622 return text
625 # Convert chords to ChordPro format which OpenLP uses internally623 # Convert chords to ChordPro format which OpenLP uses internally
626 # TODO: Verify format() with template variables624 elif element.tag == NSMAP.format(tag='chord'):
627 elif element.tag == NSMAP % 'chord':
628 if Settings().value('songs/enable chords') and not Settings().value('songs/disable chords import'):625 if Settings().value('songs/enable chords') and not Settings().value('songs/disable chords import'):
629 text += '[{chord}]'.format(chord=element.get('name'))626 text += '[{chord}]'.format(chord=element.get('name'))
630 if element.tail:627 if element.tail:
@@ -632,15 +629,13 @@
632 text += element.tail629 text += element.tail
633 return text630 return text
634 # Convert line breaks <br/> to \n.631 # Convert line breaks <br/> to \n.
635 # TODO: Verify format() with template variables632 elif newlines and element.tag == NSMAP.format(tag='br'):
636 elif newlines and element.tag == NSMAP % 'br':
637 text += '\n'633 text += '\n'
638 if element.tail:634 if element.tail:
639 text += element.tail635 text += element.tail
640 return text636 return text
641 # Start formatting tag.637 # Start formatting tag.
642 # TODO: Verify format() with template variables638 if element.tag == NSMAP.format(tag='tag'):
643 if element.tag == NSMAP % 'tag':
644 text += '{{{name}}}'.format(name=element.get('name'))639 text += '{{{name}}}'.format(name=element.get('name'))
645 # Some formattings may have only start tag.640 # Some formattings may have only start tag.
646 # Handle this case if element has no children and contains no text.641 # Handle this case if element has no children and contains no text.
@@ -654,8 +649,7 @@
654 # Use recursion since nested formatting tags are allowed.649 # Use recursion since nested formatting tags are allowed.
655 text += self._process_lines_mixed_content(child, newlines)650 text += self._process_lines_mixed_content(child, newlines)
656 # Append text from tail and add formatting end tag.651 # Append text from tail and add formatting end tag.
657 # TODO: Verify format() with template variables652 if element.tag == NSMAP.format(tag='tag') and use_endtag:
658 if element.tag == NSMAP % 'tag' and use_endtag:
659 text += '{{/{name}}}'.format(name=element.get('name'))653 text += '{{/{name}}}'.format(name=element.get('name'))
660 # Append text from tail.654 # Append text from tail.
661 if element.tail:655 if element.tail:
@@ -682,8 +676,7 @@
682 # Loop over the "line" elements removing comments676 # Loop over the "line" elements removing comments
683 for line in element:677 for line in element:
684 # Skip comment lines.678 # Skip comment lines.
685 # TODO: Verify format() with template variables679 if line.tag == NSMAP.format(tag='comment'):
686 if line.tag == NSMAP % 'comment':
687 continue680 continue
688 if text:681 if text:
689 text += '\n'682 text += '\n'
690683
=== modified file 'openlp/plugins/songusage/forms/songusagedeleteform.py'
--- openlp/plugins/songusage/forms/songusagedeleteform.py 2016-12-31 11:01:36 +0000
+++ openlp/plugins/songusage/forms/songusagedeleteform.py 2017-06-01 06:24:55 +0000
@@ -53,9 +53,7 @@
53 'Delete Selected Song Usage Events?'),53 'Delete Selected Song Usage Events?'),
54 translate('SongUsagePlugin.SongUsageDeleteForm',54 translate('SongUsagePlugin.SongUsageDeleteForm',
55 'Are you sure you want to delete selected Song Usage data?'),55 'Are you sure you want to delete selected Song Usage data?'),
56 QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Yes |56 defaultButton=QtWidgets.QMessageBox.No)
57 QtWidgets.QMessageBox.No),
58 QtWidgets.QMessageBox.No)
59 if ret == QtWidgets.QMessageBox.Yes:57 if ret == QtWidgets.QMessageBox.Yes:
60 delete_date = self.delete_calendar.selectedDate().toPyDate()58 delete_date = self.delete_calendar.selectedDate().toPyDate()
61 self.manager.delete_all_objects(SongUsageItem, SongUsageItem.usagedate <= delete_date)59 self.manager.delete_all_objects(SongUsageItem, SongUsageItem.usagedate <= delete_date)
6260
=== modified file 'tests/functional/openlp_core_ui/test_formattingtagsform.py'
--- tests/functional/openlp_core_ui/test_formattingtagsform.py 2017-04-24 05:17:55 +0000
+++ tests/functional/openlp_core_ui/test_formattingtagsform.py 2017-06-01 06:24:55 +0000
@@ -27,12 +27,6 @@
2727
28from openlp.core.ui.formattingtagform import FormattingTagForm28from openlp.core.ui.formattingtagform import FormattingTagForm
2929
30# TODO: Tests Still TODO
31# __init__
32# exec
33# on_saved_clicked
34# _reloadTable
35
3630
37class TestFormattingTagForm(TestCase):31class TestFormattingTagForm(TestCase):
3832
3933
=== modified file 'tests/functional/openlp_core_ui/test_thememanager.py'
--- tests/functional/openlp_core_ui/test_thememanager.py 2017-05-24 19:31:48 +0000
+++ tests/functional/openlp_core_ui/test_thememanager.py 2017-06-01 06:24:55 +0000
@@ -176,7 +176,7 @@
176 self.assertTrue(result)176 self.assertTrue(result)
177 mocked_qmessagebox_question.assert_called_once_with(177 mocked_qmessagebox_question.assert_called_once_with(
178 theme_manager, 'Theme Already Exists', 'Theme Theme Name already exists. Do you want to replace it?',178 theme_manager, 'Theme Already Exists', 'Theme Theme Name already exists. Do you want to replace it?',
179 ANY, ANY)179 defaultButton=ANY)
180180
181 def test_over_write_message_box_no(self):181 def test_over_write_message_box_no(self):
182 """182 """
@@ -196,7 +196,7 @@
196 self.assertFalse(result)196 self.assertFalse(result)
197 mocked_qmessagebox_question.assert_called_once_with(197 mocked_qmessagebox_question.assert_called_once_with(
198 theme_manager, 'Theme Already Exists', 'Theme Theme Name already exists. Do you want to replace it?',198 theme_manager, 'Theme Already Exists', 'Theme Theme Name already exists. Do you want to replace it?',
199 ANY, ANY)199 defaultButton=ANY)
200200
201 def test_unzip_theme(self):201 def test_unzip_theme(self):
202 """202 """
203203
=== modified file 'tests/functional/openlp_plugins/bibles/test_bibleserver.py'
--- tests/functional/openlp_plugins/bibles/test_bibleserver.py 2017-04-24 05:17:55 +0000
+++ tests/functional/openlp_plugins/bibles/test_bibleserver.py 2017-06-01 06:24:55 +0000
@@ -29,45 +29,11 @@
2929
30from openlp.plugins.bibles.lib.importers.http import BSExtract30from openlp.plugins.bibles.lib.importers.http import BSExtract
3131
32# TODO: Items left to test
33# BGExtract
34# __init__
35# _remove_elements
36# _extract_verse
37# _clean_soup
38# _extract_verses
39# _extract_verses_old
40# get_bible_chapter
41# get_books_from_http
42# _get_application
43# CWExtract
44# __init__
45# get_bible_chapter
46# get_books_from_http
47# _get_application
48# HTTPBible
49# __init__
50# do_import
51# get_verses
52# get_chapter
53# get_books
54# get_chapter_count
55# get_verse_count
56# _get_application
57# get_soup_for_bible_ref
58# send_error_message
59
6032
61class TestBSExtract(TestCase):33class TestBSExtract(TestCase):
62 """34 """
63 Test the BSExtractClass35 Test the BSExtractClass
64 """36 """
65 # TODO: Items left to test
66 # BSExtract
67 # __init__
68 # get_bible_chapter
69 # get_books_from_http
70 # _get_application
71 def setUp(self):37 def setUp(self):
72 self.get_soup_for_bible_ref_patcher = patch('openlp.plugins.bibles.lib.importers.http.get_soup_for_bible_ref')38 self.get_soup_for_bible_ref_patcher = patch('openlp.plugins.bibles.lib.importers.http.get_soup_for_bible_ref')
73 self.log_patcher = patch('openlp.plugins.bibles.lib.importers.http.log')39 self.log_patcher = patch('openlp.plugins.bibles.lib.importers.http.log')
7440
=== modified file 'tests/functional/openlp_plugins/bibles/test_mediaitem.py'
--- tests/functional/openlp_plugins/bibles/test_mediaitem.py 2017-04-03 20:28:16 +0000
+++ tests/functional/openlp_plugins/bibles/test_mediaitem.py 2017-06-01 06:24:55 +0000
@@ -199,9 +199,6 @@
199 self.assertTrue(self.media_item.has_delete_icon, 'Check that the icon is called as True.')199 self.assertTrue(self.media_item.has_delete_icon, 'Check that the icon is called as True.')
200 self.assertFalse(self.media_item.add_to_service_item, 'Check that the icon is called as False')200 self.assertFalse(self.media_item.add_to_service_item, 'Check that the icon is called as False')
201201
202 # TODO: Test add_end_header_bar
203 # TODO: Test setupUi
204
205 def test_on_focus_search_tab_visible(self):202 def test_on_focus_search_tab_visible(self):
206 """203 """
207 Test the correct widget gets focus when the BibleMediaItem receives focus204 Test the correct widget gets focus when the BibleMediaItem receives focus
@@ -1358,8 +1355,6 @@
1358 self.assertTrue(self.mocked_main_window.information_message.called)1355 self.assertTrue(self.mocked_main_window.information_message.called)
1359 mocked_display_results.assert_called_once_with()1356 mocked_display_results.assert_called_once_with()
13601357
1361 # TODO: Test text_search
1362
1363 def test_on_search_edit_text_changed_search_while_typing_disabled(self):1358 def test_on_search_edit_text_changed_search_while_typing_disabled(self):
1364 """1359 """
1365 Test on_search_edit_text_changed when 'search while typing' is disabled1360 Test on_search_edit_text_changed when 'search while typing' is disabled
13661361
=== modified file 'tests/functional/openlp_plugins/presentations/test_pptviewcontroller.py'
--- tests/functional/openlp_plugins/presentations/test_pptviewcontroller.py 2017-04-24 05:17:55 +0000
+++ tests/functional/openlp_plugins/presentations/test_pptviewcontroller.py 2017-06-01 06:24:55 +0000
@@ -42,11 +42,6 @@
42 """42 """
43 Test the PptviewController Class43 Test the PptviewController Class
44 """44 """
45# TODO: Items left to test
46# PptviewController
47# start_process(self)
48# kill
49
50 def setUp(self):45 def setUp(self):
51 """46 """
52 Set up the patches and mocks need for all tests.47 Set up the patches and mocks need for all tests.
@@ -103,24 +98,6 @@
103 """98 """
104 Test the PptviewDocument Class99 Test the PptviewDocument Class
105 """100 """
106 # TODO: Items left to test
107 # PptviewDocument
108 # __init__
109 # create_thumbnails
110 # close_presentation
111 # is_loaded
112 # is_active
113 # blank_screen
114 # unblank_screen
115 # is_blank
116 # stop_presentation
117 # start_presentation
118 # get_slide_number
119 # get_slide_count
120 # goto_slide
121 # next_step
122 # previous_step
123
124 def setUp(self):101 def setUp(self):
125 """102 """
126 Set up the patches and mocks need for all tests.103 Set up the patches and mocks need for all tests.
127104
=== modified file 'tests/functional/openlp_plugins/presentations/test_presentationcontroller.py'
--- tests/functional/openlp_plugins/presentations/test_presentationcontroller.py 2017-04-24 05:17:55 +0000
+++ tests/functional/openlp_plugins/presentations/test_presentationcontroller.py 2017-06-01 06:24:55 +0000
@@ -36,19 +36,6 @@
36 """36 """
37 Test the PresentationController.37 Test the PresentationController.
38 """38 """
39 # TODO: Items left to test
40 # PresentationController
41 # __init__
42 # enabled
43 # is_available
44 # check_available
45 # start_process
46 # kill
47 # add_document
48 # remove_doc
49 # close_presentation
50 # _get_plugin_manager
51
52 def setUp(self):39 def setUp(self):
53 self.get_thumbnail_folder_patcher = \40 self.get_thumbnail_folder_patcher = \
54 patch('openlp.plugins.presentations.lib.presentationcontroller.PresentationDocument.get_thumbnail_folder')41 patch('openlp.plugins.presentations.lib.presentationcontroller.PresentationDocument.get_thumbnail_folder')
@@ -183,32 +170,6 @@
183 """170 """
184 Test the PresentationDocument Class171 Test the PresentationDocument Class
185 """172 """
186 # TODO: Items left to test
187 # PresentationDocument
188 # __init__
189 # presentation_deleted
190 # get_thumbnail_folder
191 # get_temp_folder
192 # check_thumbnails
193 # close_presentation
194 # is_active
195 # is_loaded
196 # blank_screen
197 # unblank_screen
198 # is_blank
199 # stop_presentation
200 # start_presentation
201 # get_slide_number
202 # get_slide_count
203 # goto_slide
204 # next_step
205 # previous_step
206 # convert_thumbnail
207 # get_thumbnail_path
208 # poll_slidenumber
209 # get_slide_text
210 # get_slide_notes
211
212 def setUp(self):173 def setUp(self):
213 """174 """
214 Set up the patches and mocks need for all tests.175 Set up the patches and mocks need for all tests.
215176
=== modified file 'tests/functional/openlp_plugins/songs/test_foilpresenterimport.py'
--- tests/functional/openlp_plugins/songs/test_foilpresenterimport.py 2017-04-24 05:17:55 +0000
+++ tests/functional/openlp_plugins/songs/test_foilpresenterimport.py 2017-06-01 06:24:55 +0000
@@ -36,18 +36,6 @@
36 """36 """
37 Test the functions in the :mod:`foilpresenterimport` module.37 Test the functions in the :mod:`foilpresenterimport` module.
38 """38 """
39 # TODO: The following modules still need tests written for
40 # xml_to_song
41 # to_str
42 # _process_authors
43 # _process_cclinumber
44 # _process_comments
45 # _process_copyright
46 # _process_lyrics
47 # _process_songbooks
48 # _process_titles
49 # _process_topics
50
51 def setUp(self):39 def setUp(self):
52 self.to_str_patcher = patch('openlp.plugins.songs.lib.importers.foilpresenter.to_str')40 self.to_str_patcher = patch('openlp.plugins.songs.lib.importers.foilpresenter.to_str')
53 self.clean_song_patcher = patch('openlp.plugins.songs.lib.importers.foilpresenter.clean_song')41 self.clean_song_patcher = patch('openlp.plugins.songs.lib.importers.foilpresenter.clean_song')
5442
=== modified file 'tests/functional/openlp_plugins/songs/test_songselect.py'
--- tests/functional/openlp_plugins/songs/test_songselect.py 2017-03-10 22:48:59 +0000
+++ tests/functional/openlp_plugins/songs/test_songselect.py 2017-06-01 06:24:55 +0000
@@ -612,8 +612,7 @@
612 mocked_song_select_importer.save_song.assert_called_with(None)612 mocked_song_select_importer.save_song.assert_called_with(None)
613 mocked_question.assert_called_with(ssform, 'Song Imported',613 mocked_question.assert_called_with(ssform, 'Song Imported',
614 'Your song has been imported, would you like to import more songs?',614 'Your song has been imported, would you like to import more songs?',
615 QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No,615 defaultButton=QtWidgets.QMessageBox.Yes)
616 QtWidgets.QMessageBox.Yes)
617 mocked_on_back_button_clicked.assert_called_with()616 mocked_on_back_button_clicked.assert_called_with()
618 self.assertIsNone(ssform.song)617 self.assertIsNone(ssform.song)
619618
@@ -639,8 +638,7 @@
639 mocked_song_select_importer.save_song.assert_called_with(None)638 mocked_song_select_importer.save_song.assert_called_with(None)
640 mocked_question.assert_called_with(ssform, 'Song Imported',639 mocked_question.assert_called_with(ssform, 'Song Imported',
641 'Your song has been imported, would you like to import more songs?',640 'Your song has been imported, would you like to import more songs?',
642 QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No,641 defaultButton=QtWidgets.QMessageBox.Yes)
643 QtWidgets.QMessageBox.Yes)
644 mocked_done.assert_called_with(QtWidgets.QDialog.Accepted)642 mocked_done.assert_called_with(QtWidgets.QDialog.Accepted)
645 self.assertIsNone(ssform.song)643 self.assertIsNone(ssform.song)
646644