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
1=== modified file 'openlp/core/__init__.py'
2--- openlp/core/__init__.py 2017-04-11 08:05:13 +0000
3+++ openlp/core/__init__.py 2017-06-01 06:24:55 +0000
4@@ -251,8 +251,7 @@
5 if QtWidgets.QMessageBox.question(None, translate('OpenLP', 'Backup'),
6 translate('OpenLP', 'OpenLP has been upgraded, do you want to create\n'
7 'a backup of the old data folder?'),
8- QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No,
9- QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.Yes:
10+ defaultButton=QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.Yes:
11 # Create copy of data folder
12 data_folder_path = AppLocation.get_data_path()
13 timestamp = time.strftime("%Y%m%d-%H%M%S")
14
15=== modified file 'openlp/core/common/languagemanager.py'
16--- openlp/core/common/languagemanager.py 2017-03-28 00:36:54 +0000
17+++ openlp/core/common/languagemanager.py 2017-06-01 06:24:55 +0000
18@@ -140,8 +140,8 @@
19 reg_ex = QtCore.QRegExp("^.*i18n/(.*).qm")
20 if reg_ex.exactMatch(qmf):
21 name = '{regex}'.format(regex=reg_ex.cap(1))
22- # TODO: Test before converting to python3 string format
23- LanguageManager.__qm_list__['%#2i %s' % (counter + 1, LanguageManager.language_name(qmf))] = name
24+ LanguageManager.__qm_list__[
25+ '{count:>2i} {name}'.format(count=counter + 1, name=LanguageManager.language_name(qmf))] = name
26
27 @staticmethod
28 def get_qm_list():
29
30=== modified file 'openlp/core/common/uistrings.py'
31--- openlp/core/common/uistrings.py 2017-01-08 19:12:12 +0000
32+++ openlp/core/common/uistrings.py 2017-06-01 06:24:55 +0000
33@@ -154,8 +154,6 @@
34 self.Split = translate('OpenLP.Ui', 'Optional &Split')
35 self.SplitToolTip = translate('OpenLP.Ui',
36 'Split a slide into two only if it does not fit on the screen as one slide.')
37- # TODO: WHERE is this used at? cannot find where it's used at in code.
38- self.StartTimeCode = translate('OpenLP.Ui', 'Start {code}')
39 self.StopPlaySlidesInLoop = translate('OpenLP.Ui', 'Stop Play Slides in Loop')
40 self.StopPlaySlidesToEnd = translate('OpenLP.Ui', 'Stop Play Slides to End')
41 self.Theme = translate('OpenLP.Ui', 'Theme', 'Singular')
42
43=== modified file 'openlp/core/lib/exceptions.py'
44--- openlp/core/lib/exceptions.py 2016-12-31 11:01:36 +0000
45+++ openlp/core/lib/exceptions.py 2017-06-01 06:24:55 +0000
46@@ -24,7 +24,6 @@
47 """
48
49
50-# TODO: Test __init__ & __str__
51 class ValidationError(Exception):
52 """
53 The :class:`~openlp.core.lib.exceptions.ValidationError` exception provides a custom exception for validating
54
55=== modified file 'openlp/core/lib/imagemanager.py'
56--- openlp/core/lib/imagemanager.py 2016-12-31 11:01:36 +0000
57+++ openlp/core/lib/imagemanager.py 2017-06-01 06:24:55 +0000
58@@ -110,6 +110,8 @@
59 :param width: The width of the image, defaults to -1 meaning that the screen width will be used.
60 :param height: The height of the image, defaults to -1 meaning that the screen height will be used.
61 """
62+ if not os.path.exists(path):
63+ raise FileNotFoundError('{path} not found'.format(path=path))
64 self.path = path
65 self.image = None
66 self.image_bytes = None
67@@ -119,9 +121,7 @@
68 self.timestamp = 0
69 self.width = width
70 self.height = height
71- # FIXME: We assume that the path exist. The caller has to take care that it exists!
72- if os.path.exists(path):
73- self.timestamp = os.stat(path).st_mtime
74+ self.timestamp = os.stat(path).st_mtime
75 self.secondary_priority = Image.secondary_priority
76 Image.secondary_priority += 1
77
78
79=== modified file 'openlp/core/ui/advancedtab.py'
80--- openlp/core/ui/advancedtab.py 2017-05-22 18:22:43 +0000
81+++ openlp/core/ui/advancedtab.py 2017-06-01 06:24:55 +0000
82@@ -495,9 +495,7 @@
83 'location of the OpenLP data directory to:\n\n{path}'
84 '\n\nThe data directory will be changed when OpenLP is '
85 'closed.').format(path=new_data_path),
86- QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Yes |
87- QtWidgets.QMessageBox.No),
88- QtWidgets.QMessageBox.No)
89+ defaultButton=QtWidgets.QMessageBox.No)
90 if answer != QtWidgets.QMessageBox.Yes:
91 self.data_directory_path_edit.path = AppLocation.get_data_path()
92 return
93
94=== modified file 'openlp/core/ui/firsttimeform.py'
95--- openlp/core/ui/firsttimeform.py 2016-12-31 11:01:36 +0000
96+++ openlp/core/ui/firsttimeform.py 2017-06-01 06:24:55 +0000
97@@ -206,7 +206,6 @@
98 trace_error_handler(log)
99 self.update_screen_list_combo()
100 self.application.process_events()
101- # TODO: Tested at home
102 self.downloading = translate('OpenLP.FirstTimeWizard', 'Downloading {name}...')
103 if self.has_run_wizard:
104 self.songs_check_box.setChecked(self.plugin_manager.get_plugin_by_name('songs').is_active())
105@@ -563,7 +562,6 @@
106 item = self.songs_list_widget.item(i)
107 if item.checkState() == QtCore.Qt.Checked:
108 filename, sha256 = item.data(QtCore.Qt.UserRole)
109- # TODO: Tested at home
110 self._increment_progress_bar(self.downloading.format(name=filename), 0)
111 self.previous_size = 0
112 destination = os.path.join(songs_destination, str(filename))
113@@ -576,7 +574,6 @@
114 item = bibles_iterator.value()
115 if item.parent() and item.checkState(0) == QtCore.Qt.Checked:
116 bible, sha256 = item.data(0, QtCore.Qt.UserRole)
117- # TODO: Tested at home
118 self._increment_progress_bar(self.downloading.format(name=bible), 0)
119 self.previous_size = 0
120 if not url_get_file(self, '{path}{name}'.format(path=self.bibles_url, name=bible),
121@@ -589,7 +586,6 @@
122 item = self.themes_list_widget.item(i)
123 if item.checkState() == QtCore.Qt.Checked:
124 theme, sha256 = item.data(QtCore.Qt.UserRole)
125- # TODO: Tested at home
126 self._increment_progress_bar(self.downloading.format(name=theme), 0)
127 self.previous_size = 0
128 if not url_get_file(self, '{path}{name}'.format(path=self.themes_url, name=theme),
129
130=== modified file 'openlp/core/ui/formattingtagcontroller.py'
131--- openlp/core/ui/formattingtagcontroller.py 2016-12-31 11:01:36 +0000
132+++ openlp/core/ui/formattingtagcontroller.py 2017-06-01 06:24:55 +0000
133@@ -130,8 +130,7 @@
134 elif not match.group('empty'):
135 end_tags.append(tag)
136 match = self.html_tag_regex.search(start_html, match.end())
137- # TODO: Verify format() works with lambda
138- return ''.join(map(lambda tag: '</%s>' % tag, reversed(end_tags)))
139+ return ''.join(map(lambda tag: '</{tag}>'.format(tag=tag), reversed(end_tags)))
140
141 def start_tag_changed(self, start_html, end_html):
142 """
143
144=== modified file 'openlp/core/ui/formattingtagform.py'
145--- openlp/core/ui/formattingtagform.py 2016-12-31 11:01:36 +0000
146+++ openlp/core/ui/formattingtagform.py 2017-06-01 06:24:55 +0000
147@@ -122,8 +122,7 @@
148 self.tag_table_widget.item(count, 2).text(),
149 self.tag_table_widget.item(count, 3).text())
150 if error:
151- QtWidgets.QMessageBox.warning(self, translate('OpenLP.FormattingTagForm', 'Validation Error'), error,
152- QtWidgets.QMessageBox.Ok)
153+ QtWidgets.QMessageBox.warning(self, translate('OpenLP.FormattingTagForm', 'Validation Error'), error)
154 self.tag_table_widget.selectRow(count)
155 return
156 count += 1
157@@ -198,6 +197,5 @@
158 if tag:
159 self.tag_table_widget.setItem(pre_row, 3, QtWidgets.QTableWidgetItem(tag))
160 if errors:
161- QtWidgets.QMessageBox.warning(self, translate('OpenLP.FormattingTagForm', 'Validation Error'), errors,
162- QtWidgets.QMessageBox.Ok)
163+ QtWidgets.QMessageBox.warning(self, translate('OpenLP.FormattingTagForm', 'Validation Error'), errors)
164 self.tag_table_widget.resizeRowsToContents()
165
166=== modified file 'openlp/core/ui/lib/pathedit.py'
167--- openlp/core/ui/lib/pathedit.py 2017-05-30 20:50:26 +0000
168+++ openlp/core/ui/lib/pathedit.py 2017-06-01 06:24:55 +0000
169@@ -48,7 +48,7 @@
170 :type parent: QWidget or None
171
172 :param dialog_caption: Used to customise the caption in the QFileDialog.
173- :param dialog_caption: str
174+ :type dialog_caption: str
175
176 :param default_path: The default path. This is set as the path when the revert button is clicked
177 :type default_path: str
178
179=== modified file 'openlp/core/ui/lib/wizard.py'
180--- openlp/core/ui/lib/wizard.py 2016-12-31 11:01:36 +0000
181+++ openlp/core/ui/lib/wizard.py 2017-06-01 06:24:55 +0000
182@@ -50,13 +50,13 @@
183 # These strings should need a good reason to be retranslated elsewhere.
184 FinishedImport = translate('OpenLP.Ui', 'Finished import.')
185 FormatLabel = translate('OpenLP.Ui', 'Format:')
186- HeaderStyle = '<span style="font-size:14pt; font-weight:600;">%s</span>'
187+ HeaderStyle = '<span style="font-size:14pt; font-weight:600;">{text}</span>'
188 Importing = translate('OpenLP.Ui', 'Importing')
189- ImportingType = translate('OpenLP.Ui', 'Importing "%s"...')
190+ ImportingType = translate('OpenLP.Ui', 'Importing "{source}"...')
191 ImportSelect = translate('OpenLP.Ui', 'Select Import Source')
192 ImportSelectLong = translate('OpenLP.Ui', 'Select the import format and the location to import from.')
193- OpenTypeFile = translate('OpenLP.Ui', 'Open %s File')
194- OpenTypeFolder = translate('OpenLP.Ui', 'Open %s Folder')
195+ OpenTypeFile = translate('OpenLP.Ui', 'Open {file_type} File')
196+ OpenTypeFolder = translate('OpenLP.Ui', 'Open {folder_name} Folder')
197 PercentSymbolFormat = translate('OpenLP.Ui', '%p%')
198 Ready = translate('OpenLP.Ui', 'Ready.')
199 StartingImport = translate('OpenLP.Ui', 'Starting import...')
200
201=== modified file 'openlp/core/ui/mainwindow.py'
202--- openlp/core/ui/mainwindow.py 2017-03-23 04:43:13 +0000
203+++ openlp/core/ui/mainwindow.py 2017-06-01 06:24:55 +0000
204@@ -920,8 +920,7 @@
205 QtWidgets.QMessageBox.information(self, translate('OpenLP.MainWindow', 'Import settings'),
206 translate('OpenLP.MainWindow',
207 'OpenLP will now close. Imported settings will '
208- 'be applied the next time you start OpenLP.'),
209- QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Ok))
210+ 'be applied the next time you start OpenLP.'))
211 self.settings_imported = True
212 self.clean_up()
213 QtCore.QCoreApplication.exit()
214@@ -1316,7 +1315,6 @@
215 self.recent_files_menu.clear()
216 for file_id, filename in enumerate(recent_files_to_display):
217 log.debug('Recent file name: {name}'.format(name=filename))
218- # TODO: Should be good
219 action = create_action(self, '',
220 text='&{n} {name}'.format(n=file_id + 1,
221 name=os.path.splitext(os.path.basename(str(filename)))[0]),
222
223=== modified file 'openlp/core/ui/media/mediacontroller.py'
224--- openlp/core/ui/media/mediacontroller.py 2017-05-15 10:09:59 +0000
225+++ openlp/core/ui/media/mediacontroller.py 2017-06-01 06:24:55 +0000
226@@ -466,9 +466,10 @@
227 player = self.media_players[used_players[0]]
228 if suffix not in player.video_extensions_list and suffix not in player.audio_extensions_list:
229 # Media could not be loaded correctly
230- critical_error_message_box(translate('MediaPlugin.MediaItem', 'Unsupported Media File'),
231- translate('MediaPlugin.MediaItem', 'File %s not supported using player %s') %
232- (service_item.get_frame_path(), used_players[0]))
233+ critical_error_message_box(
234+ translate('MediaPlugin.MediaItem', 'Unsupported Media File'),
235+ translate('MediaPlugin.MediaItem', 'File {file_path} not supported using player {player_name}'
236+ ).format(file_path=service_item.get_frame_path(), player_name=used_players[0]))
237 return False
238 media_data = MediaInfoWrapper.parse(service_item.get_frame_path())
239 # duration returns in milli seconds
240
241=== modified file 'openlp/core/ui/pluginform.py'
242--- openlp/core/ui/pluginform.py 2016-12-31 11:01:36 +0000
243+++ openlp/core/ui/pluginform.py 2017-06-01 06:24:55 +0000
244@@ -60,7 +60,6 @@
245 self._clear_details()
246 self.programatic_change = True
247 plugin_list_width = 0
248- # TODO: Tested at home
249 for plugin in self.plugin_manager.plugins:
250 item = QtWidgets.QListWidgetItem(self.plugin_list_widget)
251 # We do this just to make 100% sure the status is an integer as
252@@ -137,7 +136,6 @@
253 self.active_plugin.app_startup()
254 else:
255 self.active_plugin.toggle_status(PluginStatus.Inactive)
256- # TODO: Tested at home
257 status_text = translate('OpenLP.PluginForm', '{name} (Inactive)')
258 if self.active_plugin.status == PluginStatus.Active:
259 status_text = translate('OpenLP.PluginForm', '{name} (Active)')
260
261=== modified file 'openlp/core/ui/shortcutlistform.py'
262--- openlp/core/ui/shortcutlistform.py 2016-12-31 11:01:36 +0000
263+++ openlp/core/ui/shortcutlistform.py 2017-06-01 06:24:55 +0000
264@@ -279,9 +279,7 @@
265 return
266 if QtWidgets.QMessageBox.question(self, translate('OpenLP.ShortcutListDialog', 'Restore Default Shortcuts'),
267 translate('OpenLP.ShortcutListDialog', 'Do you want to restore all '
268- 'shortcuts to their defaults?'),
269- QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Yes |
270- QtWidgets.QMessageBox.No)
271+ 'shortcuts to their defaults?')
272 ) == QtWidgets.QMessageBox.No:
273 return
274 self._adjust_button(self.primary_push_button, False, text='')
275
276=== modified file 'openlp/core/ui/thememanager.py'
277--- openlp/core/ui/thememanager.py 2017-05-30 13:55:39 +0000
278+++ openlp/core/ui/thememanager.py 2017-06-01 06:24:55 +0000
279@@ -257,10 +257,9 @@
280 Renames an existing theme to a new name
281 :param field:
282 """
283- # TODO: Check for delayed format() conversions
284 if self._validate_theme_action(translate('OpenLP.ThemeManager', 'You must select a theme to rename.'),
285 translate('OpenLP.ThemeManager', 'Rename Confirmation'),
286- translate('OpenLP.ThemeManager', 'Rename %s theme?'), False, False):
287+ translate('OpenLP.ThemeManager', 'Rename {theme_name} theme?'), False, False):
288 item = self.theme_list_widget.currentItem()
289 old_theme_name = item.data(QtCore.Qt.UserRole)
290 self.file_rename_form.file_name_edit.setText(old_theme_name)
291@@ -334,10 +333,9 @@
292 Delete a theme triggered by the UI.
293 :param field:
294 """
295- # TODO: Verify delayed format() conversions
296 if self._validate_theme_action(translate('OpenLP.ThemeManager', 'You must select a theme to delete.'),
297 translate('OpenLP.ThemeManager', 'Delete Confirmation'),
298- translate('OpenLP.ThemeManager', 'Delete %s theme?')):
299+ translate('OpenLP.ThemeManager', 'Delete {theme_name} theme?')):
300 item = self.theme_list_widget.currentItem()
301 theme = item.text()
302 row = self.theme_list_widget.row(item)
303@@ -539,9 +537,7 @@
304 translate('OpenLP.ThemeManager',
305 'Theme {name} already exists. '
306 'Do you want to replace it?').format(name=theme_name),
307- QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Yes |
308- QtWidgets.QMessageBox.No),
309- QtWidgets.QMessageBox.No)
310+ defaultButton=QtWidgets.QMessageBox.No)
311 return ret == QtWidgets.QMessageBox.Yes
312
313 def unzip_theme(self, file_name, directory):
314@@ -785,9 +781,8 @@
315 # confirm deletion
316 if confirm:
317 answer = QtWidgets.QMessageBox.question(
318- self, confirm_title, confirm_text % theme,
319- QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No),
320- QtWidgets.QMessageBox.No)
321+ self, confirm_title, confirm_text.format(theme_name=theme),
322+ defaultButton=QtWidgets.QMessageBox.No)
323 if answer == QtWidgets.QMessageBox.No:
324 return False
325 # should be the same unless default
326
327=== modified file 'openlp/plugins/alerts/alertsplugin.py'
328--- openlp/plugins/alerts/alertsplugin.py 2016-12-31 11:01:36 +0000
329+++ openlp/plugins/alerts/alertsplugin.py 2017-06-01 06:24:55 +0000
330@@ -88,21 +88,20 @@
331 }
332 }
333 """
334-# TODO: Verify format() with variable templates
335 CSS = """
336- #alert {
337+ #alert {{
338 position: absolute;
339 left: 0px;
340 top: 0px;
341 z-index: 10;
342- width: 100%%;
343- vertical-align: %s;
344- font-family: %s;
345- font-size: %spt;
346- color: %s;
347- background-color: %s;
348+ width: 100%;
349+ vertical-align: {vertical_align};
350+ font-family: {font_family};
351+ font-size: {font_size:d}pt;
352+ color: {color};
353+ background-color: {background_color};
354 word-wrap: break-word;
355- }
356+ }}
357 """
358
359 HTML = """
360@@ -228,8 +227,11 @@
361 Add CSS to the main display.
362 """
363 align = VerticalType.Names[self.settings_tab.location]
364- return CSS % (align, self.settings_tab.font_face, self.settings_tab.font_size, self.settings_tab.font_color,
365- self.settings_tab.background_color)
366+ return CSS.format(vertical_align=align,
367+ font_family=self.settings_tab.font_face,
368+ font_size=self.settings_tab.font_size,
369+ color=self.settings_tab.font_color,
370+ background_color=self.settings_tab.background_color)
371
372 @staticmethod
373 def get_display_html():
374
375=== modified file 'openlp/plugins/alerts/forms/alertform.py'
376--- openlp/plugins/alerts/forms/alertform.py 2016-12-31 11:01:36 +0000
377+++ openlp/plugins/alerts/forms/alertform.py 2017-06-01 06:24:55 +0000
378@@ -180,9 +180,7 @@
379 translate('AlertsPlugin.AlertForm', 'No Parameter Found'),
380 translate('AlertsPlugin.AlertForm',
381 'You have not entered a parameter to be replaced.\n'
382- 'Do you want to continue anyway?'),
383- QtWidgets.QMessageBox.StandardButtons(
384- QtWidgets.QMessageBox.No | QtWidgets.QMessageBox.Yes)
385+ 'Do you want to continue anyway?')
386 ) == QtWidgets.QMessageBox.No:
387 self.parameter_edit.setFocus()
388 return False
389@@ -193,9 +191,7 @@
390 translate('AlertsPlugin.AlertForm', 'No Placeholder Found'),
391 translate('AlertsPlugin.AlertForm',
392 'The alert text does not contain \'<>\'.\n'
393- 'Do you want to continue anyway?'),
394- QtWidgets.QMessageBox.StandardButtons(
395- QtWidgets.QMessageBox.No | QtWidgets.QMessageBox.Yes)
396+ 'Do you want to continue anyway?')
397 ) == QtWidgets.QMessageBox.No:
398 self.parameter_edit.setFocus()
399 return False
400
401=== modified file 'openlp/plugins/bibles/forms/bibleimportform.py'
402--- openlp/plugins/bibles/forms/bibleimportform.py 2017-05-12 21:05:50 +0000
403+++ openlp/plugins/bibles/forms/bibleimportform.py 2017-06-01 06:24:55 +0000
404@@ -421,8 +421,8 @@
405 Allow for localisation of the bible import wizard.
406 """
407 self.setWindowTitle(translate('BiblesPlugin.ImportWizardForm', 'Bible Import Wizard'))
408- self.title_label.setText(WizardStrings.HeaderStyle % translate('OpenLP.Ui',
409- 'Welcome to the Bible Import Wizard'))
410+ self.title_label.setText(WizardStrings.HeaderStyle.format(text=translate('OpenLP.Ui',
411+ 'Welcome to the Bible Import Wizard')))
412 self.information_label.setText(
413 translate('BiblesPlugin.ImportWizardForm',
414 'This wizard will help you to import Bibles from a variety of '
415
416=== modified file 'openlp/plugins/bibles/lib/__init__.py'
417--- openlp/plugins/bibles/lib/__init__.py 2017-05-05 21:00:59 +0000
418+++ openlp/plugins/bibles/lib/__init__.py 2017-06-01 06:24:55 +0000
419@@ -221,18 +221,16 @@
420 REFERENCE_SEPARATORS['sep_{role}'.format(role=role)] = '\s*(?:{source})\s*'.format(source=source_string)
421 REFERENCE_SEPARATORS['sep_{role}_default'.format(role=role)] = default_separators[index]
422 # verse range match: (<chapter>:)?<verse>(-((<chapter>:)?<verse>|end)?)?
423- # TODO: Check before converting this string
424- range_regex = '(?:(?P<from_chapter>[0-9]+)%(sep_v)s)?' \
425- '(?P<from_verse>[0-9]+)(?P<range_to>%(sep_r)s(?:(?:(?P<to_chapter>' \
426- '[0-9]+)%(sep_v)s)?(?P<to_verse>[0-9]+)|%(sep_e)s)?)?' % REFERENCE_SEPARATORS
427- # TODO: Test before converting re.compile strings
428- REFERENCE_MATCHES['range'] = re.compile('^\s*%s\s*$' % range_regex, re.UNICODE)
429+ range_regex = '(?:(?P<from_chapter>[0-9]+){sep_v})?' \
430+ '(?P<from_verse>[0-9]+)(?P<range_to>{sep_r}(?:(?:(?P<to_chapter>' \
431+ '[0-9]+){sep_v})?(?P<to_verse>[0-9]+)|{sep_e})?)?'.format_map(REFERENCE_SEPARATORS)
432+ REFERENCE_MATCHES['range'] = re.compile(r'^\s*{range}\s*$'.format(range=range_regex), re.UNICODE)
433 REFERENCE_MATCHES['range_separator'] = re.compile(REFERENCE_SEPARATORS['sep_l'], re.UNICODE)
434 # full reference match: <book>(<range>(,(?!$)|(?=$)))+
435 REFERENCE_MATCHES['full'] = \
436- re.compile('^\s*(?!\s)(?P<book>[\d]*[^\d\.]+)\.*(?<!\s)\s*'
437- '(?P<ranges>(?:%(range_regex)s(?:%(sep_l)s(?!\s*$)|(?=\s*$)))+)\s*$'
438- % dict(list(REFERENCE_SEPARATORS.items()) + [('range_regex', range_regex)]), re.UNICODE)
439+ re.compile(r'^\s*(?!\s)(?P<book>[\d]*[^\d\.]+)\.*(?<!\s)\s*'
440+ r'(?P<ranges>(?:{range_regex}(?:{sep_l}(?!\s*$)|(?=\s*$)))+)\s*$'.format(
441+ range_regex=range_regex, sep_l=REFERENCE_SEPARATORS['sep_l']), re.UNICODE)
442
443
444 def get_reference_separator(separator_type):
445
446=== modified file 'openlp/plugins/bibles/lib/db.py'
447--- openlp/plugins/bibles/lib/db.py 2017-05-06 10:51:54 +0000
448+++ openlp/plugins/bibles/lib/db.py 2017-06-01 06:24:55 +0000
449@@ -306,9 +306,8 @@
450 book_escaped = book
451 for character in RESERVED_CHARACTERS:
452 book_escaped = book_escaped.replace(character, '\\' + character)
453- # TODO: Verify regex patters before using format()
454- regex_book = re.compile('\s*%s\s*' % '\s*'.join(
455- book_escaped.split()), re.UNICODE | re.IGNORECASE)
456+ regex_book = re.compile('\\s*{book}\\s*'.format(book='\\s*'.join(book_escaped.split())),
457+ re.UNICODE | re.IGNORECASE)
458 if language_selection == LanguageSelection.Bible:
459 db_book = self.get_book(book)
460 if db_book:
461
462=== modified file 'openlp/plugins/bibles/lib/importers/http.py'
463--- openlp/plugins/bibles/lib/importers/http.py 2016-12-31 11:01:36 +0000
464+++ openlp/plugins/bibles/lib/importers/http.py 2017-06-01 06:24:55 +0000
465@@ -90,6 +90,8 @@
466 """
467 Extract verses from BibleGateway
468 """
469+ NAME = 'BibleGateway'
470+
471 def __init__(self, proxy_url=None):
472 log.debug('BGExtract.init("{url}")'.format(url=proxy_url))
473 self.proxy_url = proxy_url
474@@ -357,6 +359,8 @@
475 """
476 Extract verses from Bibleserver.com
477 """
478+ NAME = 'BibleServer'
479+
480 def __init__(self, proxy_url=None):
481 log.debug('BSExtract.init("{url}")'.format(url=proxy_url))
482 self.proxy_url = proxy_url
483@@ -458,6 +462,8 @@
484 """
485 Extract verses from CrossWalk/BibleStudyTools
486 """
487+ NAME = 'Crosswalk'
488+
489 def __init__(self, proxy_url=None):
490 log.debug('CWExtract.init("{url}")'.format(url=proxy_url))
491 self.proxy_url = proxy_url
492
493=== modified file 'openlp/plugins/custom/lib/mediaitem.py'
494--- openlp/plugins/custom/lib/mediaitem.py 2016-12-31 11:01:36 +0000
495+++ openlp/plugins/custom/lib/mediaitem.py 2017-06-01 06:24:55 +0000
496@@ -190,9 +190,7 @@
497 translate('CustomPlugin.MediaItem',
498 'Are you sure you want to delete the "{items:d}" '
499 'selected custom slide(s)?').format(items=len(items)),
500- QtWidgets.QMessageBox.StandardButtons(
501- QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No),
502- QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.No:
503+ defaultButton=QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.No:
504 return
505 row_list = [item.row() for item in self.list_view.selectedIndexes()]
506 row_list.sort(reverse=True)
507
508=== modified file 'openlp/plugins/images/lib/mediaitem.py'
509--- openlp/plugins/images/lib/mediaitem.py 2016-12-31 11:01:36 +0000
510+++ openlp/plugins/images/lib/mediaitem.py 2017-06-01 06:24:55 +0000
511@@ -246,9 +246,7 @@
512 translate('ImagePlugin.MediaItem', 'Remove group'),
513 translate('ImagePlugin.MediaItem',
514 'Are you sure you want to remove "{name}" and everything in it?'
515- ).format(name=item_data.group_name),
516- QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Yes |
517- QtWidgets.QMessageBox.No)
518+ ).format(name=item_data.group_name)
519 ) == QtWidgets.QMessageBox.Yes:
520 self.recursively_delete_group(item_data)
521 self.manager.delete_object(ImageGroups, row_item.data(0, QtCore.Qt.UserRole).id)
522@@ -597,8 +595,7 @@
523 self, translate('ImagePlugin.MediaItem', 'Missing Image(s)'),
524 translate('ImagePlugin.MediaItem', 'The following image(s) no longer exist: {names}\n'
525 'Do you want to add the other images anyway?'
526- ).format(names='\n'.join(missing_items_file_names)),
527- QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.No | QtWidgets.QMessageBox.Yes)) == \
528+ ).format(names='\n'.join(missing_items_file_names))) == \
529 QtWidgets.QMessageBox.No:
530 return False
531 # Continue with the existing images.
532
533=== modified file 'openlp/plugins/presentations/lib/pdfcontroller.py'
534--- openlp/plugins/presentations/lib/pdfcontroller.py 2017-05-14 10:11:10 +0000
535+++ openlp/plugins/presentations/lib/pdfcontroller.py 2017-06-01 06:24:55 +0000
536@@ -253,15 +253,14 @@
537 try:
538 if not os.path.isdir(self.get_temp_folder()):
539 os.makedirs(self.get_temp_folder())
540+ # The %03d in the file name is handled by each binary
541 if self.controller.mudrawbin:
542 log.debug('loading presentation using mudraw')
543- # TODO: Find out where the string conversion actually happens
544 runlog = check_output([self.controller.mudrawbin, '-w', str(size.width()), '-h', str(size.height()),
545 '-o', os.path.join(self.get_temp_folder(), 'mainslide%03d.png'), self.file_path],
546 startupinfo=self.startupinfo)
547 elif self.controller.mutoolbin:
548 log.debug('loading presentation using mutool')
549- # TODO: Find out where the string convertsion actually happens
550 runlog = check_output([self.controller.mutoolbin, 'draw', '-w', str(size.width()), '-h',
551 str(size.height()),
552 '-o', os.path.join(self.get_temp_folder(), 'mainslide%03d.png'), self.file_path],
553@@ -269,7 +268,6 @@
554 elif self.controller.gsbin:
555 log.debug('loading presentation using gs')
556 resolution = self.gs_get_resolution(size)
557- # TODO: Find out where the string conversion actually happens
558 runlog = check_output([self.controller.gsbin, '-dSAFER', '-dNOPAUSE', '-dBATCH', '-sDEVICE=png16m',
559 '-r' + str(resolution), '-dTextAlphaBits=4', '-dGraphicsAlphaBits=4',
560 '-sOutputFile=' + os.path.join(self.get_temp_folder(), 'mainslide%03d.png'),
561
562=== modified file 'openlp/plugins/presentations/lib/powerpointcontroller.py'
563--- openlp/plugins/presentations/lib/powerpointcontroller.py 2017-05-14 10:11:10 +0000
564+++ openlp/plugins/presentations/lib/powerpointcontroller.py 2017-06-01 06:24:55 +0000
565@@ -81,7 +81,7 @@
566 if app_version >= 12:
567 self.also_supports = ['odp']
568 except (OSError, ValueError):
569- log.warning('Detection of powerpoint version using registry failed.')
570+ log.exception('Detection of powerpoint version using registry failed.')
571 return True
572 except OSError:
573 pass
574@@ -109,9 +109,8 @@
575 if self.process.Presentations.Count > 0:
576 return
577 self.process.Quit()
578- except (AttributeError, pywintypes.com_error) as e:
579+ except (AttributeError, pywintypes.com_error):
580 log.exception('Exception caught while killing powerpoint process')
581- log.exception(e)
582 trace_error_handler(log)
583 self.process = None
584
585@@ -154,9 +153,8 @@
586 if len(ScreenList().screen_list) > 1:
587 Registry().get('main_window').activateWindow()
588 return True
589- except (AttributeError, pywintypes.com_error) as e:
590+ except (AttributeError, pywintypes.com_error):
591 log.exception('Exception caught while loading Powerpoint presentation')
592- log.exception(e)
593 trace_error_handler(log)
594 return False
595
596@@ -192,9 +190,8 @@
597 if self.presentation:
598 try:
599 self.presentation.Close()
600- except (AttributeError, pywintypes.com_error) as e:
601+ except (AttributeError, pywintypes.com_error):
602 log.exception('Caught exception while closing powerpoint presentation')
603- log.exception(e)
604 trace_error_handler(log)
605 self.presentation = None
606 self.controller.remove_doc(self)
607@@ -210,9 +207,8 @@
608 try:
609 if self.controller.process.Presentations.Count == 0:
610 return False
611- except (AttributeError, pywintypes.com_error) as e:
612+ except (AttributeError, pywintypes.com_error):
613 log.exception('Caught exception while in is_loaded')
614- log.exception(e)
615 trace_error_handler(log)
616 return False
617 return True
618@@ -229,9 +225,8 @@
619 return False
620 if self.presentation.SlideShowWindow.View is None:
621 return False
622- except (AttributeError, pywintypes.com_error) as e:
623+ except (AttributeError, pywintypes.com_error):
624 log.exception('Caught exception while in is_active')
625- log.exception(e)
626 trace_error_handler(log)
627 return False
628 return True
629@@ -249,9 +244,8 @@
630 self.presentation.SlideShowWindow.View.GotoSlide(self.index_map[self.blank_slide], False)
631 if self.blank_click:
632 self.presentation.SlideShowWindow.View.GotoClick(self.blank_click)
633- except (AttributeError, pywintypes.com_error) as e:
634+ except (AttributeError, pywintypes.com_error):
635 log.exception('Caught exception while in unblank_screen')
636- log.exception(e)
637 trace_error_handler(log)
638 self.show_error_msg()
639 # Stop powerpoint from flashing in the taskbar
640@@ -273,9 +267,8 @@
641 self.blank_click = self.presentation.SlideShowWindow.View.GetClickIndex()
642 # ppSlideShowBlackScreen = 3
643 self.presentation.SlideShowWindow.View.State = 3
644- except (AttributeError, pywintypes.com_error) as e:
645+ except (AttributeError, pywintypes.com_error):
646 log.exception('Caught exception while in blank_screen')
647- log.exception(e)
648 trace_error_handler(log)
649 self.show_error_msg()
650
651@@ -288,9 +281,8 @@
652 try:
653 # ppSlideShowBlackScreen = 3
654 return self.presentation.SlideShowWindow.View.State == 3
655- except (AttributeError, pywintypes.com_error) as e:
656+ except (AttributeError, pywintypes.com_error):
657 log.exception('Caught exception while in is_blank')
658- log.exception(e)
659 trace_error_handler(log)
660 self.show_error_msg()
661 else:
662@@ -303,9 +295,8 @@
663 log.debug('stop_presentation')
664 try:
665 self.presentation.SlideShowWindow.View.Exit()
666- except (AttributeError, pywintypes.com_error) as e:
667+ except (AttributeError, pywintypes.com_error):
668 log.exception('Caught exception while in stop_presentation')
669- log.exception(e)
670 trace_error_handler(log)
671 self.show_error_msg()
672
673@@ -328,9 +319,8 @@
674 ppt_window = None
675 try:
676 ppt_window = self.presentation.SlideShowSettings.Run()
677- except (AttributeError, pywintypes.com_error) as e:
678+ except (AttributeError, pywintypes.com_error):
679 log.exception('Caught exception while in start_presentation')
680- log.exception(e)
681 trace_error_handler(log)
682 self.show_error_msg()
683 if ppt_window and not Settings().value('presentations/powerpoint control window'):
684@@ -339,9 +329,8 @@
685 ppt_window.Height = size.height() * 72 / dpi
686 ppt_window.Left = size.x() * 72 / dpi
687 ppt_window.Width = size.width() * 72 / dpi
688- except AttributeError as e:
689+ except AttributeError:
690 log.exception('AttributeError while in start_presentation')
691- log.exception(e)
692 # Find the presentation window and save the handle for later
693 self.presentation_hwnd = None
694 if ppt_window:
695@@ -399,9 +388,8 @@
696 ret = next((key for key, slidenum in self.index_map.items() if slidenum == ret), None)
697 else:
698 ret = self.presentation.SlideShowWindow.View.CurrentShowPosition
699- except (AttributeError, pywintypes.com_error) as e:
700+ except (AttributeError, pywintypes.com_error):
701 log.exception('Caught exception while in get_slide_number')
702- log.exception(e)
703 trace_error_handler(log)
704 self.show_error_msg()
705 return ret
706@@ -431,9 +419,8 @@
707 self.next_step()
708 else:
709 self.presentation.SlideShowWindow.View.GotoSlide(self.index_map[slide_no])
710- except (AttributeError, pywintypes.com_error) as e:
711+ except (AttributeError, pywintypes.com_error):
712 log.exception('Caught exception while in goto_slide')
713- log.exception(e)
714 trace_error_handler(log)
715 self.show_error_msg()
716
717@@ -445,9 +432,8 @@
718 try:
719 self.presentation.SlideShowWindow.Activate()
720 self.presentation.SlideShowWindow.View.Next()
721- except (AttributeError, pywintypes.com_error) as e:
722+ except (AttributeError, pywintypes.com_error):
723 log.exception('Caught exception while in next_step')
724- log.exception(e)
725 trace_error_handler(log)
726 self.show_error_msg()
727 return
728@@ -468,9 +454,8 @@
729 log.debug('previous_step')
730 try:
731 self.presentation.SlideShowWindow.View.Previous()
732- except (AttributeError, pywintypes.com_error) as e:
733+ except (AttributeError, pywintypes.com_error):
734 log.exception('Caught exception while in previous_step')
735- log.exception(e)
736 trace_error_handler(log)
737 self.show_error_msg()
738
739@@ -503,8 +488,8 @@
740 slide = self.presentation.Slides(self.index_map[num + 1])
741 try:
742 text = slide.Shapes.Title.TextFrame.TextRange.Text
743- except Exception as e:
744- log.exception(e)
745+ except Exception:
746+ log.exception('Exception raised when getting title text')
747 text = ''
748 titles.append(text.replace('\n', ' ').replace('\x0b', ' ') + '\n')
749 note = _get_text_from_shapes(slide.NotesPage.Shapes)
750@@ -519,9 +504,8 @@
751 """
752 try:
753 self.presentation.SlideShowWindow.View.Exit()
754- except (AttributeError, pywintypes.com_error) as e:
755+ except (AttributeError, pywintypes.com_error):
756 log.exception('Failed to exit Powerpoint presentation after error')
757- log.exception(e)
758 critical_error_message_box(UiStrings().Error, translate('PresentationPlugin.PowerpointDocument',
759 'An error occurred in the PowerPoint integration '
760 'and the presentation will be stopped. '
761@@ -540,7 +524,6 @@
762 if shape.PlaceholderFormat.Type == 2: # 2 from is enum PpPlaceholderType.ppPlaceholderBody
763 if shape.HasTextFrame and shape.TextFrame.HasText:
764 text += shape.TextFrame.TextRange.Text + '\n'
765- except pywintypes.com_error as e:
766- log.warning('Failed to extract text from powerpoint slide')
767- log.warning(e)
768+ except pywintypes.com_error:
769+ log.exception('Failed to extract text from powerpoint slide')
770 return text
771
772=== modified file 'openlp/plugins/remotes/remoteplugin.py'
773--- openlp/plugins/remotes/remoteplugin.py 2016-12-31 11:01:36 +0000
774+++ openlp/plugins/remotes/remoteplugin.py 2017-06-01 06:24:55 +0000
775@@ -122,5 +122,4 @@
776 translate('RemotePlugin', 'Server Config Change'),
777 translate('RemotePlugin',
778 'Server configuration changes will require a restart '
779- 'to take effect.'),
780- QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Ok))
781+ 'to take effect.'))
782
783=== modified file 'openlp/plugins/songs/forms/duplicatesongremovalform.py'
784--- openlp/plugins/songs/forms/duplicatesongremovalform.py 2016-12-31 11:01:36 +0000
785+++ openlp/plugins/songs/forms/duplicatesongremovalform.py 2017-06-01 06:24:55 +0000
786@@ -130,9 +130,9 @@
787 Song wizard localisation.
788 """
789 self.setWindowTitle(translate('Wizard', 'Wizard'))
790- # TODO: Check format() using template strings
791- self.title_label.setText(WizardStrings.HeaderStyle % translate('OpenLP.Ui',
792- 'Welcome to the Duplicate Song Removal Wizard'))
793+ self.title_label.setText(
794+ WizardStrings.HeaderStyle.format(text=translate('OpenLP.Ui',
795+ 'Welcome to the Duplicate Song Removal Wizard')))
796 self.information_label.setText(
797 translate("Wizard",
798 'This wizard will help you to remove duplicate songs from the song database. You will have a '
799@@ -216,8 +216,7 @@
800 self.button(QtWidgets.QWizard.CancelButton).hide()
801 QtWidgets.QMessageBox.information(
802 self, translate('Wizard', 'Information'),
803- translate('Wizard', 'No duplicate songs have been found in the database.'),
804- QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Ok))
805+ translate('Wizard', 'No duplicate songs have been found in the database.'))
806
807 def add_duplicates_to_song_list(self, search_song, duplicate_song):
808 """
809
810=== modified file 'openlp/plugins/songs/forms/editsongform.py'
811--- openlp/plugins/songs/forms/editsongform.py 2017-03-02 04:34:24 +0000
812+++ openlp/plugins/songs/forms/editsongform.py 2017-06-01 06:24:55 +0000
813@@ -203,8 +203,7 @@
814 'There is no verse corresponding to "{invalid}". Valid entries are {valid}.\n'
815 'Please enter the verses separated by spaces.').format(invalid=invalid_verses[0],
816 valid=valid)
817- critical_error_message_box(title=translate('SongsPlugin.EditSongForm', 'Invalid Verse Order'),
818- message=msg)
819+ critical_error_message_box(title=translate('SongsPlugin.EditSongForm', 'Invalid Verse Order'), message=msg)
820 return len(invalid_verses) == 0
821
822 def _validate_song(self):
823@@ -579,8 +578,7 @@
824 self,
825 translate('SongsPlugin.EditSongForm', 'Add Author'),
826 translate('SongsPlugin.EditSongForm', 'This author does not exist, do you want to add them?'),
827- QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No,
828- QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.Yes:
829+ defaultButton=QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.Yes:
830 if text.find(' ') == -1:
831 author = Author.populate(first_name='', last_name='', display_name=text)
832 else:
833@@ -658,8 +656,7 @@
834 if QtWidgets.QMessageBox.question(
835 self, translate('SongsPlugin.EditSongForm', 'Add Topic'),
836 translate('SongsPlugin.EditSongForm', 'This topic does not exist, do you want to add it?'),
837- QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No,
838- QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.Yes:
839+ defaultButton=QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.Yes:
840 topic = Topic.populate(name=text)
841 self.manager.save_object(topic)
842 topic_item = QtWidgets.QListWidgetItem(str(topic.name))
843@@ -705,8 +702,7 @@
844 if QtWidgets.QMessageBox.question(
845 self, translate('SongsPlugin.EditSongForm', 'Add Songbook'),
846 translate('SongsPlugin.EditSongForm', 'This Songbook does not exist, do you want to add it?'),
847- QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No,
848- QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.Yes:
849+ defaultButton=QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.Yes:
850 songbook = Book.populate(name=text)
851 self.manager.save_object(songbook)
852 self.add_songbook_entry_to_list(songbook.id, songbook.name, self.songbook_entry_edit.text())
853
854=== modified file 'openlp/plugins/songs/forms/songexportform.py'
855--- openlp/plugins/songs/forms/songexportform.py 2016-12-31 11:01:36 +0000
856+++ openlp/plugins/songs/forms/songexportform.py 2017-06-01 06:24:55 +0000
857@@ -121,7 +121,7 @@
858 self.selected_list_widget = QtWidgets.QListWidget(self.export_song_page)
859 self.selected_list_widget.setObjectName('selected_list_widget')
860 self.grid_layout.addWidget(self.selected_list_widget, 1, 0, 1, 1)
861- # FIXME: self.horizontal_layout is already defined above?!?!?
862+ # FIXME: self.horizontal_layout is already defined above?!?!? Replace with Path Eidt!
863 self.horizontal_layout = QtWidgets.QHBoxLayout()
864 self.horizontal_layout.setObjectName('horizontal_layout')
865 self.directory_label = QtWidgets.QLabel(self.export_song_page)
866@@ -143,9 +143,8 @@
867 Song wizard localisation.
868 """
869 self.setWindowTitle(translate('SongsPlugin.ExportWizardForm', 'Song Export Wizard'))
870- # TODO: Verify format() with template variables
871- self.title_label.setText(WizardStrings.HeaderStyle %
872- translate('OpenLP.Ui', 'Welcome to the Song Export Wizard'))
873+ self.title_label.setText(
874+ WizardStrings.HeaderStyle.format(text=translate('OpenLP.Ui', 'Welcome to the Song Export Wizard')))
875 self.information_label.setText(
876 translate('SongsPlugin.ExportWizardForm', 'This wizard will help to export your songs to the open and free '
877 '<strong>OpenLyrics </strong> worship song format.'))
878
879=== modified file 'openlp/plugins/songs/forms/songimportform.py'
880--- openlp/plugins/songs/forms/songimportform.py 2016-12-31 11:01:36 +0000
881+++ openlp/plugins/songs/forms/songimportform.py 2017-06-01 06:24:55 +0000
882@@ -132,9 +132,8 @@
883 Song wizard localisation.
884 """
885 self.setWindowTitle(translate('SongsPlugin.ImportWizardForm', 'Song Import Wizard'))
886- # TODO: Verify format() with template variables
887- self.title_label.setText(WizardStrings.HeaderStyle % translate('OpenLP.Ui',
888- 'Welcome to the Song Import Wizard'))
889+ self.title_label.setText(
890+ WizardStrings.HeaderStyle.format(text=translate('OpenLP.Ui', 'Welcome to the Song Import Wizard')))
891 self.information_label.setText(
892 translate('SongsPlugin.ImportWizardForm',
893 'This wizard will help you to import songs from a variety of formats. Click the next button '
894@@ -272,12 +271,11 @@
895 select_mode, format_name, ext_filter = SongFormat.get(this_format, 'selectMode', 'name', 'filter')
896 file_path_edit = self.format_widgets[this_format]['file_path_edit']
897 if select_mode == SongFormatSelect.SingleFile:
898- # TODO: Verify format() with template variables
899- self.get_file_name(
900- WizardStrings.OpenTypeFile % format_name, file_path_edit, 'last directory import', ext_filter)
901+ self.get_file_name(WizardStrings.OpenTypeFile.format(file_type=format_name),
902+ file_path_edit, 'last directory import', ext_filter)
903 elif select_mode == SongFormatSelect.SingleFolder:
904- # TODO: Verify format() with template variables
905- self.get_folder(WizardStrings.OpenTypeFolder % format_name, file_path_edit, 'last directory import')
906+ self.get_folder(
907+ WizardStrings.OpenTypeFolder.format(folder_name=format_name), file_path_edit, 'last directory import')
908
909 def on_add_button_clicked(self):
910 """
911@@ -286,8 +284,7 @@
912 this_format = self.current_format
913 select_mode, format_name, ext_filter, custom_title = \
914 SongFormat.get(this_format, 'selectMode', 'name', 'filter', 'getFilesTitle')
915- # TODO: Verify format() with template variables
916- title = custom_title if custom_title else WizardStrings.OpenTypeFile % format_name
917+ title = custom_title if custom_title else WizardStrings.OpenTypeFile.format(file_type=format_name)
918 if select_mode == SongFormatSelect.MultipleFiles:
919 self.get_files(title, self.format_widgets[this_format]['file_list_widget'], ext_filter)
920 self.source_page.completeChanged.emit()
921
922=== modified file 'openlp/plugins/songs/forms/songselectform.py'
923--- openlp/plugins/songs/forms/songselectform.py 2017-02-18 07:23:15 +0000
924+++ openlp/plugins/songs/forms/songselectform.py 2017-06-01 06:24:55 +0000
925@@ -248,8 +248,7 @@
926 translate('SongsPlugin.SongSelectForm', 'WARNING: Saving your username and password is INSECURE, your '
927 'password is stored in PLAIN TEXT. Click Yes to save your '
928 'password or No to cancel this.'),
929- QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No),
930- QtWidgets.QMessageBox.No)
931+ defaultButton=QtWidgets.QMessageBox.No)
932 if answer == QtWidgets.QMessageBox.No:
933 self.save_password_checkbox.setChecked(False)
934
935@@ -397,8 +396,7 @@
936 translate('SongsPlugin.SongSelectForm',
937 'Your song has been imported, would you '
938 'like to import more songs?'),
939- QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No,
940- QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.Yes:
941+ defaultButton=QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.Yes:
942 self.on_back_button_clicked()
943 else:
944 self.application.process_events()
945
946=== modified file 'openlp/plugins/songs/lib/importer.py'
947--- openlp/plugins/songs/lib/importer.py 2017-05-22 19:07:07 +0000
948+++ openlp/plugins/songs/lib/importer.py 2017-06-01 06:24:55 +0000
949@@ -265,7 +265,7 @@
950 },
951 EasyWorshipService: {
952 'class': EasyWorshipSongImport,
953- 'name': 'EasyWorship Service File',
954+ 'name': 'EasyWorship Service',
955 'prefix': 'ew',
956 'selectMode': SongFormatSelect.SingleFile,
957 'filter': '{text} (*.ews)'.format(text=translate('SongsPlugin.ImportWizardForm',
958
959=== modified file 'openlp/plugins/songs/lib/importers/foilpresenter.py'
960--- openlp/plugins/songs/lib/importers/foilpresenter.py 2016-12-31 11:01:36 +0000
961+++ openlp/plugins/songs/lib/importers/foilpresenter.py 2017-06-01 06:24:55 +0000
962@@ -121,8 +121,8 @@
963 for file_path in self.import_source:
964 if self.stop_import_flag:
965 return
966- # TODO: Verify format() with template strings
967- self.import_wizard.increment_progress_bar(WizardStrings.ImportingType % os.path.basename(file_path))
968+ self.import_wizard.increment_progress_bar(
969+ WizardStrings.ImportingType.format(source=os.path.basename(file_path)))
970 try:
971 parsed_file = etree.parse(file_path, parser)
972 xml = etree.tostring(parsed_file).decode()
973
974=== modified file 'openlp/plugins/songs/lib/importers/openlp.py'
975--- openlp/plugins/songs/lib/importers/openlp.py 2017-03-28 05:15:05 +0000
976+++ openlp/plugins/songs/lib/importers/openlp.py 2017-06-01 06:24:55 +0000
977@@ -275,11 +275,9 @@
978 self.manager.save_object(new_song)
979 if progress_dialog:
980 progress_dialog.setValue(progress_dialog.value() + 1)
981- # TODO: Verify format() with template strings
982- progress_dialog.setLabelText(WizardStrings.ImportingType % new_song.title)
983+ progress_dialog.setLabelText(WizardStrings.ImportingType.format(source=new_song.title))
984 else:
985- # TODO: Verify format() with template strings
986- self.import_wizard.increment_progress_bar(WizardStrings.ImportingType % new_song.title)
987+ self.import_wizard.increment_progress_bar(WizardStrings.ImportingType.format(source=new_song.title))
988 if self.stop_import_flag:
989 break
990 self.source_session.close()
991
992=== modified file 'openlp/plugins/songs/lib/importers/openlyrics.py'
993--- openlp/plugins/songs/lib/importers/openlyrics.py 2016-12-31 11:01:36 +0000
994+++ openlp/plugins/songs/lib/importers/openlyrics.py 2017-06-01 06:24:55 +0000
995@@ -58,8 +58,8 @@
996 for file_path in self.import_source:
997 if self.stop_import_flag:
998 return
999- # TODO: Verify format() with template strings
1000- self.import_wizard.increment_progress_bar(WizardStrings.ImportingType % os.path.basename(file_path))
1001+ self.import_wizard.increment_progress_bar(
1002+ WizardStrings.ImportingType.format(source=os.path.basename(file_path)))
1003 try:
1004 # Pass a file object, because lxml does not cope with some
1005 # special characters in the path (see lp:757673 and lp:744337).
1006
1007=== modified file 'openlp/plugins/songs/lib/importers/powerpraise.py'
1008--- openlp/plugins/songs/lib/importers/powerpraise.py 2016-12-31 11:01:36 +0000
1009+++ openlp/plugins/songs/lib/importers/powerpraise.py 2017-06-01 06:24:55 +0000
1010@@ -41,8 +41,8 @@
1011 for file_path in self.import_source:
1012 if self.stop_import_flag:
1013 return
1014- # TODO: Verify format() with template strings
1015- self.import_wizard.increment_progress_bar(WizardStrings.ImportingType % os.path.basename(file_path))
1016+ self.import_wizard.increment_progress_bar(
1017+ WizardStrings.ImportingType.format(source=os.path.basename(file_path)))
1018 root = objectify.parse(open(file_path, 'rb')).getroot()
1019 self.process_song(root)
1020
1021
1022=== modified file 'openlp/plugins/songs/lib/importers/presentationmanager.py'
1023--- openlp/plugins/songs/lib/importers/presentationmanager.py 2017-03-23 04:43:13 +0000
1024+++ openlp/plugins/songs/lib/importers/presentationmanager.py 2017-06-01 06:24:55 +0000
1025@@ -44,8 +44,8 @@
1026 for file_path in self.import_source:
1027 if self.stop_import_flag:
1028 return
1029- # TODO: Verify format() with template strings
1030- self.import_wizard.increment_progress_bar(WizardStrings.ImportingType % os.path.basename(file_path))
1031+ self.import_wizard.increment_progress_bar(
1032+ WizardStrings.ImportingType.format(source=os.path.basename(file_path)))
1033 try:
1034 tree = etree.parse(file_path, parser=etree.XMLParser(recover=True))
1035 except etree.XMLSyntaxError:
1036
1037=== modified file 'openlp/plugins/songs/lib/importers/propresenter.py'
1038--- openlp/plugins/songs/lib/importers/propresenter.py 2016-12-31 11:01:36 +0000
1039+++ openlp/plugins/songs/lib/importers/propresenter.py 2017-06-01 06:24:55 +0000
1040@@ -46,8 +46,8 @@
1041 for file_path in self.import_source:
1042 if self.stop_import_flag:
1043 return
1044- # TODO: Verify format() with template strings
1045- self.import_wizard.increment_progress_bar(WizardStrings.ImportingType % os.path.basename(file_path))
1046+ self.import_wizard.increment_progress_bar(
1047+ WizardStrings.ImportingType.format(source=os.path.basename(file_path)))
1048 root = objectify.parse(open(file_path, 'rb')).getroot()
1049 self.process_song(root, file_path)
1050
1051
1052=== modified file 'openlp/plugins/songs/lib/importers/songimport.py'
1053--- openlp/plugins/songs/lib/importers/songimport.py 2017-05-11 20:01:43 +0000
1054+++ openlp/plugins/songs/lib/importers/songimport.py 2017-06-01 06:24:55 +0000
1055@@ -347,8 +347,7 @@
1056 song = Song()
1057 song.title = self.title
1058 if self.import_wizard is not None:
1059- # TODO: Verify format() with template variables
1060- self.import_wizard.increment_progress_bar(WizardStrings.ImportingType % song.title)
1061+ self.import_wizard.increment_progress_bar(WizardStrings.ImportingType.format(source=song.title))
1062 song.alternate_title = self.alternate_title
1063 # Values will be set when cleaning the song.
1064 song.search_title = ''
1065
1066=== modified file 'openlp/plugins/songs/lib/importers/songshowplus.py'
1067--- openlp/plugins/songs/lib/importers/songshowplus.py 2017-05-30 20:05:18 +0000
1068+++ openlp/plugins/songs/lib/importers/songshowplus.py 2017-06-01 06:24:55 +0000
1069@@ -100,8 +100,7 @@
1070 self.other_count = 0
1071 self.other_list = {}
1072 file_name = os.path.split(file)[1]
1073- # TODO: Verify format() with template variables
1074- self.import_wizard.increment_progress_bar(WizardStrings.ImportingType % file_name, 0)
1075+ self.import_wizard.increment_progress_bar(WizardStrings.ImportingType.format(source=file_name), 0)
1076 song_data = open(file, 'rb')
1077 while True:
1078 block_key, = struct.unpack("I", song_data.read(4))
1079
1080=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
1081--- openlp/plugins/songs/lib/mediaitem.py 2017-01-25 21:17:27 +0000
1082+++ openlp/plugins/songs/lib/mediaitem.py 2017-06-01 06:24:55 +0000
1083@@ -500,8 +500,7 @@
1084 translate('SongsPlugin.MediaItem',
1085 'Are you sure you want to delete the "{items:d}" '
1086 'selected song(s)?').format(items=len(items)),
1087- QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No),
1088- QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.No:
1089+ defaultButton=QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.No:
1090 return
1091 self.application.set_busy_cursor()
1092 self.main_window.display_progress_bar(len(items))
1093
1094=== modified file 'openlp/plugins/songs/lib/openlyricsxml.py'
1095--- openlp/plugins/songs/lib/openlyricsxml.py 2017-02-26 21:14:49 +0000
1096+++ openlp/plugins/songs/lib/openlyricsxml.py 2017-06-01 06:24:55 +0000
1097@@ -70,8 +70,7 @@
1098 log = logging.getLogger(__name__)
1099
1100 NAMESPACE = 'http://openlyrics.info/namespace/2009/song'
1101-# TODO: Verify format() with template variable
1102-NSMAP = '{' + NAMESPACE + '}' + '%s'
1103+NSMAP = '{{' + NAMESPACE + '}}{tag}'
1104
1105
1106 class SongXML(object):
1107@@ -616,15 +615,13 @@
1108 text = ''
1109 use_endtag = True
1110 # Skip <comment> elements - not yet supported.
1111- # TODO: Verify format() with template variables
1112- if element.tag == NSMAP % 'comment':
1113+ if element.tag == NSMAP.format(tag='comment'):
1114 if element.tail:
1115 # Append tail text at comment element.
1116 text += element.tail
1117 return text
1118 # Convert chords to ChordPro format which OpenLP uses internally
1119- # TODO: Verify format() with template variables
1120- elif element.tag == NSMAP % 'chord':
1121+ elif element.tag == NSMAP.format(tag='chord'):
1122 if Settings().value('songs/enable chords') and not Settings().value('songs/disable chords import'):
1123 text += '[{chord}]'.format(chord=element.get('name'))
1124 if element.tail:
1125@@ -632,15 +629,13 @@
1126 text += element.tail
1127 return text
1128 # Convert line breaks <br/> to \n.
1129- # TODO: Verify format() with template variables
1130- elif newlines and element.tag == NSMAP % 'br':
1131+ elif newlines and element.tag == NSMAP.format(tag='br'):
1132 text += '\n'
1133 if element.tail:
1134 text += element.tail
1135 return text
1136 # Start formatting tag.
1137- # TODO: Verify format() with template variables
1138- if element.tag == NSMAP % 'tag':
1139+ if element.tag == NSMAP.format(tag='tag'):
1140 text += '{{{name}}}'.format(name=element.get('name'))
1141 # Some formattings may have only start tag.
1142 # Handle this case if element has no children and contains no text.
1143@@ -654,8 +649,7 @@
1144 # Use recursion since nested formatting tags are allowed.
1145 text += self._process_lines_mixed_content(child, newlines)
1146 # Append text from tail and add formatting end tag.
1147- # TODO: Verify format() with template variables
1148- if element.tag == NSMAP % 'tag' and use_endtag:
1149+ if element.tag == NSMAP.format(tag='tag') and use_endtag:
1150 text += '{{/{name}}}'.format(name=element.get('name'))
1151 # Append text from tail.
1152 if element.tail:
1153@@ -682,8 +676,7 @@
1154 # Loop over the "line" elements removing comments
1155 for line in element:
1156 # Skip comment lines.
1157- # TODO: Verify format() with template variables
1158- if line.tag == NSMAP % 'comment':
1159+ if line.tag == NSMAP.format(tag='comment'):
1160 continue
1161 if text:
1162 text += '\n'
1163
1164=== modified file 'openlp/plugins/songusage/forms/songusagedeleteform.py'
1165--- openlp/plugins/songusage/forms/songusagedeleteform.py 2016-12-31 11:01:36 +0000
1166+++ openlp/plugins/songusage/forms/songusagedeleteform.py 2017-06-01 06:24:55 +0000
1167@@ -53,9 +53,7 @@
1168 'Delete Selected Song Usage Events?'),
1169 translate('SongUsagePlugin.SongUsageDeleteForm',
1170 'Are you sure you want to delete selected Song Usage data?'),
1171- QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Yes |
1172- QtWidgets.QMessageBox.No),
1173- QtWidgets.QMessageBox.No)
1174+ defaultButton=QtWidgets.QMessageBox.No)
1175 if ret == QtWidgets.QMessageBox.Yes:
1176 delete_date = self.delete_calendar.selectedDate().toPyDate()
1177 self.manager.delete_all_objects(SongUsageItem, SongUsageItem.usagedate <= delete_date)
1178
1179=== modified file 'tests/functional/openlp_core_ui/test_formattingtagsform.py'
1180--- tests/functional/openlp_core_ui/test_formattingtagsform.py 2017-04-24 05:17:55 +0000
1181+++ tests/functional/openlp_core_ui/test_formattingtagsform.py 2017-06-01 06:24:55 +0000
1182@@ -27,12 +27,6 @@
1183
1184 from openlp.core.ui.formattingtagform import FormattingTagForm
1185
1186-# TODO: Tests Still TODO
1187-# __init__
1188-# exec
1189-# on_saved_clicked
1190-# _reloadTable
1191-
1192
1193 class TestFormattingTagForm(TestCase):
1194
1195
1196=== modified file 'tests/functional/openlp_core_ui/test_thememanager.py'
1197--- tests/functional/openlp_core_ui/test_thememanager.py 2017-05-24 19:31:48 +0000
1198+++ tests/functional/openlp_core_ui/test_thememanager.py 2017-06-01 06:24:55 +0000
1199@@ -176,7 +176,7 @@
1200 self.assertTrue(result)
1201 mocked_qmessagebox_question.assert_called_once_with(
1202 theme_manager, 'Theme Already Exists', 'Theme Theme Name already exists. Do you want to replace it?',
1203- ANY, ANY)
1204+ defaultButton=ANY)
1205
1206 def test_over_write_message_box_no(self):
1207 """
1208@@ -196,7 +196,7 @@
1209 self.assertFalse(result)
1210 mocked_qmessagebox_question.assert_called_once_with(
1211 theme_manager, 'Theme Already Exists', 'Theme Theme Name already exists. Do you want to replace it?',
1212- ANY, ANY)
1213+ defaultButton=ANY)
1214
1215 def test_unzip_theme(self):
1216 """
1217
1218=== modified file 'tests/functional/openlp_plugins/bibles/test_bibleserver.py'
1219--- tests/functional/openlp_plugins/bibles/test_bibleserver.py 2017-04-24 05:17:55 +0000
1220+++ tests/functional/openlp_plugins/bibles/test_bibleserver.py 2017-06-01 06:24:55 +0000
1221@@ -29,45 +29,11 @@
1222
1223 from openlp.plugins.bibles.lib.importers.http import BSExtract
1224
1225-# TODO: Items left to test
1226-# BGExtract
1227-# __init__
1228-# _remove_elements
1229-# _extract_verse
1230-# _clean_soup
1231-# _extract_verses
1232-# _extract_verses_old
1233-# get_bible_chapter
1234-# get_books_from_http
1235-# _get_application
1236-# CWExtract
1237-# __init__
1238-# get_bible_chapter
1239-# get_books_from_http
1240-# _get_application
1241-# HTTPBible
1242-# __init__
1243-# do_import
1244-# get_verses
1245-# get_chapter
1246-# get_books
1247-# get_chapter_count
1248-# get_verse_count
1249-# _get_application
1250-# get_soup_for_bible_ref
1251-# send_error_message
1252-
1253
1254 class TestBSExtract(TestCase):
1255 """
1256 Test the BSExtractClass
1257 """
1258- # TODO: Items left to test
1259- # BSExtract
1260- # __init__
1261- # get_bible_chapter
1262- # get_books_from_http
1263- # _get_application
1264 def setUp(self):
1265 self.get_soup_for_bible_ref_patcher = patch('openlp.plugins.bibles.lib.importers.http.get_soup_for_bible_ref')
1266 self.log_patcher = patch('openlp.plugins.bibles.lib.importers.http.log')
1267
1268=== modified file 'tests/functional/openlp_plugins/bibles/test_mediaitem.py'
1269--- tests/functional/openlp_plugins/bibles/test_mediaitem.py 2017-04-03 20:28:16 +0000
1270+++ tests/functional/openlp_plugins/bibles/test_mediaitem.py 2017-06-01 06:24:55 +0000
1271@@ -199,9 +199,6 @@
1272 self.assertTrue(self.media_item.has_delete_icon, 'Check that the icon is called as True.')
1273 self.assertFalse(self.media_item.add_to_service_item, 'Check that the icon is called as False')
1274
1275- # TODO: Test add_end_header_bar
1276- # TODO: Test setupUi
1277-
1278 def test_on_focus_search_tab_visible(self):
1279 """
1280 Test the correct widget gets focus when the BibleMediaItem receives focus
1281@@ -1358,8 +1355,6 @@
1282 self.assertTrue(self.mocked_main_window.information_message.called)
1283 mocked_display_results.assert_called_once_with()
1284
1285- # TODO: Test text_search
1286-
1287 def test_on_search_edit_text_changed_search_while_typing_disabled(self):
1288 """
1289 Test on_search_edit_text_changed when 'search while typing' is disabled
1290
1291=== modified file 'tests/functional/openlp_plugins/presentations/test_pptviewcontroller.py'
1292--- tests/functional/openlp_plugins/presentations/test_pptviewcontroller.py 2017-04-24 05:17:55 +0000
1293+++ tests/functional/openlp_plugins/presentations/test_pptviewcontroller.py 2017-06-01 06:24:55 +0000
1294@@ -42,11 +42,6 @@
1295 """
1296 Test the PptviewController Class
1297 """
1298-# TODO: Items left to test
1299-# PptviewController
1300-# start_process(self)
1301-# kill
1302-
1303 def setUp(self):
1304 """
1305 Set up the patches and mocks need for all tests.
1306@@ -103,24 +98,6 @@
1307 """
1308 Test the PptviewDocument Class
1309 """
1310- # TODO: Items left to test
1311- # PptviewDocument
1312- # __init__
1313- # create_thumbnails
1314- # close_presentation
1315- # is_loaded
1316- # is_active
1317- # blank_screen
1318- # unblank_screen
1319- # is_blank
1320- # stop_presentation
1321- # start_presentation
1322- # get_slide_number
1323- # get_slide_count
1324- # goto_slide
1325- # next_step
1326- # previous_step
1327-
1328 def setUp(self):
1329 """
1330 Set up the patches and mocks need for all tests.
1331
1332=== modified file 'tests/functional/openlp_plugins/presentations/test_presentationcontroller.py'
1333--- tests/functional/openlp_plugins/presentations/test_presentationcontroller.py 2017-04-24 05:17:55 +0000
1334+++ tests/functional/openlp_plugins/presentations/test_presentationcontroller.py 2017-06-01 06:24:55 +0000
1335@@ -36,19 +36,6 @@
1336 """
1337 Test the PresentationController.
1338 """
1339- # TODO: Items left to test
1340- # PresentationController
1341- # __init__
1342- # enabled
1343- # is_available
1344- # check_available
1345- # start_process
1346- # kill
1347- # add_document
1348- # remove_doc
1349- # close_presentation
1350- # _get_plugin_manager
1351-
1352 def setUp(self):
1353 self.get_thumbnail_folder_patcher = \
1354 patch('openlp.plugins.presentations.lib.presentationcontroller.PresentationDocument.get_thumbnail_folder')
1355@@ -183,32 +170,6 @@
1356 """
1357 Test the PresentationDocument Class
1358 """
1359- # TODO: Items left to test
1360- # PresentationDocument
1361- # __init__
1362- # presentation_deleted
1363- # get_thumbnail_folder
1364- # get_temp_folder
1365- # check_thumbnails
1366- # close_presentation
1367- # is_active
1368- # is_loaded
1369- # blank_screen
1370- # unblank_screen
1371- # is_blank
1372- # stop_presentation
1373- # start_presentation
1374- # get_slide_number
1375- # get_slide_count
1376- # goto_slide
1377- # next_step
1378- # previous_step
1379- # convert_thumbnail
1380- # get_thumbnail_path
1381- # poll_slidenumber
1382- # get_slide_text
1383- # get_slide_notes
1384-
1385 def setUp(self):
1386 """
1387 Set up the patches and mocks need for all tests.
1388
1389=== modified file 'tests/functional/openlp_plugins/songs/test_foilpresenterimport.py'
1390--- tests/functional/openlp_plugins/songs/test_foilpresenterimport.py 2017-04-24 05:17:55 +0000
1391+++ tests/functional/openlp_plugins/songs/test_foilpresenterimport.py 2017-06-01 06:24:55 +0000
1392@@ -36,18 +36,6 @@
1393 """
1394 Test the functions in the :mod:`foilpresenterimport` module.
1395 """
1396- # TODO: The following modules still need tests written for
1397- # xml_to_song
1398- # to_str
1399- # _process_authors
1400- # _process_cclinumber
1401- # _process_comments
1402- # _process_copyright
1403- # _process_lyrics
1404- # _process_songbooks
1405- # _process_titles
1406- # _process_topics
1407-
1408 def setUp(self):
1409 self.to_str_patcher = patch('openlp.plugins.songs.lib.importers.foilpresenter.to_str')
1410 self.clean_song_patcher = patch('openlp.plugins.songs.lib.importers.foilpresenter.clean_song')
1411
1412=== modified file 'tests/functional/openlp_plugins/songs/test_songselect.py'
1413--- tests/functional/openlp_plugins/songs/test_songselect.py 2017-03-10 22:48:59 +0000
1414+++ tests/functional/openlp_plugins/songs/test_songselect.py 2017-06-01 06:24:55 +0000
1415@@ -612,8 +612,7 @@
1416 mocked_song_select_importer.save_song.assert_called_with(None)
1417 mocked_question.assert_called_with(ssform, 'Song Imported',
1418 'Your song has been imported, would you like to import more songs?',
1419- QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No,
1420- QtWidgets.QMessageBox.Yes)
1421+ defaultButton=QtWidgets.QMessageBox.Yes)
1422 mocked_on_back_button_clicked.assert_called_with()
1423 self.assertIsNone(ssform.song)
1424
1425@@ -639,8 +638,7 @@
1426 mocked_song_select_importer.save_song.assert_called_with(None)
1427 mocked_question.assert_called_with(ssform, 'Song Imported',
1428 'Your song has been imported, would you like to import more songs?',
1429- QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No,
1430- QtWidgets.QMessageBox.Yes)
1431+ defaultButton=QtWidgets.QMessageBox.Yes)
1432 mocked_done.assert_called_with(QtWidgets.QDialog.Accepted)
1433 self.assertIsNone(ssform.song)
1434