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