Status: | Superseded |
---|---|
Proposed branch: | lp:~trb143/openlp/bugs-2_4b |
Merge into: | lp:openlp |
Diff against target: |
1230 lines (+351/-312) 31 files modified
openlp/core/__init__.py (+21/-20) openlp/core/common/settings.py (+5/-42) openlp/core/common/uistrings.py (+3/-2) openlp/core/lib/plugin.py (+1/-7) openlp/core/lib/serviceitem.py (+1/-6) openlp/core/ui/advancedtab.py (+13/-0) openlp/core/ui/mainwindow.py (+13/-17) openlp/core/ui/plugindialog.py (+11/-11) openlp/core/ui/printserviceform.py (+1/-1) openlp/core/ui/thememanager.py (+13/-6) openlp/plugins/bibles/bibleplugin.py (+5/-3) openlp/plugins/bibles/lib/db.py (+0/-10) openlp/plugins/bibles/lib/manager.py (+0/-5) openlp/plugins/custom/customplugin.py (+2/-4) openlp/plugins/custom/lib/mediaitem.py (+7/-5) openlp/plugins/images/imageplugin.py (+1/-24) openlp/plugins/images/lib/mediaitem.py (+8/-8) openlp/plugins/presentations/presentationplugin.py (+0/-16) openlp/plugins/remotes/html/openlp.js (+7/-1) openlp/plugins/remotes/lib/httprouter.py (+6/-3) openlp/plugins/songs/forms/editsongform.py (+1/-1) openlp/plugins/songs/lib/mediaitem.py (+3/-3) openlp/plugins/songs/lib/openlyricsxml.py (+1/-11) openlp/plugins/songs/lib/songstab.py (+0/-8) openlp/plugins/songs/songsplugin.py (+2/-5) tests/functional/openlp_core/test_init.py (+144/-0) tests/functional/openlp_core_ui/test_advancedtab.py (+69/-0) tests/functional/openlp_core_ui/test_mainwindow.py (+2/-2) tests/functional/openlp_core_utils/test_init.py (+1/-1) tests/functional/test_init.py (+0/-58) tests/utils/test_bzr_tags.py (+10/-32) |
To merge this branch: | bzr merge lp:~trb143/openlp/bugs-2_4b |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Raoul Snyman | Needs Fixing | ||
Review via email: mp+276463@code.launchpad.net |
This proposal supersedes a proposal from 2015-10-28.
This proposal has been superseded by a proposal from 2015-11-04.
Commit message
Description of the change
First merge for 2.4.
A Number of small bug fixes which could be done in 2.2.
Clean up all the 2.0 to 2.2 migrations stuff.
Create a 2.2 to 2.4 migration for settings.
Fix problems with the Tag test so you do not need to restart a branch each time we do a release.
lp:~trb143/openlp/bugs-2_4b (revision 2578)
[SUCCESS] https//
[SUCCESS] https//
[SUCCESS] https//
[SUCCESS] https//
[SUCCESS] https//
[SUCCESS] https//
[SUCCESS] https//
Tim Bentley (trb143) wrote : Posted in a previous version of this proposal | # |
Raoul Snyman (raoul-snyman) : Posted in a previous version of this proposal | # |
Raoul Snyman (raoul-snyman) wrote : Posted in a previous version of this proposal | # |
Minor "nitpicking"
Raoul Snyman (raoul-snyman) : | # |
- 2581. By Tim Bentley
-
more missed
Unmerged revisions
Preview Diff
1 | === modified file 'openlp/core/__init__.py' | |||
2 | --- openlp/core/__init__.py 2015-03-24 22:33:57 +0000 | |||
3 | +++ openlp/core/__init__.py 2015-11-04 18:37:18 +0000 | |||
4 | @@ -30,7 +30,7 @@ | |||
5 | 30 | import os | 30 | import os |
6 | 31 | import sys | 31 | import sys |
7 | 32 | import logging | 32 | import logging |
9 | 33 | from optparse import OptionParser | 33 | import argparse |
10 | 34 | from traceback import format_exception | 34 | from traceback import format_exception |
11 | 35 | import shutil | 35 | import shutil |
12 | 36 | import time | 36 | import time |
13 | @@ -282,17 +282,18 @@ | |||
14 | 282 | :return: a tuple of parsed options of type optparse.Value and a list of remaining argsZ | 282 | :return: a tuple of parsed options of type optparse.Value and a list of remaining argsZ |
15 | 283 | """ | 283 | """ |
16 | 284 | # Set up command line options. | 284 | # Set up command line options. |
28 | 285 | usage = 'Usage: %prog [options] [qt-options]' | 285 | parser = argparse.ArgumentParser(prog='openlp.py') |
29 | 286 | parser = OptionParser(usage=usage) | 286 | parser.add_argument('-e', '--no-error-form', dest='no_error_form', action='store_true', |
30 | 287 | parser.add_option('-e', '--no-error-form', dest='no_error_form', action='store_true', | 287 | help='Disable the error notification form.') |
31 | 288 | help='Disable the error notification form.') | 288 | parser.add_argument('-l', '--log-level', dest='loglevel', default='warning', metavar='LEVEL', |
32 | 289 | parser.add_option('-l', '--log-level', dest='loglevel', default='warning', metavar='LEVEL', | 289 | help='Set logging to LEVEL level. Valid values are "debug", "info", "warning".') |
33 | 290 | help='Set logging to LEVEL level. Valid values are "debug", "info", "warning".') | 290 | parser.add_argument('-p', '--portable', dest='portable', action='store_true', |
34 | 291 | parser.add_option('-p', '--portable', dest='portable', action='store_true', | 291 | help='Specify if this should be run as a portable app, ' |
35 | 292 | help='Specify if this should be run as a portable app, off a USB flash drive (not implemented).') | 292 | 'off a USB flash drive (not implemented).') |
36 | 293 | parser.add_option('-d', '--dev-version', dest='dev_version', action='store_true', | 293 | parser.add_argument('-d', '--dev-version', dest='dev_version', action='store_true', |
37 | 294 | help='Ignore the version file and pull the version directly from Bazaar') | 294 | help='Ignore the version file and pull the version directly from Bazaar') |
38 | 295 | parser.add_option('-s', '--style', dest='style', help='Set the Qt4 style (passed directly to Qt4).') | 295 | parser.add_argument('-s', '--style', dest='style', help='Set the Qt4 style (passed directly to Qt4).') |
39 | 296 | parser.add_argument('rargs', nargs='?', default=[]) | ||
40 | 296 | # Parse command line options and deal with them. Use args supplied pragmatically if possible. | 297 | # Parse command line options and deal with them. Use args supplied pragmatically if possible. |
41 | 297 | return parser.parse_args(args) if args else parser.parse_args() | 298 | return parser.parse_args(args) if args else parser.parse_args() |
42 | 298 | 299 | ||
43 | @@ -318,18 +319,18 @@ | |||
44 | 318 | 319 | ||
45 | 319 | :param args: Some args | 320 | :param args: Some args |
46 | 320 | """ | 321 | """ |
48 | 321 | (options, args) = parse_options(args) | 322 | args = parse_options(args) |
49 | 322 | qt_args = [] | 323 | qt_args = [] |
51 | 323 | if options.loglevel.lower() in ['d', 'debug']: | 324 | if args and args.loglevel.lower() in ['d', 'debug']: |
52 | 324 | log.setLevel(logging.DEBUG) | 325 | log.setLevel(logging.DEBUG) |
54 | 325 | elif options.loglevel.lower() in ['w', 'warning']: | 326 | elif args and args.loglevel.lower() in ['w', 'warning']: |
55 | 326 | log.setLevel(logging.WARNING) | 327 | log.setLevel(logging.WARNING) |
56 | 327 | else: | 328 | else: |
57 | 328 | log.setLevel(logging.INFO) | 329 | log.setLevel(logging.INFO) |
60 | 329 | if options.style: | 330 | if args and args.style: |
61 | 330 | qt_args.extend(['-style', options.style]) | 331 | qt_args.extend(['-style', args.style]) |
62 | 331 | # Throw the rest of the arguments at Qt, just in case. | 332 | # Throw the rest of the arguments at Qt, just in case. |
64 | 332 | qt_args.extend(args) | 333 | qt_args.extend(args.rargs) |
65 | 333 | # Bug #1018855: Set the WM_CLASS property in X11 | 334 | # Bug #1018855: Set the WM_CLASS property in X11 |
66 | 334 | if not is_win() and not is_macosx(): | 335 | if not is_win() and not is_macosx(): |
67 | 335 | qt_args.append('OpenLP') | 336 | qt_args.append('OpenLP') |
68 | @@ -339,7 +340,7 @@ | |||
69 | 339 | application = OpenLP(qt_args) | 340 | application = OpenLP(qt_args) |
70 | 340 | application.setOrganizationName('OpenLP') | 341 | application.setOrganizationName('OpenLP') |
71 | 341 | application.setOrganizationDomain('openlp.org') | 342 | application.setOrganizationDomain('openlp.org') |
73 | 342 | if options.portable: | 343 | if args and args.portable: |
74 | 343 | application.setApplicationName('OpenLPPortable') | 344 | application.setApplicationName('OpenLPPortable') |
75 | 344 | Settings.setDefaultFormat(Settings.IniFormat) | 345 | Settings.setDefaultFormat(Settings.IniFormat) |
76 | 345 | # Get location OpenLPPortable.ini | 346 | # Get location OpenLPPortable.ini |
77 | @@ -383,6 +384,6 @@ | |||
78 | 383 | application.installTranslator(default_translator) | 384 | application.installTranslator(default_translator) |
79 | 384 | else: | 385 | else: |
80 | 385 | log.debug('Could not find default_translator.') | 386 | log.debug('Could not find default_translator.') |
82 | 386 | if not options.no_error_form: | 387 | if args and not args.no_error_form: |
83 | 387 | sys.excepthook = application.hook_exception | 388 | sys.excepthook = application.hook_exception |
84 | 388 | sys.exit(application.run(qt_args)) | 389 | sys.exit(application.run(qt_args)) |
85 | 389 | 390 | ||
86 | === modified file 'openlp/core/common/settings.py' | |||
87 | --- openlp/core/common/settings.py 2015-09-08 19:13:59 +0000 | |||
88 | +++ openlp/core/common/settings.py 2015-11-04 18:37:18 +0000 | |||
89 | @@ -118,6 +118,7 @@ | |||
90 | 118 | 'advanced/slide limits': SlideLimits.End, | 118 | 'advanced/slide limits': SlideLimits.End, |
91 | 119 | 'advanced/single click preview': False, | 119 | 'advanced/single click preview': False, |
92 | 120 | 'advanced/x11 bypass wm': X11_BYPASS_DEFAULT, | 120 | 'advanced/x11 bypass wm': X11_BYPASS_DEFAULT, |
93 | 121 | 'advanced/search as type': True, | ||
94 | 121 | 'crashreport/last directory': '', | 122 | 'crashreport/last directory': '', |
95 | 122 | 'formattingTags/html_tags': '', | 123 | 'formattingTags/html_tags': '', |
96 | 123 | 'core/audio repeat list': False, | 124 | 'core/audio repeat list': False, |
97 | @@ -321,48 +322,10 @@ | |||
98 | 321 | } | 322 | } |
99 | 322 | __file_path__ = '' | 323 | __file_path__ = '' |
100 | 323 | __obsolete_settings__ = [ | 324 | __obsolete_settings__ = [ |
143 | 324 | # Changed during 1.9.x development. | 325 | # Changed during 2.2.x development. |
144 | 325 | ('bibles/bookname language', 'bibles/book name language', []), | 326 | # ('advanced/stylesheet fix', '', []), |
145 | 326 | ('general/enable slide loop', 'advanced/slide limits', [(SlideLimits.Wrap, True), (SlideLimits.End, False)]), | 327 | # ('general/recent files', 'core/recent files', [(recent_files_conv, None)]), |
146 | 327 | ('songs/ccli number', 'core/ccli number', []), | 328 | ('songs/search as type', 'advanced/search as type', []) |
105 | 328 | ('media/use phonon', '', []), | ||
106 | 329 | # Changed during 2.1.x development. | ||
107 | 330 | ('advanced/stylesheet fix', '', []), | ||
108 | 331 | ('bibles/last directory 1', 'bibles/last directory import', []), | ||
109 | 332 | ('media/background color', 'players/background color', []), | ||
110 | 333 | ('themes/last directory', 'themes/last directory import', []), | ||
111 | 334 | ('themes/last directory 1', 'themes/last directory export', []), | ||
112 | 335 | ('songs/last directory 1', 'songs/last directory import', []), | ||
113 | 336 | ('songusage/last directory 1', 'songusage/last directory export', []), | ||
114 | 337 | ('user interface/mainwindow splitter geometry', 'user interface/main window splitter geometry', []), | ||
115 | 338 | ('shortcuts/makeLive', 'shortcuts/make_live', []), | ||
116 | 339 | ('general/audio repeat list', 'core/audio repeat list', []), | ||
117 | 340 | ('general/auto open', 'core/auto open', []), | ||
118 | 341 | ('general/auto preview', 'core/auto preview', []), | ||
119 | 342 | ('general/audio start paused', 'core/audio start paused', []), | ||
120 | 343 | ('general/auto unblank', 'core/auto unblank', []), | ||
121 | 344 | ('general/blank warning', 'core/blank warning', []), | ||
122 | 345 | ('general/ccli number', 'core/ccli number', []), | ||
123 | 346 | ('general/has run wizard', 'core/has run wizard', []), | ||
124 | 347 | ('general/language', 'core/language', []), | ||
125 | 348 | ('general/last version test', 'core/last version test', []), | ||
126 | 349 | ('general/loop delay', 'core/loop delay', []), | ||
127 | 350 | ('general/recent files', 'core/recent files', [(recent_files_conv, None)]), | ||
128 | 351 | ('general/save prompt', 'core/save prompt', []), | ||
129 | 352 | ('general/screen blank', 'core/screen blank', []), | ||
130 | 353 | ('general/show splash', 'core/show splash', []), | ||
131 | 354 | ('general/songselect password', 'core/songselect password', []), | ||
132 | 355 | ('general/songselect username', 'core/songselect username', []), | ||
133 | 356 | ('general/update check', 'core/update check', []), | ||
134 | 357 | ('general/view mode', 'core/view mode', []), | ||
135 | 358 | ('general/display on monitor', 'core/display on monitor', []), | ||
136 | 359 | ('general/override position', 'core/override position', []), | ||
137 | 360 | ('general/x position', 'core/x position', []), | ||
138 | 361 | ('general/y position', 'core/y position', []), | ||
139 | 362 | ('general/monitor', 'core/monitor', []), | ||
140 | 363 | ('general/height', 'core/height', []), | ||
141 | 364 | ('general/monitor', 'core/monitor', []), | ||
142 | 365 | ('general/width', 'core/width', []) | ||
147 | 366 | ] | 329 | ] |
148 | 367 | 330 | ||
149 | 368 | @staticmethod | 331 | @staticmethod |
150 | 369 | 332 | ||
151 | === modified file 'openlp/core/common/uistrings.py' | |||
152 | --- openlp/core/common/uistrings.py 2015-04-21 21:49:22 +0000 | |||
153 | +++ openlp/core/common/uistrings.py 2015-11-04 18:37:18 +0000 | |||
154 | @@ -108,8 +108,9 @@ | |||
155 | 108 | self.NFSp = translate('OpenLP.Ui', 'No Files Selected', 'Plural') | 108 | self.NFSp = translate('OpenLP.Ui', 'No Files Selected', 'Plural') |
156 | 109 | self.NISs = translate('OpenLP.Ui', 'No Item Selected', 'Singular') | 109 | self.NISs = translate('OpenLP.Ui', 'No Item Selected', 'Singular') |
157 | 110 | self.NISp = translate('OpenLP.Ui', 'No Items Selected', 'Plural') | 110 | self.NISp = translate('OpenLP.Ui', 'No Items Selected', 'Plural') |
160 | 111 | self.OLPV2 = translate('OpenLP.Ui', 'OpenLP 2') | 111 | self.OLP = translate('OpenLP.Ui', 'OpenLP') |
161 | 112 | self.OLPV2x = translate('OpenLP.Ui', 'OpenLP 2.2') | 112 | self.OLPV2 = "%s %s" % (self.OLP, "2") |
162 | 113 | self.OLPV2x = "%s %s" % (self.OLP, "2.4") | ||
163 | 113 | self.OpenLPStart = translate('OpenLP.Ui', 'OpenLP is already running. Do you wish to continue?') | 114 | self.OpenLPStart = translate('OpenLP.Ui', 'OpenLP is already running. Do you wish to continue?') |
164 | 114 | self.OpenService = translate('OpenLP.Ui', 'Open service.') | 115 | self.OpenService = translate('OpenLP.Ui', 'Open service.') |
165 | 115 | self.PlaySlidesInLoop = translate('OpenLP.Ui', 'Play Slides in Loop') | 116 | self.PlaySlidesInLoop = translate('OpenLP.Ui', 'Play Slides in Loop') |
166 | 116 | 117 | ||
167 | === modified file 'openlp/core/lib/plugin.py' | |||
168 | --- openlp/core/lib/plugin.py 2015-01-18 13:39:21 +0000 | |||
169 | +++ openlp/core/lib/plugin.py 2015-11-04 18:37:18 +0000 | |||
170 | @@ -288,13 +288,7 @@ | |||
171 | 288 | """ | 288 | """ |
172 | 289 | Perform tasks on application startup | 289 | Perform tasks on application startup |
173 | 290 | """ | 290 | """ |
181 | 291 | # FIXME: Remove after 2.2 release. | 291 | pass |
175 | 292 | # This is needed to load the list of media/presentation from the config saved before the settings rewrite. | ||
176 | 293 | if self.media_item_class is not None and self.name != 'images': | ||
177 | 294 | loaded_list = Settings().get_files_from_config(self) | ||
178 | 295 | # Now save the list to the config using our Settings class. | ||
179 | 296 | if loaded_list: | ||
180 | 297 | Settings().setValue('%s/%s files' % (self.settings_section, self.name), loaded_list) | ||
182 | 298 | 292 | ||
183 | 299 | def uses_theme(self, theme): | 293 | def uses_theme(self, theme): |
184 | 300 | """ | 294 | """ |
185 | 301 | 295 | ||
186 | === modified file 'openlp/core/lib/serviceitem.py' | |||
187 | --- openlp/core/lib/serviceitem.py 2015-09-08 19:13:59 +0000 | |||
188 | +++ openlp/core/lib/serviceitem.py 2015-11-04 18:37:18 +0000 | |||
189 | @@ -129,7 +129,7 @@ | |||
190 | 129 | OnLoadUpdate = 8 | 129 | OnLoadUpdate = 8 |
191 | 130 | AddIfNewItem = 9 | 130 | AddIfNewItem = 9 |
192 | 131 | ProvidesOwnDisplay = 10 | 131 | ProvidesOwnDisplay = 10 |
194 | 132 | HasDetailedTitleDisplay = 11 | 132 | # HasDetailedTitleDisplay = 11 |
195 | 133 | HasVariableStartTime = 12 | 133 | HasVariableStartTime = 12 |
196 | 134 | CanSoftBreak = 13 | 134 | CanSoftBreak = 13 |
197 | 135 | CanWordSplit = 14 | 135 | CanWordSplit = 14 |
198 | @@ -415,11 +415,6 @@ | |||
199 | 415 | self.will_auto_start = header.get('will_auto_start', False) | 415 | self.will_auto_start = header.get('will_auto_start', False) |
200 | 416 | self.processor = header.get('processor', None) | 416 | self.processor = header.get('processor', None) |
201 | 417 | self.has_original_files = True | 417 | self.has_original_files = True |
202 | 418 | # TODO: Remove me in 2,3 build phase | ||
203 | 419 | if self.is_capable(ItemCapabilities.HasDetailedTitleDisplay): | ||
204 | 420 | self.capabilities.remove(ItemCapabilities.HasDetailedTitleDisplay) | ||
205 | 421 | self.processor = self.title | ||
206 | 422 | self.title = None | ||
207 | 423 | if 'background_audio' in header: | 418 | if 'background_audio' in header: |
208 | 424 | self.background_audio = [] | 419 | self.background_audio = [] |
209 | 425 | for filename in header['background_audio']: | 420 | for filename in header['background_audio']: |
210 | 426 | 421 | ||
211 | === modified file 'openlp/core/ui/advancedtab.py' | |||
212 | --- openlp/core/ui/advancedtab.py 2015-01-18 13:39:21 +0000 | |||
213 | +++ openlp/core/ui/advancedtab.py 2015-11-04 18:37:18 +0000 | |||
214 | @@ -80,6 +80,9 @@ | |||
215 | 80 | self.expand_service_item_check_box = QtGui.QCheckBox(self.ui_group_box) | 80 | self.expand_service_item_check_box = QtGui.QCheckBox(self.ui_group_box) |
216 | 81 | self.expand_service_item_check_box.setObjectName('expand_service_item_check_box') | 81 | self.expand_service_item_check_box.setObjectName('expand_service_item_check_box') |
217 | 82 | self.ui_layout.addRow(self.expand_service_item_check_box) | 82 | self.ui_layout.addRow(self.expand_service_item_check_box) |
218 | 83 | self.search_as_type_check_box = QtGui.QCheckBox(self.ui_group_box) | ||
219 | 84 | self.search_as_type_check_box.setObjectName('SearchAsType_check_box') | ||
220 | 85 | self.ui_layout.addRow(self.search_as_type_check_box) | ||
221 | 83 | self.enable_auto_close_check_box = QtGui.QCheckBox(self.ui_group_box) | 86 | self.enable_auto_close_check_box = QtGui.QCheckBox(self.ui_group_box) |
222 | 84 | self.enable_auto_close_check_box.setObjectName('enable_auto_close_check_box') | 87 | self.enable_auto_close_check_box.setObjectName('enable_auto_close_check_box') |
223 | 85 | self.ui_layout.addRow(self.enable_auto_close_check_box) | 88 | self.ui_layout.addRow(self.enable_auto_close_check_box) |
224 | @@ -251,6 +254,7 @@ | |||
225 | 251 | self.end_slide_radio_button.clicked.connect(self.on_end_slide_button_clicked) | 254 | self.end_slide_radio_button.clicked.connect(self.on_end_slide_button_clicked) |
226 | 252 | self.wrap_slide_radio_button.clicked.connect(self.on_wrap_slide_button_clicked) | 255 | self.wrap_slide_radio_button.clicked.connect(self.on_wrap_slide_button_clicked) |
227 | 253 | self.next_item_radio_button.clicked.connect(self.on_next_item_button_clicked) | 256 | self.next_item_radio_button.clicked.connect(self.on_next_item_button_clicked) |
228 | 257 | self.search_as_type_check_box.stateChanged.connect(self.on_search_as_type_check_box_changed) | ||
229 | 254 | 258 | ||
230 | 255 | def retranslateUi(self): | 259 | def retranslateUi(self): |
231 | 256 | """ | 260 | """ |
232 | @@ -319,6 +323,7 @@ | |||
233 | 319 | self.end_slide_radio_button.setText(translate('OpenLP.GeneralTab', '&Remain on Slide')) | 323 | self.end_slide_radio_button.setText(translate('OpenLP.GeneralTab', '&Remain on Slide')) |
234 | 320 | self.wrap_slide_radio_button.setText(translate('OpenLP.GeneralTab', '&Wrap around')) | 324 | self.wrap_slide_radio_button.setText(translate('OpenLP.GeneralTab', '&Wrap around')) |
235 | 321 | self.next_item_radio_button.setText(translate('OpenLP.GeneralTab', '&Move to next/previous service item')) | 325 | self.next_item_radio_button.setText(translate('OpenLP.GeneralTab', '&Move to next/previous service item')) |
236 | 326 | self.search_as_type_check_box.setText(translate('SongsPlugin.GeneralTab', 'Enable search as you type')) | ||
237 | 322 | 327 | ||
238 | 323 | def load(self): | 328 | def load(self): |
239 | 324 | """ | 329 | """ |
240 | @@ -349,6 +354,8 @@ | |||
241 | 349 | self.default_color = settings.value('default color') | 354 | self.default_color = settings.value('default color') |
242 | 350 | self.default_file_edit.setText(settings.value('default image')) | 355 | self.default_file_edit.setText(settings.value('default image')) |
243 | 351 | self.slide_limits = settings.value('slide limits') | 356 | self.slide_limits = settings.value('slide limits') |
244 | 357 | self.is_search_as_you_type_enabled = settings.value('search as type') | ||
245 | 358 | self.search_as_type_check_box.setChecked(self.is_search_as_you_type_enabled) | ||
246 | 352 | # Prevent the dialog displayed by the alternate_rows_check_box to display. | 359 | # Prevent the dialog displayed by the alternate_rows_check_box to display. |
247 | 353 | self.alternate_rows_check_box.blockSignals(True) | 360 | self.alternate_rows_check_box.blockSignals(True) |
248 | 354 | self.alternate_rows_check_box.setChecked(settings.value('alternate rows')) | 361 | self.alternate_rows_check_box.setChecked(settings.value('alternate rows')) |
249 | @@ -424,8 +431,14 @@ | |||
250 | 424 | settings.setValue('x11 bypass wm', self.x11_bypass_check_box.isChecked()) | 431 | settings.setValue('x11 bypass wm', self.x11_bypass_check_box.isChecked()) |
251 | 425 | self.settings_form.register_post_process('config_screen_changed') | 432 | self.settings_form.register_post_process('config_screen_changed') |
252 | 426 | self.settings_form.register_post_process('slidecontroller_update_slide_limits') | 433 | self.settings_form.register_post_process('slidecontroller_update_slide_limits') |
253 | 434 | settings.setValue('search as type', self.is_search_as_you_type_enabled) | ||
254 | 427 | settings.endGroup() | 435 | settings.endGroup() |
255 | 428 | 436 | ||
256 | 437 | def on_search_as_type_check_box_changed(self, check_state): | ||
257 | 438 | self.is_search_as_you_type_enabled = (check_state == QtCore.Qt.Checked) | ||
258 | 439 | self.settings_form.register_post_process('songs_config_updated') | ||
259 | 440 | self.settings_form.register_post_process('custom_config_updated') | ||
260 | 441 | |||
261 | 429 | def cancel(self): | 442 | def cancel(self): |
262 | 430 | """ | 443 | """ |
263 | 431 | Dialogue was cancelled, remove any pending data path change. | 444 | Dialogue was cancelled, remove any pending data path change. |
264 | 432 | 445 | ||
265 | === modified file 'openlp/core/ui/mainwindow.py' | |||
266 | --- openlp/core/ui/mainwindow.py 2015-08-24 18:19:30 +0000 | |||
267 | +++ openlp/core/ui/mainwindow.py 2015-11-04 18:37:18 +0000 | |||
268 | @@ -389,7 +389,7 @@ | |||
269 | 389 | self.file_menu.setTitle(translate('OpenLP.MainWindow', '&File')) | 389 | self.file_menu.setTitle(translate('OpenLP.MainWindow', '&File')) |
270 | 390 | self.file_import_menu.setTitle(translate('OpenLP.MainWindow', '&Import')) | 390 | self.file_import_menu.setTitle(translate('OpenLP.MainWindow', '&Import')) |
271 | 391 | self.file_export_menu.setTitle(translate('OpenLP.MainWindow', '&Export')) | 391 | self.file_export_menu.setTitle(translate('OpenLP.MainWindow', '&Export')) |
273 | 392 | self.recent_files_menu.setTitle(translate('OpenLP.MainWindow', '&Recent Files')) | 392 | self.recent_files_menu.setTitle(translate('OpenLP.MainWindow', '&Recent Services')) |
274 | 393 | self.view_menu.setTitle(translate('OpenLP.MainWindow', '&View')) | 393 | self.view_menu.setTitle(translate('OpenLP.MainWindow', '&View')) |
275 | 394 | self.view_mode_menu.setTitle(translate('OpenLP.MainWindow', 'M&ode')) | 394 | self.view_mode_menu.setTitle(translate('OpenLP.MainWindow', 'M&ode')) |
276 | 395 | self.tools_menu.setTitle(translate('OpenLP.MainWindow', '&Tools')) | 395 | self.tools_menu.setTitle(translate('OpenLP.MainWindow', '&Tools')) |
277 | @@ -400,16 +400,16 @@ | |||
278 | 400 | self.service_manager_dock.setWindowTitle(translate('OpenLP.MainWindow', 'Service Manager')) | 400 | self.service_manager_dock.setWindowTitle(translate('OpenLP.MainWindow', 'Service Manager')) |
279 | 401 | self.theme_manager_dock.setWindowTitle(translate('OpenLP.MainWindow', 'Theme Manager')) | 401 | self.theme_manager_dock.setWindowTitle(translate('OpenLP.MainWindow', 'Theme Manager')) |
280 | 402 | self.projector_manager_dock.setWindowTitle(translate('OpenLP.MainWindow', 'Projector Manager')) | 402 | self.projector_manager_dock.setWindowTitle(translate('OpenLP.MainWindow', 'Projector Manager')) |
282 | 403 | self.file_new_item.setText(translate('OpenLP.MainWindow', '&New')) | 403 | self.file_new_item.setText(translate('OpenLP.MainWindow', '&New Service')) |
283 | 404 | self.file_new_item.setToolTip(UiStrings().NewService) | 404 | self.file_new_item.setToolTip(UiStrings().NewService) |
284 | 405 | self.file_new_item.setStatusTip(UiStrings().CreateService) | 405 | self.file_new_item.setStatusTip(UiStrings().CreateService) |
286 | 406 | self.file_open_item.setText(translate('OpenLP.MainWindow', '&Open')) | 406 | self.file_open_item.setText(translate('OpenLP.MainWindow', '&Open Service')) |
287 | 407 | self.file_open_item.setToolTip(UiStrings().OpenService) | 407 | self.file_open_item.setToolTip(UiStrings().OpenService) |
288 | 408 | self.file_open_item.setStatusTip(translate('OpenLP.MainWindow', 'Open an existing service.')) | 408 | self.file_open_item.setStatusTip(translate('OpenLP.MainWindow', 'Open an existing service.')) |
290 | 409 | self.file_save_item.setText(translate('OpenLP.MainWindow', '&Save')) | 409 | self.file_save_item.setText(translate('OpenLP.MainWindow', '&Save Service')) |
291 | 410 | self.file_save_item.setToolTip(UiStrings().SaveService) | 410 | self.file_save_item.setToolTip(UiStrings().SaveService) |
292 | 411 | self.file_save_item.setStatusTip(translate('OpenLP.MainWindow', 'Save the current service to disk.')) | 411 | self.file_save_item.setStatusTip(translate('OpenLP.MainWindow', 'Save the current service to disk.')) |
294 | 412 | self.file_save_as_item.setText(translate('OpenLP.MainWindow', 'Save &As...')) | 412 | self.file_save_as_item.setText(translate('OpenLP.MainWindow', 'Save Service &As...')) |
295 | 413 | self.file_save_as_item.setToolTip(translate('OpenLP.MainWindow', 'Save Service As')) | 413 | self.file_save_as_item.setToolTip(translate('OpenLP.MainWindow', 'Save Service As')) |
296 | 414 | self.file_save_as_item.setStatusTip(translate('OpenLP.MainWindow', | 414 | self.file_save_as_item.setStatusTip(translate('OpenLP.MainWindow', |
297 | 415 | 'Save the current service under a new name.')) | 415 | 'Save the current service under a new name.')) |
298 | @@ -456,7 +456,7 @@ | |||
299 | 456 | self.lock_panel.setText(translate('OpenLP.MainWindow', 'L&ock Panels')) | 456 | self.lock_panel.setText(translate('OpenLP.MainWindow', 'L&ock Panels')) |
300 | 457 | self.lock_panel.setStatusTip(translate('OpenLP.MainWindow', 'Prevent the panels being moved.')) | 457 | self.lock_panel.setStatusTip(translate('OpenLP.MainWindow', 'Prevent the panels being moved.')) |
301 | 458 | self.view_live_panel.setStatusTip(translate('OpenLP.MainWindow', 'Toggle the visibility of the live panel.')) | 458 | self.view_live_panel.setStatusTip(translate('OpenLP.MainWindow', 'Toggle the visibility of the live panel.')) |
303 | 459 | self.settings_plugin_list_item.setText(translate('OpenLP.MainWindow', '&Plugin List')) | 459 | self.settings_plugin_list_item.setText(translate('OpenLP.MainWindow', '&Manage Plugins')) |
304 | 460 | self.settings_plugin_list_item.setStatusTip(translate('OpenLP.MainWindow', 'List the Plugins')) | 460 | self.settings_plugin_list_item.setStatusTip(translate('OpenLP.MainWindow', 'List the Plugins')) |
305 | 461 | self.about_item.setText(translate('OpenLP.MainWindow', '&About')) | 461 | self.about_item.setText(translate('OpenLP.MainWindow', '&About')) |
306 | 462 | self.about_item.setStatusTip(translate('OpenLP.MainWindow', 'More information about OpenLP')) | 462 | self.about_item.setStatusTip(translate('OpenLP.MainWindow', 'More information about OpenLP')) |
307 | @@ -505,7 +505,7 @@ | |||
308 | 505 | super(MainWindow, self).__init__() | 505 | super(MainWindow, self).__init__() |
309 | 506 | Registry().register('main_window', self) | 506 | Registry().register('main_window', self) |
310 | 507 | self.clipboard = self.application.clipboard() | 507 | self.clipboard = self.application.clipboard() |
312 | 508 | self.arguments = self.application.args | 508 | self.arguments = ''.join(self.application.args) |
313 | 509 | # Set up settings sections for the main application (not for use by plugins). | 509 | # Set up settings sections for the main application (not for use by plugins). |
314 | 510 | self.ui_settings_section = 'user interface' | 510 | self.ui_settings_section = 'user interface' |
315 | 511 | self.general_settings_section = 'core' | 511 | self.general_settings_section = 'core' |
316 | @@ -634,7 +634,7 @@ | |||
317 | 634 | self.live_controller.display.setFocus() | 634 | self.live_controller.display.setFocus() |
318 | 635 | self.activateWindow() | 635 | self.activateWindow() |
319 | 636 | if self.arguments: | 636 | if self.arguments: |
321 | 637 | self.open_cmd_line_files() | 637 | self.open_cmd_line_files(self.arguments) |
322 | 638 | elif Settings().value(self.general_settings_section + '/auto open'): | 638 | elif Settings().value(self.general_settings_section + '/auto open'): |
323 | 639 | self.service_manager_contents.load_last_file() | 639 | self.service_manager_contents.load_last_file() |
324 | 640 | view_mode = Settings().value('%s/view mode' % self.general_settings_section) | 640 | view_mode = Settings().value('%s/view mode' % self.general_settings_section) |
325 | @@ -1416,15 +1416,11 @@ | |||
326 | 1416 | settings.remove('advanced/data path') | 1416 | settings.remove('advanced/data path') |
327 | 1417 | self.application.set_normal_cursor() | 1417 | self.application.set_normal_cursor() |
328 | 1418 | 1418 | ||
330 | 1419 | def open_cmd_line_files(self): | 1419 | def open_cmd_line_files(self, filename): |
331 | 1420 | """ | 1420 | """ |
332 | 1421 | Open files passed in through command line arguments | 1421 | Open files passed in through command line arguments |
333 | 1422 | """ | 1422 | """ |
342 | 1423 | args = [] | 1423 | if not isinstance(filename, str): |
343 | 1424 | for a in self.arguments: | 1424 | filename = str(filename, sys.getfilesystemencoding()) |
344 | 1425 | args.extend([a]) | 1425 | if filename.endswith(('.osz', '.oszl')): |
345 | 1426 | for filename in args: | 1426 | self.service_manager_contents.load_file(filename) |
338 | 1427 | if not isinstance(filename, str): | ||
339 | 1428 | filename = str(filename, sys.getfilesystemencoding()) | ||
340 | 1429 | if filename.endswith(('.osz', '.oszl')): | ||
341 | 1430 | self.service_manager_contents.load_file(filename) | ||
346 | 1431 | 1427 | ||
347 | === modified file 'openlp/core/ui/plugindialog.py' | |||
348 | --- openlp/core/ui/plugindialog.py 2015-01-18 13:39:21 +0000 | |||
349 | +++ openlp/core/ui/plugindialog.py 2015-11-04 18:37:18 +0000 | |||
350 | @@ -33,21 +33,21 @@ | |||
351 | 33 | """ | 33 | """ |
352 | 34 | The UI of the plugin view dialog | 34 | The UI of the plugin view dialog |
353 | 35 | """ | 35 | """ |
355 | 36 | def setupUi(self, pluginViewDialog): | 36 | def setupUi(self, plugin_view_dialog): |
356 | 37 | """ | 37 | """ |
357 | 38 | Set up the UI | 38 | Set up the UI |
358 | 39 | """ | 39 | """ |
363 | 40 | pluginViewDialog.setObjectName('pluginViewDialog') | 40 | plugin_view_dialog.setObjectName('plugin_view_dialog') |
364 | 41 | pluginViewDialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) | 41 | plugin_view_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
365 | 42 | pluginViewDialog.setWindowModality(QtCore.Qt.ApplicationModal) | 42 | plugin_view_dialog.setWindowModality(QtCore.Qt.ApplicationModal) |
366 | 43 | self.plugin_layout = QtGui.QVBoxLayout(pluginViewDialog) | 43 | self.plugin_layout = QtGui.QVBoxLayout(plugin_view_dialog) |
367 | 44 | self.plugin_layout.setObjectName('plugin_layout') | 44 | self.plugin_layout.setObjectName('plugin_layout') |
368 | 45 | self.list_layout = QtGui.QHBoxLayout() | 45 | self.list_layout = QtGui.QHBoxLayout() |
369 | 46 | self.list_layout.setObjectName('list_layout') | 46 | self.list_layout.setObjectName('list_layout') |
371 | 47 | self.plugin_list_widget = QtGui.QListWidget(pluginViewDialog) | 47 | self.plugin_list_widget = QtGui.QListWidget(plugin_view_dialog) |
372 | 48 | self.plugin_list_widget.setObjectName('plugin_list_widget') | 48 | self.plugin_list_widget.setObjectName('plugin_list_widget') |
373 | 49 | self.list_layout.addWidget(self.plugin_list_widget) | 49 | self.list_layout.addWidget(self.plugin_list_widget) |
375 | 50 | self.plugin_info_group_box = QtGui.QGroupBox(pluginViewDialog) | 50 | self.plugin_info_group_box = QtGui.QGroupBox(plugin_view_dialog) |
376 | 51 | self.plugin_info_group_box.setObjectName('plugin_info_group_box') | 51 | self.plugin_info_group_box.setObjectName('plugin_info_group_box') |
377 | 52 | self.plugin_info_layout = QtGui.QFormLayout(self.plugin_info_group_box) | 52 | self.plugin_info_layout = QtGui.QFormLayout(self.plugin_info_group_box) |
378 | 53 | self.plugin_info_layout.setObjectName('plugin_info_layout') | 53 | self.plugin_info_layout.setObjectName('plugin_info_layout') |
379 | @@ -70,15 +70,15 @@ | |||
380 | 70 | self.plugin_info_layout.addRow(self.about_label, self.about_text_browser) | 70 | self.plugin_info_layout.addRow(self.about_label, self.about_text_browser) |
381 | 71 | self.list_layout.addWidget(self.plugin_info_group_box) | 71 | self.list_layout.addWidget(self.plugin_info_group_box) |
382 | 72 | self.plugin_layout.addLayout(self.list_layout) | 72 | self.plugin_layout.addLayout(self.list_layout) |
384 | 73 | self.button_box = create_button_box(pluginViewDialog, 'button_box', ['ok']) | 73 | self.button_box = create_button_box(plugin_view_dialog, 'button_box', ['ok']) |
385 | 74 | self.plugin_layout.addWidget(self.button_box) | 74 | self.plugin_layout.addWidget(self.button_box) |
387 | 75 | self.retranslateUi(pluginViewDialog) | 75 | self.retranslateUi(plugin_view_dialog) |
388 | 76 | 76 | ||
390 | 77 | def retranslateUi(self, pluginViewDialog): | 77 | def retranslateUi(self, plugin_view_dialog): |
391 | 78 | """ | 78 | """ |
392 | 79 | Translate the UI on the fly | 79 | Translate the UI on the fly |
393 | 80 | """ | 80 | """ |
395 | 81 | pluginViewDialog.setWindowTitle(translate('OpenLP.PluginForm', 'Plugin List')) | 81 | plugin_view_dialog.setWindowTitle(translate('OpenLP.PluginForm', 'Manage Plugins')) |
396 | 82 | self.plugin_info_group_box.setTitle(translate('OpenLP.PluginForm', 'Plugin Details')) | 82 | self.plugin_info_group_box.setTitle(translate('OpenLP.PluginForm', 'Plugin Details')) |
397 | 83 | self.version_label.setText('%s:' % UiStrings().Version) | 83 | self.version_label.setText('%s:' % UiStrings().Version) |
398 | 84 | self.about_label.setText('%s:' % UiStrings().About) | 84 | self.about_label.setText('%s:' % UiStrings().About) |
399 | 85 | 85 | ||
400 | === modified file 'openlp/core/ui/printserviceform.py' | |||
401 | --- openlp/core/ui/printserviceform.py 2015-04-11 22:13:30 +0000 | |||
402 | +++ openlp/core/ui/printserviceform.py 2015-11-04 18:37:18 +0000 | |||
403 | @@ -162,7 +162,7 @@ | |||
404 | 162 | html_data = self._add_element('html') | 162 | html_data = self._add_element('html') |
405 | 163 | self._add_element('head', parent=html_data) | 163 | self._add_element('head', parent=html_data) |
406 | 164 | self._add_element('title', self.title_line_edit.text(), html_data.head) | 164 | self._add_element('title', self.title_line_edit.text(), html_data.head) |
408 | 165 | css_path = os.path.join(AppLocation.get_data_path(), 'service_print.css') | 165 | css_path = os.path.join(AppLocation.get_data_path(), 'serviceprint', 'service_print.css') |
409 | 166 | custom_css = get_text_file_string(css_path) | 166 | custom_css = get_text_file_string(css_path) |
410 | 167 | if not custom_css: | 167 | if not custom_css: |
411 | 168 | custom_css = DEFAULT_CSS | 168 | custom_css = DEFAULT_CSS |
412 | 169 | 169 | ||
413 | === modified file 'openlp/core/ui/thememanager.py' | |||
414 | --- openlp/core/ui/thememanager.py 2015-09-08 19:13:59 +0000 | |||
415 | +++ openlp/core/ui/thememanager.py 2015-11-04 18:37:18 +0000 | |||
416 | @@ -755,12 +755,19 @@ | |||
417 | 755 | return False | 755 | return False |
418 | 756 | # check for use in the system else where. | 756 | # check for use in the system else where. |
419 | 757 | if test_plugin: | 757 | if test_plugin: |
420 | 758 | plugin_usage = "" | ||
421 | 758 | for plugin in self.plugin_manager.plugins: | 759 | for plugin in self.plugin_manager.plugins: |
428 | 759 | if plugin.uses_theme(theme): | 760 | used_count = plugin.uses_theme(theme) |
429 | 760 | critical_error_message_box(translate('OpenLP.ThemeManager', 'Validation Error'), | 761 | if used_count: |
430 | 761 | translate('OpenLP.ThemeManager', | 762 | plugin_usage = "%s%s" % (plugin_usage, (translate('OpenLP.ThemeManager', |
431 | 762 | 'Theme %s is used in the %s plugin.') | 763 | '%s time(s) by %s') % |
432 | 763 | % (theme, plugin.name)) | 764 | (used_count, plugin.name))) |
433 | 764 | return False | 765 | plugin_usage = "%s\n" % plugin_usage |
434 | 766 | if plugin_usage: | ||
435 | 767 | critical_error_message_box(translate('OpenLP.ThemeManager', 'Unable to delete theme'), | ||
436 | 768 | translate('OpenLP.ThemeManager', 'Theme is currently used \n\n%s') % | ||
437 | 769 | plugin_usage) | ||
438 | 770 | |||
439 | 771 | return False | ||
440 | 765 | return True | 772 | return True |
441 | 766 | return False | 773 | return False |
442 | 767 | 774 | ||
443 | === modified file 'openlp/plugins/bibles/bibleplugin.py' | |||
444 | --- openlp/plugins/bibles/bibleplugin.py 2015-03-10 21:33:35 +0000 | |||
445 | +++ openlp/plugins/bibles/bibleplugin.py 2015-11-04 18:37:18 +0000 | |||
446 | @@ -178,12 +178,14 @@ | |||
447 | 178 | 178 | ||
448 | 179 | def uses_theme(self, theme): | 179 | def uses_theme(self, theme): |
449 | 180 | """ | 180 | """ |
452 | 181 | Called to find out if the bible plugin is currently using a theme. Returns ``True`` if the theme is being used, | 181 | Called to find out if the bible plugin is currently using a theme. Returns ``1`` if the theme is being used, |
453 | 182 | otherwise returns ``False``. | 182 | otherwise returns ``0``. |
454 | 183 | 183 | ||
455 | 184 | :param theme: The theme | 184 | :param theme: The theme |
456 | 185 | """ | 185 | """ |
458 | 186 | return str(self.settings_tab.bible_theme) == theme | 186 | if str(self.settings_tab.bible_theme) == theme: |
459 | 187 | return 1 | ||
460 | 188 | return 0 | ||
461 | 187 | 189 | ||
462 | 188 | def rename_theme(self, old_theme, new_theme): | 190 | def rename_theme(self, old_theme, new_theme): |
463 | 189 | """ | 191 | """ |
464 | 190 | 192 | ||
465 | === modified file 'openlp/plugins/bibles/lib/db.py' | |||
466 | --- openlp/plugins/bibles/lib/db.py 2015-09-08 19:13:26 +0000 | |||
467 | +++ openlp/plugins/bibles/lib/db.py 2015-11-04 18:37:18 +0000 | |||
468 | @@ -476,16 +476,6 @@ | |||
469 | 476 | self.save_meta('language_id', language_id) | 476 | self.save_meta('language_id', language_id) |
470 | 477 | return language_id | 477 | return language_id |
471 | 478 | 478 | ||
472 | 479 | def is_old_database(self): | ||
473 | 480 | """ | ||
474 | 481 | Returns ``True`` if it is a bible database, which has been created prior to 1.9.6. | ||
475 | 482 | """ | ||
476 | 483 | try: | ||
477 | 484 | self.session.query(Book).all() | ||
478 | 485 | except: | ||
479 | 486 | return True | ||
480 | 487 | return False | ||
481 | 488 | |||
482 | 489 | def dump_bible(self): | 479 | def dump_bible(self): |
483 | 490 | """ | 480 | """ |
484 | 491 | Utility debugging method to dump the contents of a bible. | 481 | Utility debugging method to dump the contents of a bible. |
485 | 492 | 482 | ||
486 | === modified file 'openlp/plugins/bibles/lib/manager.py' | |||
487 | --- openlp/plugins/bibles/lib/manager.py 2015-01-31 21:52:02 +0000 | |||
488 | +++ openlp/plugins/bibles/lib/manager.py 2015-11-04 18:37:18 +0000 | |||
489 | @@ -129,11 +129,6 @@ | |||
490 | 129 | bible.session.close() | 129 | bible.session.close() |
491 | 130 | delete_file(os.path.join(self.path, filename)) | 130 | delete_file(os.path.join(self.path, filename)) |
492 | 131 | continue | 131 | continue |
493 | 132 | # Find old database versions. | ||
494 | 133 | if bible.is_old_database(): | ||
495 | 134 | self.old_bible_databases.append([filename, name]) | ||
496 | 135 | bible.session.close() | ||
497 | 136 | continue | ||
498 | 137 | log.debug('Bible Name: "%s"', name) | 132 | log.debug('Bible Name: "%s"', name) |
499 | 138 | self.db_cache[name] = bible | 133 | self.db_cache[name] = bible |
500 | 139 | # Look to see if lazy load bible exists and get create getter. | 134 | # Look to see if lazy load bible exists and get create getter. |
501 | 140 | 135 | ||
502 | === modified file 'openlp/plugins/custom/customplugin.py' | |||
503 | --- openlp/plugins/custom/customplugin.py 2015-02-11 20:56:13 +0000 | |||
504 | +++ openlp/plugins/custom/customplugin.py 2015-11-04 18:37:18 +0000 | |||
505 | @@ -72,11 +72,9 @@ | |||
506 | 72 | """ | 72 | """ |
507 | 73 | Called to find out if the custom plugin is currently using a theme. | 73 | Called to find out if the custom plugin is currently using a theme. |
508 | 74 | 74 | ||
510 | 75 | Returns True if the theme is being used, otherwise returns False. | 75 | Returns count of the times the theme is used. |
511 | 76 | """ | 76 | """ |
515 | 77 | if self.db_manager.get_all_objects(CustomSlide, CustomSlide.theme_name == theme): | 77 | return len(self.db_manager.get_all_objects(CustomSlide, CustomSlide.theme_name == theme)) |
513 | 78 | return True | ||
514 | 79 | return False | ||
516 | 80 | 78 | ||
517 | 81 | def rename_theme(self, old_theme, new_theme): | 79 | def rename_theme(self, old_theme, new_theme): |
518 | 82 | """ | 80 | """ |
519 | 83 | 81 | ||
520 | === modified file 'openlp/plugins/custom/lib/mediaitem.py' | |||
521 | --- openlp/plugins/custom/lib/mediaitem.py 2015-04-02 20:49:19 +0000 | |||
522 | +++ openlp/plugins/custom/lib/mediaitem.py 2015-11-04 18:37:18 +0000 | |||
523 | @@ -85,6 +85,7 @@ | |||
524 | 85 | """ | 85 | """ |
525 | 86 | log.debug('Config loaded') | 86 | log.debug('Config loaded') |
526 | 87 | self.add_custom_from_service = Settings().value(self.settings_section + '/add custom from service') | 87 | self.add_custom_from_service = Settings().value(self.settings_section + '/add custom from service') |
527 | 88 | self.is_search_as_you_type_enabled = Settings().value('advanced/search as type') | ||
528 | 88 | 89 | ||
529 | 89 | def retranslateUi(self): | 90 | def retranslateUi(self): |
530 | 90 | """ | 91 | """ |
531 | @@ -269,11 +270,12 @@ | |||
532 | 269 | 270 | ||
533 | 270 | :param text: The search text | 271 | :param text: The search text |
534 | 271 | """ | 272 | """ |
540 | 272 | search_length = 2 | 273 | if self.is_search_as_you_type_enabled: |
541 | 273 | if len(text) > search_length: | 274 | search_length = 2 |
542 | 274 | self.on_search_text_button_clicked() | 275 | if len(text) > search_length: |
543 | 275 | elif not text: | 276 | self.on_search_text_button_clicked() |
544 | 276 | self.on_clear_text_button_click() | 277 | elif not text: |
545 | 278 | self.on_clear_text_button_click() | ||
546 | 277 | 279 | ||
547 | 278 | def service_load(self, item): | 280 | def service_load(self, item): |
548 | 279 | """ | 281 | """ |
549 | 280 | 282 | ||
550 | === modified file 'openlp/plugins/images/imageplugin.py' | |||
551 | --- openlp/plugins/images/imageplugin.py 2015-02-11 22:15:46 +0000 | |||
552 | +++ openlp/plugins/images/imageplugin.py 2015-11-04 18:37:18 +0000 | |||
553 | @@ -67,36 +67,13 @@ | |||
554 | 67 | 'provided by the theme.') | 67 | 'provided by the theme.') |
555 | 68 | return about_text | 68 | return about_text |
556 | 69 | 69 | ||
557 | 70 | def app_startup(self): | ||
558 | 71 | """ | ||
559 | 72 | Perform tasks on application startup. | ||
560 | 73 | """ | ||
561 | 74 | # TODO: Can be removed when the upgrade path from 2.0.x to 2.2.x is no longer needed | ||
562 | 75 | Plugin.app_startup(self) | ||
563 | 76 | # Convert old settings-based image list to the database. | ||
564 | 77 | files_from_config = Settings().get_files_from_config(self) | ||
565 | 78 | if files_from_config: | ||
566 | 79 | for file in files_from_config: | ||
567 | 80 | filename = os.path.split(file)[1] | ||
568 | 81 | thumb = os.path.join(self.media_item.service_path, filename) | ||
569 | 82 | try: | ||
570 | 83 | os.remove(thumb) | ||
571 | 84 | except: | ||
572 | 85 | pass | ||
573 | 86 | log.debug('Importing images list from old config: %s' % files_from_config) | ||
574 | 87 | self.media_item.save_new_images_list(files_from_config) | ||
575 | 88 | |||
576 | 89 | def upgrade_settings(self, settings): | 70 | def upgrade_settings(self, settings): |
577 | 90 | """ | 71 | """ |
578 | 91 | Upgrade the settings of this plugin. | 72 | Upgrade the settings of this plugin. |
579 | 92 | 73 | ||
580 | 93 | :param settings: The Settings object containing the old settings. | 74 | :param settings: The Settings object containing the old settings. |
581 | 94 | """ | 75 | """ |
587 | 95 | # TODO: Can be removed when the upgrade path from 2.0.x to 2.2.x is no longer needed | 76 | pass |
583 | 96 | files_from_config = settings.get_files_from_config(self) | ||
584 | 97 | if files_from_config: | ||
585 | 98 | log.debug('Importing images list from old config: %s' % files_from_config) | ||
586 | 99 | self.media_item.save_new_images_list(files_from_config) | ||
588 | 100 | 77 | ||
589 | 101 | def set_plugin_text_strings(self): | 78 | def set_plugin_text_strings(self): |
590 | 102 | """ | 79 | """ |
591 | 103 | 80 | ||
592 | === modified file 'openlp/plugins/images/lib/mediaitem.py' | |||
593 | --- openlp/plugins/images/lib/mediaitem.py 2015-09-08 19:13:59 +0000 | |||
594 | +++ openlp/plugins/images/lib/mediaitem.py 2015-11-04 18:37:18 +0000 | |||
595 | @@ -119,14 +119,6 @@ | |||
596 | 119 | icon=':/general/general_edit.png', | 119 | icon=':/general/general_edit.png', |
597 | 120 | triggers=self.on_edit_click) | 120 | triggers=self.on_edit_click) |
598 | 121 | create_widget_action(self.list_view, separator=True) | 121 | create_widget_action(self.list_view, separator=True) |
599 | 122 | if self.has_delete_icon: | ||
600 | 123 | create_widget_action( | ||
601 | 124 | self.list_view, | ||
602 | 125 | 'listView%s%sItem' % (self.plugin.name.title(), StringContent.Delete.title()), | ||
603 | 126 | text=self.plugin.get_string(StringContent.Delete)['title'], | ||
604 | 127 | icon=':/general/general_delete.png', | ||
605 | 128 | can_shortcuts=True, triggers=self.on_delete_click) | ||
606 | 129 | create_widget_action(self.list_view, separator=True) | ||
607 | 130 | create_widget_action( | 122 | create_widget_action( |
608 | 131 | self.list_view, | 123 | self.list_view, |
609 | 132 | 'listView%s%sItem' % (self.plugin.name.title(), StringContent.Preview.title()), | 124 | 'listView%s%sItem' % (self.plugin.name.title(), StringContent.Preview.title()), |
610 | @@ -155,6 +147,14 @@ | |||
611 | 155 | text=translate('OpenLP.MediaManagerItem', '&Add to selected Service Item'), | 147 | text=translate('OpenLP.MediaManagerItem', '&Add to selected Service Item'), |
612 | 156 | icon=':/general/general_add.png', | 148 | icon=':/general/general_add.png', |
613 | 157 | triggers=self.on_add_edit_click) | 149 | triggers=self.on_add_edit_click) |
614 | 150 | create_widget_action(self.list_view, separator=True) | ||
615 | 151 | if self.has_delete_icon: | ||
616 | 152 | create_widget_action( | ||
617 | 153 | self.list_view, | ||
618 | 154 | 'listView%s%sItem' % (self.plugin.name.title(), StringContent.Delete.title()), | ||
619 | 155 | text=self.plugin.get_string(StringContent.Delete)['title'], | ||
620 | 156 | icon=':/general/general_delete.png', | ||
621 | 157 | can_shortcuts=True, triggers=self.on_delete_click) | ||
622 | 158 | self.add_custom_context_actions() | 158 | self.add_custom_context_actions() |
623 | 159 | # Create the context menu and add all actions from the list_view. | 159 | # Create the context menu and add all actions from the list_view. |
624 | 160 | self.menu = QtGui.QMenu() | 160 | self.menu = QtGui.QMenu() |
625 | 161 | 161 | ||
626 | === modified file 'openlp/plugins/presentations/presentationplugin.py' | |||
627 | --- openlp/plugins/presentations/presentationplugin.py 2015-05-26 21:26:59 +0000 | |||
628 | +++ openlp/plugins/presentations/presentationplugin.py 2015-11-04 18:37:18 +0000 | |||
629 | @@ -137,22 +137,6 @@ | |||
630 | 137 | self.register_controllers(controller) | 137 | self.register_controllers(controller) |
631 | 138 | return bool(self.controllers) | 138 | return bool(self.controllers) |
632 | 139 | 139 | ||
633 | 140 | def app_startup(self): | ||
634 | 141 | """ | ||
635 | 142 | Perform tasks on application startup. | ||
636 | 143 | """ | ||
637 | 144 | # TODO: Can be removed when the upgrade path from 2.0.x to 2.2.x is no longer needed | ||
638 | 145 | super().app_startup() | ||
639 | 146 | files_from_config = Settings().value('presentations/presentations files') | ||
640 | 147 | for file in files_from_config: | ||
641 | 148 | try: | ||
642 | 149 | self.media_item.clean_up_thumbnails(file, True) | ||
643 | 150 | except AttributeError: | ||
644 | 151 | pass | ||
645 | 152 | self.media_item.list_view.clear() | ||
646 | 153 | Settings().setValue('presentations/thumbnail_scheme', 'md5') | ||
647 | 154 | self.media_item.validate_and_load(files_from_config) | ||
648 | 155 | |||
649 | 156 | def about(self): | 140 | def about(self): |
650 | 157 | """ | 141 | """ |
651 | 158 | Return information about this plugin. | 142 | Return information about this plugin. |
652 | 159 | 143 | ||
653 | === modified file 'openlp/plugins/remotes/html/openlp.js' | |||
654 | --- openlp/plugins/remotes/html/openlp.js 2015-01-18 13:39:21 +0000 | |||
655 | +++ openlp/plugins/remotes/html/openlp.js 2015-11-04 18:37:18 +0000 | |||
656 | @@ -271,9 +271,15 @@ | |||
657 | 271 | if (typeof value[0] !== "number"){ | 271 | if (typeof value[0] !== "number"){ |
658 | 272 | value[0] = OpenLP.escapeString(value[0]) | 272 | value[0] = OpenLP.escapeString(value[0]) |
659 | 273 | } | 273 | } |
660 | 274 | var txt = ""; | ||
661 | 275 | if (value[2].length > 0) { | ||
662 | 276 | txt = value[1] + " ( " + value[2] + " )"; | ||
663 | 277 | } else { | ||
664 | 278 | txt = value[1]; | ||
665 | 279 | } | ||
666 | 274 | ul.append($("<li>").append($("<a>").attr("href", "#options") | 280 | ul.append($("<li>").append($("<a>").attr("href", "#options") |
667 | 275 | .attr("data-rel", "dialog").attr("value", value[0]) | 281 | .attr("data-rel", "dialog").attr("value", value[0]) |
669 | 276 | .click(OpenLP.showOptions).text(value[1]))); | 282 | .click(OpenLP.showOptions).text(txt))); |
670 | 277 | }); | 283 | }); |
671 | 278 | } | 284 | } |
672 | 279 | ul.listview("refresh"); | 285 | ul.listview("refresh"); |
673 | 280 | 286 | ||
674 | === modified file 'openlp/plugins/remotes/lib/httprouter.py' | |||
675 | --- openlp/plugins/remotes/lib/httprouter.py 2015-02-14 09:12:35 +0000 | |||
676 | +++ openlp/plugins/remotes/lib/httprouter.py 2015-11-04 18:37:18 +0000 | |||
677 | @@ -309,10 +309,13 @@ | |||
678 | 309 | """ | 309 | """ |
679 | 310 | Translate various strings in the mobile app. | 310 | Translate various strings in the mobile app. |
680 | 311 | """ | 311 | """ |
681 | 312 | remote = translate('RemotePlugin.Mobile', 'Remote') | ||
682 | 313 | stage = translate('RemotePlugin.Mobile', 'Stage View') | ||
683 | 314 | live = translate('RemotePlugin.Mobile', 'Live View') | ||
684 | 312 | self.template_vars = { | 315 | self.template_vars = { |
688 | 313 | 'app_title': translate('RemotePlugin.Mobile', 'OpenLP 2.2 Remote'), | 316 | 'app_title': "%s %s" % (UiStrings().OLPV2x, remote), |
689 | 314 | 'stage_title': translate('RemotePlugin.Mobile', 'OpenLP 2.2 Stage View'), | 317 | 'stage_title': "%s %s" % (UiStrings().OLPV2x, stage), |
690 | 315 | 'live_title': translate('RemotePlugin.Mobile', 'OpenLP 2.2 Live View'), | 318 | 'live_title': "%s %s" % (UiStrings().OLPV2x, live), |
691 | 316 | 'service_manager': translate('RemotePlugin.Mobile', 'Service Manager'), | 319 | 'service_manager': translate('RemotePlugin.Mobile', 'Service Manager'), |
692 | 317 | 'slide_controller': translate('RemotePlugin.Mobile', 'Slide Controller'), | 320 | 'slide_controller': translate('RemotePlugin.Mobile', 'Slide Controller'), |
693 | 318 | 'alerts': translate('RemotePlugin.Mobile', 'Alerts'), | 321 | 'alerts': translate('RemotePlugin.Mobile', 'Alerts'), |
694 | 319 | 322 | ||
695 | === modified file 'openlp/plugins/songs/forms/editsongform.py' | |||
696 | --- openlp/plugins/songs/forms/editsongform.py 2015-01-18 13:39:21 +0000 | |||
697 | +++ openlp/plugins/songs/forms/editsongform.py 2015-11-04 18:37:18 +0000 | |||
698 | @@ -178,7 +178,7 @@ | |||
699 | 178 | if invalid_verses: | 178 | if invalid_verses: |
700 | 179 | valid = create_separated_list(verse_names) | 179 | valid = create_separated_list(verse_names) |
701 | 180 | if len(invalid_verses) > 1: | 180 | if len(invalid_verses) > 1: |
703 | 181 | msg = translate('SongsPlugin.EditSongForm', 'There are no verses corresponding to "%(invalid)s".' | 181 | msg = translate('SongsPlugin.EditSongForm', 'There are no verses corresponding to "%(invalid)s". ' |
704 | 182 | 'Valid entries are %(valid)s.\nPlease enter the verses separated by spaces.') % \ | 182 | 'Valid entries are %(valid)s.\nPlease enter the verses separated by spaces.') % \ |
705 | 183 | {'invalid': ', '.join(invalid_verses), 'valid': valid} | 183 | {'invalid': ', '.join(invalid_verses), 'valid': valid} |
706 | 184 | else: | 184 | else: |
707 | 185 | 185 | ||
708 | === modified file 'openlp/plugins/songs/lib/mediaitem.py' | |||
709 | --- openlp/plugins/songs/lib/mediaitem.py 2015-01-18 13:39:21 +0000 | |||
710 | +++ openlp/plugins/songs/lib/mediaitem.py 2015-11-04 18:37:18 +0000 | |||
711 | @@ -115,7 +115,7 @@ | |||
712 | 115 | Is triggered when the songs config is updated | 115 | Is triggered when the songs config is updated |
713 | 116 | """ | 116 | """ |
714 | 117 | log.debug('config_updated') | 117 | log.debug('config_updated') |
716 | 118 | self.search_as_you_type = Settings().value(self.settings_section + '/search as type') | 118 | self.is_search_as_you_type_enabled = Settings().value('advanced/search as type') |
717 | 119 | self.update_service_on_edit = Settings().value(self.settings_section + '/update service on edit') | 119 | self.update_service_on_edit = Settings().value(self.settings_section + '/update service on edit') |
718 | 120 | self.add_song_from_service = Settings().value(self.settings_section + '/add song from service') | 120 | self.add_song_from_service = Settings().value(self.settings_section + '/add song from service') |
719 | 121 | self.display_songbook = Settings().value(self.settings_section + '/display songbook') | 121 | self.display_songbook = Settings().value(self.settings_section + '/display songbook') |
720 | @@ -279,7 +279,7 @@ | |||
721 | 279 | If search as type enabled invoke the search on each key press. If the Lyrics are being searched do not start | 279 | If search as type enabled invoke the search on each key press. If the Lyrics are being searched do not start |
722 | 280 | till 7 characters have been entered. | 280 | till 7 characters have been entered. |
723 | 281 | """ | 281 | """ |
725 | 282 | if self.search_as_you_type: | 282 | if self.is_search_as_you_type_enabled: |
726 | 283 | search_length = 1 | 283 | search_length = 1 |
727 | 284 | if self.search_text_edit.current_search_type() == SongSearch.Entire: | 284 | if self.search_text_edit.current_search_type() == SongSearch.Entire: |
728 | 285 | search_length = 4 | 285 | search_length = 4 |
729 | @@ -590,4 +590,4 @@ | |||
730 | 590 | :param show_error: Is this an error? | 590 | :param show_error: Is this an error? |
731 | 591 | """ | 591 | """ |
732 | 592 | search_results = self.search_entire(string) | 592 | search_results = self.search_entire(string) |
734 | 593 | return [[song.id, song.title] for song in search_results] | 593 | return [[song.id, song.title, song.alternate_title] for song in search_results] |
735 | 594 | 594 | ||
736 | === modified file 'openlp/plugins/songs/lib/openlyricsxml.py' | |||
737 | --- openlp/plugins/songs/lib/openlyricsxml.py 2015-09-08 19:13:59 +0000 | |||
738 | +++ openlp/plugins/songs/lib/openlyricsxml.py 2015-11-04 18:37:18 +0000 | |||
739 | @@ -121,17 +121,7 @@ | |||
740 | 121 | """ | 121 | """ |
741 | 122 | self.song_xml = None | 122 | self.song_xml = None |
742 | 123 | verse_list = [] | 123 | verse_list = [] |
754 | 124 | if not xml.startswith('<?xml') and not xml.startswith('<song'): | 124 | if xml.startswith('<?xml'): |
744 | 125 | # This is an old style song, without XML. Let's handle it correctly by iterating through the verses, and | ||
745 | 126 | # then recreating the internal xml object as well. | ||
746 | 127 | self.song_xml = objectify.fromstring('<song version="1.0" />') | ||
747 | 128 | self.lyrics = etree.SubElement(self.song_xml, 'lyrics') | ||
748 | 129 | verses = xml.split('\n\n') | ||
749 | 130 | for count, verse in enumerate(verses): | ||
750 | 131 | verse_list.append([{'type': 'v', 'label': str(count)}, str(verse)]) | ||
751 | 132 | self.add_verse_to_lyrics('v', str(count), verse) | ||
752 | 133 | return verse_list | ||
753 | 134 | elif xml.startswith('<?xml'): | ||
755 | 135 | xml = xml[38:] | 125 | xml = xml[38:] |
756 | 136 | try: | 126 | try: |
757 | 137 | self.song_xml = objectify.fromstring(xml) | 127 | self.song_xml = objectify.fromstring(xml) |
758 | 138 | 128 | ||
759 | === modified file 'openlp/plugins/songs/lib/songstab.py' | |||
760 | --- openlp/plugins/songs/lib/songstab.py 2015-10-10 20:50:59 +0000 | |||
761 | +++ openlp/plugins/songs/lib/songstab.py 2015-11-04 18:37:18 +0000 | |||
762 | @@ -41,9 +41,6 @@ | |||
763 | 41 | self.mode_group_box.setObjectName('mode_group_box') | 41 | self.mode_group_box.setObjectName('mode_group_box') |
764 | 42 | self.mode_layout = QtGui.QVBoxLayout(self.mode_group_box) | 42 | self.mode_layout = QtGui.QVBoxLayout(self.mode_group_box) |
765 | 43 | self.mode_layout.setObjectName('mode_layout') | 43 | self.mode_layout.setObjectName('mode_layout') |
766 | 44 | self.search_as_type_check_box = QtGui.QCheckBox(self.mode_group_box) | ||
767 | 45 | self.search_as_type_check_box.setObjectName('SearchAsType_check_box') | ||
768 | 46 | self.mode_layout.addWidget(self.search_as_type_check_box) | ||
769 | 47 | self.tool_bar_active_check_box = QtGui.QCheckBox(self.mode_group_box) | 44 | self.tool_bar_active_check_box = QtGui.QCheckBox(self.mode_group_box) |
770 | 48 | self.tool_bar_active_check_box.setObjectName('tool_bar_active_check_box') | 45 | self.tool_bar_active_check_box.setObjectName('tool_bar_active_check_box') |
771 | 49 | self.mode_layout.addWidget(self.tool_bar_active_check_box) | 46 | self.mode_layout.addWidget(self.tool_bar_active_check_box) |
772 | @@ -62,7 +59,6 @@ | |||
773 | 62 | self.left_layout.addWidget(self.mode_group_box) | 59 | self.left_layout.addWidget(self.mode_group_box) |
774 | 63 | self.left_layout.addStretch() | 60 | self.left_layout.addStretch() |
775 | 64 | self.right_layout.addStretch() | 61 | self.right_layout.addStretch() |
776 | 65 | self.search_as_type_check_box.stateChanged.connect(self.on_search_as_type_check_box_changed) | ||
777 | 66 | self.tool_bar_active_check_box.stateChanged.connect(self.on_tool_bar_active_check_box_changed) | 62 | self.tool_bar_active_check_box.stateChanged.connect(self.on_tool_bar_active_check_box_changed) |
778 | 67 | self.update_on_edit_check_box.stateChanged.connect(self.on_update_on_edit_check_box_changed) | 63 | self.update_on_edit_check_box.stateChanged.connect(self.on_update_on_edit_check_box_changed) |
779 | 68 | self.add_from_service_check_box.stateChanged.connect(self.on_add_from_service_check_box_changed) | 64 | self.add_from_service_check_box.stateChanged.connect(self.on_add_from_service_check_box_changed) |
780 | @@ -71,7 +67,6 @@ | |||
781 | 71 | 67 | ||
782 | 72 | def retranslateUi(self): | 68 | def retranslateUi(self): |
783 | 73 | self.mode_group_box.setTitle(translate('SongsPlugin.SongsTab', 'Songs Mode')) | 69 | self.mode_group_box.setTitle(translate('SongsPlugin.SongsTab', 'Songs Mode')) |
784 | 74 | self.search_as_type_check_box.setText(translate('SongsPlugin.SongsTab', 'Enable search as you type')) | ||
785 | 75 | self.tool_bar_active_check_box.setText(translate('SongsPlugin.SongsTab', | 70 | self.tool_bar_active_check_box.setText(translate('SongsPlugin.SongsTab', |
786 | 76 | 'Display verses on live tool bar')) | 71 | 'Display verses on live tool bar')) |
787 | 77 | self.update_on_edit_check_box.setText(translate('SongsPlugin.SongsTab', 'Update service from song edit')) | 72 | self.update_on_edit_check_box.setText(translate('SongsPlugin.SongsTab', 'Update service from song edit')) |
788 | @@ -103,13 +98,11 @@ | |||
789 | 103 | def load(self): | 98 | def load(self): |
790 | 104 | settings = Settings() | 99 | settings = Settings() |
791 | 105 | settings.beginGroup(self.settings_section) | 100 | settings.beginGroup(self.settings_section) |
792 | 106 | self.song_search = settings.value('search as type') | ||
793 | 107 | self.tool_bar = settings.value('display songbar') | 101 | self.tool_bar = settings.value('display songbar') |
794 | 108 | self.update_edit = settings.value('update service on edit') | 102 | self.update_edit = settings.value('update service on edit') |
795 | 109 | self.update_load = settings.value('add song from service') | 103 | self.update_load = settings.value('add song from service') |
796 | 110 | self.display_songbook = settings.value('display songbook') | 104 | self.display_songbook = settings.value('display songbook') |
797 | 111 | self.display_copyright_symbol = settings.value('display copyright symbol') | 105 | self.display_copyright_symbol = settings.value('display copyright symbol') |
798 | 112 | self.search_as_type_check_box.setChecked(self.song_search) | ||
799 | 113 | self.tool_bar_active_check_box.setChecked(self.tool_bar) | 106 | self.tool_bar_active_check_box.setChecked(self.tool_bar) |
800 | 114 | self.update_on_edit_check_box.setChecked(self.update_edit) | 107 | self.update_on_edit_check_box.setChecked(self.update_edit) |
801 | 115 | self.add_from_service_check_box.setChecked(self.update_load) | 108 | self.add_from_service_check_box.setChecked(self.update_load) |
802 | @@ -120,7 +113,6 @@ | |||
803 | 120 | def save(self): | 113 | def save(self): |
804 | 121 | settings = Settings() | 114 | settings = Settings() |
805 | 122 | settings.beginGroup(self.settings_section) | 115 | settings.beginGroup(self.settings_section) |
806 | 123 | settings.setValue('search as type', self.song_search) | ||
807 | 124 | settings.setValue('display songbar', self.tool_bar) | 116 | settings.setValue('display songbar', self.tool_bar) |
808 | 125 | settings.setValue('update service on edit', self.update_edit) | 117 | settings.setValue('update service on edit', self.update_edit) |
809 | 126 | settings.setValue('add song from service', self.update_load) | 118 | settings.setValue('add song from service', self.update_load) |
810 | 127 | 119 | ||
811 | === modified file 'openlp/plugins/songs/songsplugin.py' | |||
812 | --- openlp/plugins/songs/songsplugin.py 2015-02-11 20:56:13 +0000 | |||
813 | +++ openlp/plugins/songs/songsplugin.py 2015-11-04 18:37:18 +0000 | |||
814 | @@ -57,7 +57,6 @@ | |||
815 | 57 | 'songs/last search type': SongSearch.Entire, | 57 | 'songs/last search type': SongSearch.Entire, |
816 | 58 | 'songs/last import type': SongFormat.OpenLyrics, | 58 | 'songs/last import type': SongFormat.OpenLyrics, |
817 | 59 | 'songs/update service on edit': False, | 59 | 'songs/update service on edit': False, |
818 | 60 | 'songs/search as type': True, | ||
819 | 61 | 'songs/add song from service': True, | 60 | 'songs/add song from service': True, |
820 | 62 | 'songs/display songbar': True, | 61 | 'songs/display songbar': True, |
821 | 63 | 'songs/display songbook': False, | 62 | 'songs/display songbook': False, |
822 | @@ -226,11 +225,9 @@ | |||
823 | 226 | Called to find out if the song plugin is currently using a theme. | 225 | Called to find out if the song plugin is currently using a theme. |
824 | 227 | 226 | ||
825 | 228 | :param theme: The theme to check for usage | 227 | :param theme: The theme to check for usage |
827 | 229 | :return: True if the theme is being used, otherwise returns False | 228 | :return: count of the number of times the theme is used. |
828 | 230 | """ | 229 | """ |
832 | 231 | if self.manager.get_all_objects(Song, Song.theme_name == theme): | 230 | return len(self.manager.get_all_objects(Song, Song.theme_name == theme)) |
830 | 232 | return True | ||
831 | 233 | return False | ||
833 | 234 | 231 | ||
834 | 235 | def rename_theme(self, old_theme, new_theme): | 232 | def rename_theme(self, old_theme, new_theme): |
835 | 236 | """ | 233 | """ |
836 | 237 | 234 | ||
837 | === added directory 'tests/functional/openlp_core' | |||
838 | === added file 'tests/functional/openlp_core/test_init.py' | |||
839 | --- tests/functional/openlp_core/test_init.py 1970-01-01 00:00:00 +0000 | |||
840 | +++ tests/functional/openlp_core/test_init.py 2015-11-04 18:37:18 +0000 | |||
841 | @@ -0,0 +1,144 @@ | |||
842 | 1 | # -*- coding: utf-8 -*- | ||
843 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 | ||
844 | 3 | |||
845 | 4 | ############################################################################### | ||
846 | 5 | # OpenLP - Open Source Lyrics Projection # | ||
847 | 6 | # --------------------------------------------------------------------------- # | ||
848 | 7 | # Copyright (c) 2008-2015 OpenLP Developers # | ||
849 | 8 | # --------------------------------------------------------------------------- # | ||
850 | 9 | # This program is free software; you can redistribute it and/or modify it # | ||
851 | 10 | # under the terms of the GNU General Public License as published by the Free # | ||
852 | 11 | # Software Foundation; version 2 of the License. # | ||
853 | 12 | # # | ||
854 | 13 | # This program is distributed in the hope that it will be useful, but WITHOUT # | ||
855 | 14 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # | ||
856 | 15 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # | ||
857 | 16 | # more details. # | ||
858 | 17 | # # | ||
859 | 18 | # You should have received a copy of the GNU General Public License along # | ||
860 | 19 | # with this program; if not, write to the Free Software Foundation, Inc., 59 # | ||
861 | 20 | # Temple Place, Suite 330, Boston, MA 02111-1307 USA # | ||
862 | 21 | ############################################################################### | ||
863 | 22 | |||
864 | 23 | import sys | ||
865 | 24 | from unittest import TestCase | ||
866 | 25 | |||
867 | 26 | from openlp.core import parse_options | ||
868 | 27 | from tests.helpers.testmixin import TestMixin | ||
869 | 28 | |||
870 | 29 | |||
871 | 30 | class TestInitFunctions(TestMixin, TestCase): | ||
872 | 31 | |||
873 | 32 | def parse_options_basic_test(self): | ||
874 | 33 | """ | ||
875 | 34 | Test the parse options process works | ||
876 | 35 | |||
877 | 36 | """ | ||
878 | 37 | # GIVEN: a a set of system arguments. | ||
879 | 38 | sys.argv[1:] = [] | ||
880 | 39 | # WHEN: We we parse them to expand to options | ||
881 | 40 | args = parse_options() | ||
882 | 41 | # THEN: the following fields will have been extracted. | ||
883 | 42 | self.assertFalse(args.dev_version, 'The dev_version flag should be False') | ||
884 | 43 | self.assertEquals(args.loglevel, 'warning', 'The log level should be set to warning') | ||
885 | 44 | self.assertFalse(args.no_error_form, 'The no_error_form should be set to False') | ||
886 | 45 | self.assertFalse(args.portable, 'The portable flag should be set to false') | ||
887 | 46 | self.assertEquals(args.style, None, 'There are no style flags to be processed') | ||
888 | 47 | self.assertEquals(args.rargs, [], 'The service file should be blank') | ||
889 | 48 | |||
890 | 49 | def parse_options_debug_test(self): | ||
891 | 50 | """ | ||
892 | 51 | Test the parse options process works for debug only | ||
893 | 52 | |||
894 | 53 | """ | ||
895 | 54 | # GIVEN: a a set of system arguments. | ||
896 | 55 | sys.argv[1:] = ['-l debug'] | ||
897 | 56 | # WHEN: We we parse them to expand to options | ||
898 | 57 | args = parse_options() | ||
899 | 58 | # THEN: the following fields will have been extracted. | ||
900 | 59 | self.assertFalse(args.dev_version, 'The dev_version flag should be False') | ||
901 | 60 | self.assertEquals(args.loglevel, ' debug', 'The log level should be set to debug') | ||
902 | 61 | self.assertFalse(args.no_error_form, 'The no_error_form should be set to False') | ||
903 | 62 | self.assertFalse(args.portable, 'The portable flag should be set to false') | ||
904 | 63 | self.assertEquals(args.style, None, 'There are no style flags to be processed') | ||
905 | 64 | self.assertEquals(args.rargs, [], 'The service file should be blank') | ||
906 | 65 | |||
907 | 66 | def parse_options_debug_and_portable_test(self): | ||
908 | 67 | """ | ||
909 | 68 | Test the parse options process works for debug and portable | ||
910 | 69 | |||
911 | 70 | """ | ||
912 | 71 | # GIVEN: a a set of system arguments. | ||
913 | 72 | sys.argv[1:] = ['--portable'] | ||
914 | 73 | # WHEN: We we parse them to expand to options | ||
915 | 74 | args = parse_options() | ||
916 | 75 | # THEN: the following fields will have been extracted. | ||
917 | 76 | self.assertFalse(args.dev_version, 'The dev_version flag should be False') | ||
918 | 77 | self.assertEquals(args.loglevel, 'warning', 'The log level should be set to warning') | ||
919 | 78 | self.assertFalse(args.no_error_form, 'The no_error_form should be set to False') | ||
920 | 79 | self.assertTrue(args.portable, 'The portable flag should be set to true') | ||
921 | 80 | self.assertEquals(args.style, None, 'There are no style flags to be processed') | ||
922 | 81 | self.assertEquals(args.rargs, [], 'The service file should be blank') | ||
923 | 82 | |||
924 | 83 | def parse_options_all_no_file_test(self): | ||
925 | 84 | """ | ||
926 | 85 | Test the parse options process works with two options | ||
927 | 86 | |||
928 | 87 | """ | ||
929 | 88 | # GIVEN: a a set of system arguments. | ||
930 | 89 | sys.argv[1:] = ['-l debug', '-d'] | ||
931 | 90 | # WHEN: We we parse them to expand to options | ||
932 | 91 | args = parse_options() | ||
933 | 92 | # THEN: the following fields will have been extracted. | ||
934 | 93 | self.assertTrue(args.dev_version, 'The dev_version flag should be True') | ||
935 | 94 | self.assertEquals(args.loglevel, ' debug', 'The log level should be set to debug') | ||
936 | 95 | self.assertFalse(args.no_error_form, 'The no_error_form should be set to False') | ||
937 | 96 | self.assertFalse(args.portable, 'The portable flag should be set to false') | ||
938 | 97 | self.assertEquals(args.style, None, 'There are no style flags to be processed') | ||
939 | 98 | self.assertEquals(args.rargs, [], 'The service file should be blank') | ||
940 | 99 | |||
941 | 100 | def parse_options_file_test(self): | ||
942 | 101 | """ | ||
943 | 102 | Test the parse options process works with a file | ||
944 | 103 | |||
945 | 104 | """ | ||
946 | 105 | # GIVEN: a a set of system arguments. | ||
947 | 106 | sys.argv[1:] = ['dummy_temp'] | ||
948 | 107 | # WHEN: We we parse them to expand to options | ||
949 | 108 | args = parse_options() | ||
950 | 109 | # THEN: the following fields will have been extracted. | ||
951 | 110 | self.assertFalse(args.dev_version, 'The dev_version flag should be False') | ||
952 | 111 | self.assertEquals(args.loglevel, 'warning', 'The log level should be set to warning') | ||
953 | 112 | self.assertFalse(args.no_error_form, 'The no_error_form should be set to False') | ||
954 | 113 | self.assertFalse(args.portable, 'The portable flag should be set to false') | ||
955 | 114 | self.assertEquals(args.style, None, 'There are no style flags to be processed') | ||
956 | 115 | self.assertEquals(args.rargs, 'dummy_temp', 'The service file should not be blank') | ||
957 | 116 | |||
958 | 117 | def parse_options_file_and_debug_test(self): | ||
959 | 118 | """ | ||
960 | 119 | Test the parse options process works with a file | ||
961 | 120 | |||
962 | 121 | """ | ||
963 | 122 | # GIVEN: a a set of system arguments. | ||
964 | 123 | sys.argv[1:] = ['-l debug', 'dummy_temp'] | ||
965 | 124 | # WHEN: We we parse them to expand to options | ||
966 | 125 | args = parse_options() | ||
967 | 126 | # THEN: the following fields will have been extracted. | ||
968 | 127 | self.assertFalse(args.dev_version, 'The dev_version flag should be False') | ||
969 | 128 | self.assertEquals(args.loglevel, ' debug', 'The log level should be set to debug') | ||
970 | 129 | self.assertFalse(args.no_error_form, 'The no_error_form should be set to False') | ||
971 | 130 | self.assertFalse(args.portable, 'The portable flag should be set to false') | ||
972 | 131 | self.assertEquals(args.style, None, 'There are no style flags to be processed') | ||
973 | 132 | self.assertEquals(args.rargs, 'dummy_temp', 'The service file should not be blank') | ||
974 | 133 | |||
975 | 134 | def parse_options_two_files_test(self): | ||
976 | 135 | """ | ||
977 | 136 | Test the parse options process works with a file | ||
978 | 137 | |||
979 | 138 | """ | ||
980 | 139 | # GIVEN: a a set of system arguments. | ||
981 | 140 | sys.argv[1:] = ['dummy_temp', 'dummy_temp2'] | ||
982 | 141 | # WHEN: We we parse them to expand to options | ||
983 | 142 | args = parse_options() | ||
984 | 143 | # THEN: the following fields will have been extracted. | ||
985 | 144 | self.assertEquals(args, None, 'The args should be None') | ||
986 | 0 | 145 | ||
987 | === added file 'tests/functional/openlp_core_ui/test_advancedtab.py' | |||
988 | --- tests/functional/openlp_core_ui/test_advancedtab.py 1970-01-01 00:00:00 +0000 | |||
989 | +++ tests/functional/openlp_core_ui/test_advancedtab.py 2015-11-04 18:37:18 +0000 | |||
990 | @@ -0,0 +1,69 @@ | |||
991 | 1 | # -*- coding: utf-8 -*- | ||
992 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 | ||
993 | 3 | |||
994 | 4 | ############################################################################### | ||
995 | 5 | # OpenLP - Open Source Lyrics Projection # | ||
996 | 6 | # --------------------------------------------------------------------------- # | ||
997 | 7 | # Copyright (c) 2008-2015 OpenLP Developers # | ||
998 | 8 | # --------------------------------------------------------------------------- # | ||
999 | 9 | # This program is free software; you can redistribute it and/or modify it # | ||
1000 | 10 | # under the terms of the GNU General Public License as published by the Free # | ||
1001 | 11 | # Software Foundation; version 2 of the License. # | ||
1002 | 12 | # # | ||
1003 | 13 | # This program is distributed in the hope that it will be useful, but WITHOUT # | ||
1004 | 14 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # | ||
1005 | 15 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # | ||
1006 | 16 | # more details. # | ||
1007 | 17 | # # | ||
1008 | 18 | # You should have received a copy of the GNU General Public License along # | ||
1009 | 19 | # with this program; if not, write to the Free Software Foundation, Inc., 59 # | ||
1010 | 20 | # Temple Place, Suite 330, Boston, MA 02111-1307 USA # | ||
1011 | 21 | ############################################################################### | ||
1012 | 22 | """ | ||
1013 | 23 | Package to test the openlp.core.ui.advancedtab package. | ||
1014 | 24 | """ | ||
1015 | 25 | from unittest import TestCase | ||
1016 | 26 | |||
1017 | 27 | from openlp.core.common import Registry | ||
1018 | 28 | from openlp.core.ui.advancedtab import AdvancedTab | ||
1019 | 29 | from openlp.core.ui.settingsform import SettingsForm | ||
1020 | 30 | |||
1021 | 31 | from tests.helpers.testmixin import TestMixin | ||
1022 | 32 | |||
1023 | 33 | |||
1024 | 34 | class TestAdvancedTab(TestCase, TestMixin): | ||
1025 | 35 | |||
1026 | 36 | def setUp(self): | ||
1027 | 37 | """ | ||
1028 | 38 | Set up a few things for the tests | ||
1029 | 39 | """ | ||
1030 | 40 | Registry.create() | ||
1031 | 41 | |||
1032 | 42 | def test_creation(self): | ||
1033 | 43 | """ | ||
1034 | 44 | Test that Advanced Tab is created. | ||
1035 | 45 | """ | ||
1036 | 46 | # GIVEN: A new Advanced Tab | ||
1037 | 47 | settings_form = SettingsForm(None) | ||
1038 | 48 | |||
1039 | 49 | # WHEN: I create an advanced tab | ||
1040 | 50 | advanced_tab = AdvancedTab(settings_form) | ||
1041 | 51 | |||
1042 | 52 | # THEN: | ||
1043 | 53 | self.assertEqual("Advanced", advanced_tab.tab_title, 'The tab title should be Advanced') | ||
1044 | 54 | |||
1045 | 55 | def test_change_search_as_type(self): | ||
1046 | 56 | """ | ||
1047 | 57 | Test that when search as type is changed custom and song configs are updated | ||
1048 | 58 | """ | ||
1049 | 59 | # GIVEN: A new Advanced Tab | ||
1050 | 60 | settings_form = SettingsForm(None) | ||
1051 | 61 | advanced_tab = AdvancedTab(settings_form) | ||
1052 | 62 | |||
1053 | 63 | # WHEN: I change search as type check box | ||
1054 | 64 | advanced_tab.on_search_as_type_check_box_changed(True) | ||
1055 | 65 | |||
1056 | 66 | # THEN: we should have two post save processed to run | ||
1057 | 67 | self.assertEqual(2, len(settings_form.processes), 'Two post save processes should be created') | ||
1058 | 68 | self.assertTrue("songs_config_updated" in settings_form.processes, 'The songs plugin should be called') | ||
1059 | 69 | self.assertTrue("custom_config_updated" in settings_form.processes, 'The custom plugin should be called') | ||
1060 | 0 | 70 | ||
1061 | === modified file 'tests/functional/openlp_core_ui/test_mainwindow.py' | |||
1062 | --- tests/functional/openlp_core_ui/test_mainwindow.py 2015-01-30 21:15:03 +0000 | |||
1063 | +++ tests/functional/openlp_core_ui/test_mainwindow.py 2015-11-04 18:37:18 +0000 | |||
1064 | @@ -71,7 +71,7 @@ | |||
1065 | 71 | with patch('openlp.core.ui.servicemanager.ServiceManager.load_file') as mocked_load_path: | 71 | with patch('openlp.core.ui.servicemanager.ServiceManager.load_file') as mocked_load_path: |
1066 | 72 | 72 | ||
1067 | 73 | # WHEN the argument is processed | 73 | # WHEN the argument is processed |
1069 | 74 | self.main_window.open_cmd_line_files() | 74 | self.main_window.open_cmd_line_files(service) |
1070 | 75 | 75 | ||
1071 | 76 | # THEN the service from the arguments is loaded | 76 | # THEN the service from the arguments is loaded |
1072 | 77 | mocked_load_path.assert_called_with(service), 'load_path should have been called with the service\'s path' | 77 | mocked_load_path.assert_called_with(service), 'load_path should have been called with the service\'s path' |
1073 | @@ -86,7 +86,7 @@ | |||
1074 | 86 | with patch('openlp.core.ui.servicemanager.ServiceManager.load_file') as mocked_load_path: | 86 | with patch('openlp.core.ui.servicemanager.ServiceManager.load_file') as mocked_load_path: |
1075 | 87 | 87 | ||
1076 | 88 | # WHEN the argument is processed | 88 | # WHEN the argument is processed |
1078 | 89 | self.main_window.open_cmd_line_files() | 89 | self.main_window.open_cmd_line_files("") |
1079 | 90 | 90 | ||
1080 | 91 | # THEN the file should not be opened | 91 | # THEN the file should not be opened |
1081 | 92 | assert not mocked_load_path.called, 'load_path should not have been called' | 92 | assert not mocked_load_path.called, 'load_path should not have been called' |
1082 | 93 | 93 | ||
1083 | === modified file 'tests/functional/openlp_core_utils/test_init.py' | |||
1084 | --- tests/functional/openlp_core_utils/test_init.py 2015-01-19 08:34:29 +0000 | |||
1085 | +++ tests/functional/openlp_core_utils/test_init.py 2015-11-04 18:37:18 +0000 | |||
1086 | @@ -25,7 +25,7 @@ | |||
1087 | 25 | from unittest import TestCase | 25 | from unittest import TestCase |
1088 | 26 | 26 | ||
1089 | 27 | from openlp.core.common.settings import Settings | 27 | from openlp.core.common.settings import Settings |
1091 | 28 | from openlp.core.utils import VersionThread, get_application_version, get_uno_command | 28 | from openlp.core.utils import VersionThread, get_uno_command |
1092 | 29 | from tests.functional import MagicMock, patch | 29 | from tests.functional import MagicMock, patch |
1093 | 30 | from tests.helpers.testmixin import TestMixin | 30 | from tests.helpers.testmixin import TestMixin |
1094 | 31 | 31 | ||
1095 | 32 | 32 | ||
1096 | === modified file 'tests/functional/test_init.py' | |||
1097 | --- tests/functional/test_init.py 2015-04-25 19:29:39 +0000 | |||
1098 | +++ tests/functional/test_init.py 2015-11-04 18:37:18 +0000 | |||
1099 | @@ -33,7 +33,6 @@ | |||
1100 | 33 | from tests.helpers.testmixin import TestMixin | 33 | from tests.helpers.testmixin import TestMixin |
1101 | 34 | from tests.functional import MagicMock, patch, call | 34 | from tests.functional import MagicMock, patch, call |
1102 | 35 | 35 | ||
1103 | 36 | |||
1104 | 37 | TEST_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'resources')) | 36 | TEST_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'resources')) |
1105 | 38 | 37 | ||
1106 | 39 | 38 | ||
1107 | @@ -132,60 +131,3 @@ | |||
1108 | 132 | # THEN: It should ask if we want to create a backup | 131 | # THEN: It should ask if we want to create a backup |
1109 | 133 | self.assertEqual(Settings().value('core/application version'), '2.2.0', 'Version should be upgraded!') | 132 | self.assertEqual(Settings().value('core/application version'), '2.2.0', 'Version should be upgraded!') |
1110 | 134 | self.assertEqual(mocked_question.call_count, 1, 'A question should have been asked!') | 133 | self.assertEqual(mocked_question.call_count, 1, 'A question should have been asked!') |
1111 | 135 | |||
1112 | 136 | @patch(u'openlp.core.OptionParser') | ||
1113 | 137 | def parse_options_test(self, MockedOptionParser): | ||
1114 | 138 | """ | ||
1115 | 139 | Test that parse_options sets up OptionParser correctly and parses the options given | ||
1116 | 140 | """ | ||
1117 | 141 | # GIVEN: A list of valid options and a mocked out OptionParser object | ||
1118 | 142 | options = ['-e', '-l', 'debug', '-pd', '-s', 'style', 'extra', 'qt', 'args'] | ||
1119 | 143 | mocked_parser = MagicMock() | ||
1120 | 144 | MockedOptionParser.return_value = mocked_parser | ||
1121 | 145 | expected_calls = [ | ||
1122 | 146 | call('-e', '--no-error-form', dest='no_error_form', action='store_true', | ||
1123 | 147 | help='Disable the error notification form.'), | ||
1124 | 148 | call('-l', '--log-level', dest='loglevel', default='warning', metavar='LEVEL', | ||
1125 | 149 | help='Set logging to LEVEL level. Valid values are "debug", "info", "warning".'), | ||
1126 | 150 | call('-p', '--portable', dest='portable', action='store_true', | ||
1127 | 151 | help='Specify if this should be run as a portable app, off a USB flash drive (not implemented).'), | ||
1128 | 152 | call('-d', '--dev-version', dest='dev_version', action='store_true', | ||
1129 | 153 | help='Ignore the version file and pull the version directly from Bazaar'), | ||
1130 | 154 | call('-s', '--style', dest='style', help='Set the Qt4 style (passed directly to Qt4).') | ||
1131 | 155 | ] | ||
1132 | 156 | |||
1133 | 157 | # WHEN: Calling parse_options | ||
1134 | 158 | parse_options(options) | ||
1135 | 159 | |||
1136 | 160 | # THEN: A tuple should be returned with the parsed options and left over options | ||
1137 | 161 | MockedOptionParser.assert_called_with(usage='Usage: %prog [options] [qt-options]') | ||
1138 | 162 | self.assertEquals(expected_calls, mocked_parser.add_option.call_args_list) | ||
1139 | 163 | mocked_parser.parse_args.assert_called_with(options) | ||
1140 | 164 | |||
1141 | 165 | @patch(u'openlp.core.OptionParser') | ||
1142 | 166 | def parse_options_from_sys_argv_test(self, MockedOptionParser): | ||
1143 | 167 | """ | ||
1144 | 168 | Test that parse_options sets up OptionParser correctly and parses sys.argv | ||
1145 | 169 | """ | ||
1146 | 170 | # GIVEN: A list of valid options and a mocked out OptionParser object | ||
1147 | 171 | mocked_parser = MagicMock() | ||
1148 | 172 | MockedOptionParser.return_value = mocked_parser | ||
1149 | 173 | expected_calls = [ | ||
1150 | 174 | call('-e', '--no-error-form', dest='no_error_form', action='store_true', | ||
1151 | 175 | help='Disable the error notification form.'), | ||
1152 | 176 | call('-l', '--log-level', dest='loglevel', default='warning', metavar='LEVEL', | ||
1153 | 177 | help='Set logging to LEVEL level. Valid values are "debug", "info", "warning".'), | ||
1154 | 178 | call('-p', '--portable', dest='portable', action='store_true', | ||
1155 | 179 | help='Specify if this should be run as a portable app, off a USB flash drive (not implemented).'), | ||
1156 | 180 | call('-d', '--dev-version', dest='dev_version', action='store_true', | ||
1157 | 181 | help='Ignore the version file and pull the version directly from Bazaar'), | ||
1158 | 182 | call('-s', '--style', dest='style', help='Set the Qt4 style (passed directly to Qt4).') | ||
1159 | 183 | ] | ||
1160 | 184 | |||
1161 | 185 | # WHEN: Calling parse_options | ||
1162 | 186 | parse_options([]) | ||
1163 | 187 | |||
1164 | 188 | # THEN: A tuple should be returned with the parsed options and left over options | ||
1165 | 189 | MockedOptionParser.assert_called_with(usage='Usage: %prog [options] [qt-options]') | ||
1166 | 190 | self.assertEquals(expected_calls, mocked_parser.add_option.call_args_list) | ||
1167 | 191 | mocked_parser.parse_args.assert_called_with() | ||
1168 | 192 | 134 | ||
1169 | === modified file 'tests/utils/test_bzr_tags.py' | |||
1170 | --- tests/utils/test_bzr_tags.py 2015-10-17 11:18:23 +0000 | |||
1171 | +++ tests/utils/test_bzr_tags.py 2015-11-04 18:37:18 +0000 | |||
1172 | @@ -23,39 +23,13 @@ | |||
1173 | 23 | Package to test for proper bzr tags. | 23 | Package to test for proper bzr tags. |
1174 | 24 | """ | 24 | """ |
1175 | 25 | import os | 25 | import os |
1176 | 26 | import re | ||
1177 | 27 | from unittest import TestCase | 26 | from unittest import TestCase |
1178 | 28 | 27 | ||
1179 | 29 | from subprocess import Popen, PIPE | 28 | from subprocess import Popen, PIPE |
1180 | 30 | 29 | ||
1209 | 31 | TAGS = [ | 30 | TAGS1 = {'1.9.0', '1.9.1', '1.9.2', '1.9.3', '1.9.4', '1.9.5', '1.9.6', '1.9.7', '1.9.8', '1.9.9', '1.9.10', |
1210 | 32 | ['1.9.0', '1'], | 31 | '1.9.11', '1.9.12', '2.0', '2.1.0', '2.1.1', '2.1.2', '2.1.3', '2.1.4', '2.1.5', '2.1.6', '2.2' |
1211 | 33 | ['1.9.1', '775'], | 32 | } |
1184 | 34 | ['1.9.2', '890'], | ||
1185 | 35 | ['1.9.3', '1063'], | ||
1186 | 36 | ['1.9.4', '1196'], | ||
1187 | 37 | ['1.9.5', '1421'], | ||
1188 | 38 | ['1.9.6', '1657'], | ||
1189 | 39 | ['1.9.7', '1761'], | ||
1190 | 40 | ['1.9.8', '1856'], | ||
1191 | 41 | ['1.9.9', '1917'], | ||
1192 | 42 | ['1.9.10', '2003'], | ||
1193 | 43 | ['1.9.11', '2039'], | ||
1194 | 44 | ['1.9.12', '2063'], | ||
1195 | 45 | ['2.0', '2118'], | ||
1196 | 46 | ['2.1.0', '2119'], | ||
1197 | 47 | ['2.1.1', '2438'], | ||
1198 | 48 | ['2.1.2', '2488'], | ||
1199 | 49 | ['2.1.3', '2513'], | ||
1200 | 50 | ['2.1.4', '2532'], | ||
1201 | 51 | ['2.1.5', '2543'], | ||
1202 | 52 | ['2.1.6', '2550'], | ||
1203 | 53 | ['2.2', '2562'] | ||
1204 | 54 | ] | ||
1205 | 55 | # Depending on the repository, we sometimes have the 2.0.x tags in the repo too. They come up with a revision number of | ||
1206 | 56 | # "?", which I suspect is due to the fact that we're using shared repositories. This regular expression matches all | ||
1207 | 57 | # 2.0.x tags. | ||
1208 | 58 | TAG_SEARCH = re.compile('2\.0\.\d') | ||
1212 | 59 | 33 | ||
1213 | 60 | 34 | ||
1214 | 61 | class TestBzrTags(TestCase): | 35 | class TestBzrTags(TestCase): |
1215 | @@ -70,8 +44,12 @@ | |||
1216 | 70 | # WHEN getting the branches tags | 44 | # WHEN getting the branches tags |
1217 | 71 | bzr = Popen(('bzr', 'tags', '--directory=' + path), stdout=PIPE) | 45 | bzr = Popen(('bzr', 'tags', '--directory=' + path), stdout=PIPE) |
1218 | 72 | std_out = bzr.communicate()[0] | 46 | std_out = bzr.communicate()[0] |
1221 | 73 | tags = [line.decode('utf-8').split() for line in std_out.splitlines()] | 47 | count = len(TAGS1) |
1222 | 74 | tags = [t_r for t_r in tags if t_r[1] != '?' or not (t_r[1] == '?' and TAG_SEARCH.search(t_r[0]))] | 48 | tags = [line.decode('utf-8').split()[0] for line in std_out.splitlines()] |
1223 | 49 | count1 = 0 | ||
1224 | 50 | for t in tags: | ||
1225 | 51 | if t in TAGS1: | ||
1226 | 52 | count1 += 1 | ||
1227 | 75 | 53 | ||
1228 | 76 | # THEN the tags should match the accepted tags | 54 | # THEN the tags should match the accepted tags |
1230 | 77 | self.assertEqual(TAGS, tags, 'List of tags should match') | 55 | self.assertEqual(count, count1, 'List of tags should match') |
lp:~trb143/openlp/bugs-2_4b (revision 2576) ci.openlp. io/job/ Branch- 01-Pull/ 1148/ ci.openlp. io/job/ Branch- 02-Functional- Tests/1071/ ci.openlp. io/job/ Branch- 03-Interface- Tests/1012/ ci.openlp. io/job/ Branch- 04a-Windows_ Functional_ Tests/859/ ci.openlp. io/job/ Branch- 04b-Windows_ Interface_ Tests/456/ ci.openlp. io/job/ Branch- 05a-Code_ Analysis/ 577/ ci.openlp. io/job/ Branch- 05b-Test_ Coverage/ 448/
[SUCCESS] https//
[SUCCESS] https//
[SUCCESS] https//
[SUCCESS] https//
[SUCCESS] https//
[SUCCESS] https//
[SUCCESS] https//