Merge lp:~alisonken1/openlp/pjlink2-u into lp:openlp
- pjlink2-u
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~alisonken1/openlp/pjlink2-u |
Merge into: | lp:openlp |
Diff against target: |
350 lines (+59/-47) 11 files modified
openlp/core/projectors/db.py (+7/-1) openlp/core/projectors/manager.py (+13/-28) openlp/core/projectors/pjlink.py (+15/-4) openlp/core/ui/icons.py (+8/-4) setup.cfg (+1/-0) tests/functional/openlp_core/lib/test_image_manager.py (+2/-2) tests/functional/openlp_plugins/media/test_mediaplugin.py (+1/-1) tests/functional/openlp_plugins/songs/test_lib.py (+1/-1) tests/functional/openlp_plugins/songusage/test_songusage.py (+2/-2) tests/openlp_core/projectors/test_projector_db.py (+4/-3) tests/openlp_core/projectors/test_projector_pjlink_commands_01.py (+5/-1) |
To merge this branch: | bzr merge lp:~alisonken1/openlp/pjlink2-u |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
OpenLP Core | Pending | ||
Review via email: mp+364153@code.launchpad.net |
This proposal supersedes a proposal from 2019-03-08.
This proposal has been superseded by a proposal from 2019-03-08.
Commit message
PJLink2 Update U
Description of the change
- Fix projector S_ON status icon selection
- Remove unused status items (status icons changed to FA)
- Fix projector icon status update for network errors
(keep error icon until network reconnects rather than disconnect icon)
- Fix colors to projector toolbar connect/power icons
- Fix toolbar select input icon not always enabled after selecting/
- Add max-line-length option for flake8 tests in setup.cfg
- Fix projector tests
-------
lp:~alisonken1/openlp/pjlink2-u (revision 2849)
https:/
https:/
https:/
https:/
https:/
https:/
https:/
https:/
Ken Roberts (alisonken1) wrote : Posted in a previous version of this proposal | # |
Raoul Snyman (raoul-snyman) wrote : Posted in a previous version of this proposal | # |
Linux tests passed!
Raoul Snyman (raoul-snyman) wrote : Posted in a previous version of this proposal | # |
Linting passed!
Raoul Snyman (raoul-snyman) wrote : Posted in a previous version of this proposal | # |
macOS tests failed, please see https:/
Raoul Snyman (raoul-snyman) wrote : | # |
Linux tests passed!
Raoul Snyman (raoul-snyman) wrote : | # |
Linting passed!
Raoul Snyman (raoul-snyman) wrote : | # |
macOS tests failed, please see https:/
Phill (phill-ridout) wrote : Posted in a previous version of this proposal | # |
Few minor inlines.
- 2849. By Ken Roberts
-
PJLink2 Update U
- 2850. By Ken Roberts
-
Minor cleanups
Unmerged revisions
Preview Diff
1 | === modified file 'openlp/core/projectors/db.py' | |||
2 | --- openlp/core/projectors/db.py 2019-02-14 15:09:09 +0000 | |||
3 | +++ openlp/core/projectors/db.py 2019-03-08 15:20:31 +0000 | |||
4 | @@ -417,11 +417,17 @@ | |||
5 | 417 | value: (str) From ProjectorSource, Sources tables or PJLink default code list | 417 | value: (str) From ProjectorSource, Sources tables or PJLink default code list |
6 | 418 | """ | 418 | """ |
7 | 419 | source_dict = {} | 419 | source_dict = {} |
8 | 420 | # Apparently, there was a change to the projector object. Test for which object has db id | ||
9 | 421 | if hasattr(projector, "id"): | ||
10 | 422 | chk = projector.id | ||
11 | 423 | elif hasattr(projector.entry, "id"): | ||
12 | 424 | chk = projector.entry.id | ||
13 | 425 | |||
14 | 420 | # Get default list first | 426 | # Get default list first |
15 | 421 | for key in projector.source_available: | 427 | for key in projector.source_available: |
16 | 422 | item = self.get_object_filtered(ProjectorSource, | 428 | item = self.get_object_filtered(ProjectorSource, |
17 | 423 | and_(ProjectorSource.code == key, | 429 | and_(ProjectorSource.code == key, |
19 | 424 | ProjectorSource.projector_id == projector.id)) | 430 | ProjectorSource.projector_id == chk)) |
20 | 425 | if item is None: | 431 | if item is None: |
21 | 426 | source_dict[key] = PJLINK_DEFAULT_CODES[key] | 432 | source_dict[key] = PJLINK_DEFAULT_CODES[key] |
22 | 427 | else: | 433 | else: |
23 | 428 | 434 | ||
24 | === modified file 'openlp/core/projectors/manager.py' | |||
25 | --- openlp/core/projectors/manager.py 2019-02-14 15:09:09 +0000 | |||
26 | +++ openlp/core/projectors/manager.py 2019-03-08 15:20:31 +0000 | |||
27 | @@ -46,31 +46,10 @@ | |||
28 | 46 | from openlp.core.ui.icons import UiIcons | 46 | from openlp.core.ui.icons import UiIcons |
29 | 47 | from openlp.core.widgets.toolbar import OpenLPToolbar | 47 | from openlp.core.widgets.toolbar import OpenLPToolbar |
30 | 48 | 48 | ||
31 | 49 | |||
32 | 50 | log = logging.getLogger(__name__) | 49 | log = logging.getLogger(__name__) |
33 | 51 | log.debug('projectormanager loaded') | 50 | log.debug('projectormanager loaded') |
34 | 52 | 51 | ||
35 | 53 | 52 | ||
36 | 54 | # Dict for matching projector status to display icon | ||
37 | 55 | STATUS_ICONS = { | ||
38 | 56 | S_NOT_CONNECTED: ':/projector/projector_item_disconnect.png', | ||
39 | 57 | S_CONNECTING: ':/projector/projector_item_connect.png', | ||
40 | 58 | S_CONNECTED: ':/projector/projector_off.png', | ||
41 | 59 | S_OFF: ':/projector/projector_off.png', | ||
42 | 60 | S_INITIALIZE: ':/projector/projector_off.png', | ||
43 | 61 | S_STANDBY: ':/projector/projector_off.png', | ||
44 | 62 | S_WARMUP: ':/projector/projector_warmup.png', | ||
45 | 63 | S_ON: ':/projector/projector_on.png', | ||
46 | 64 | S_COOLDOWN: ':/projector/projector_cooldown.png', | ||
47 | 65 | E_ERROR: ':/projector/projector_error.png', | ||
48 | 66 | E_NETWORK: ':/projector/projector_not_connected_error.png', | ||
49 | 67 | E_SOCKET_TIMEOUT: ':/projector/projector_not_connected_error.png', | ||
50 | 68 | E_AUTHENTICATION: ':/projector/projector_not_connected_error.png', | ||
51 | 69 | E_UNKNOWN_SOCKET_ERROR: ':/projector/projector_not_connected_error.png', | ||
52 | 70 | E_NOT_CONNECTED: ':/projector/projector_not_connected_error.png' | ||
53 | 71 | } | ||
54 | 72 | |||
55 | 73 | |||
56 | 74 | class UiProjectorManager(object): | 53 | class UiProjectorManager(object): |
57 | 75 | """ | 54 | """ |
58 | 76 | UI part of the Projector Manager | 55 | UI part of the Projector Manager |
59 | @@ -122,7 +101,7 @@ | |||
60 | 122 | self.one_toolbar.add_toolbar_action('connect_projector', | 101 | self.one_toolbar.add_toolbar_action('connect_projector', |
61 | 123 | text=translate('OpenLP.ProjectorManager', | 102 | text=translate('OpenLP.ProjectorManager', |
62 | 124 | 'Connect to selected projector.'), | 103 | 'Connect to selected projector.'), |
64 | 125 | icon=UiIcons().projector_connect, | 104 | icon=UiIcons().projector_select_connect, |
65 | 126 | tooltip=translate('OpenLP.ProjectorManager', | 105 | tooltip=translate('OpenLP.ProjectorManager', |
66 | 127 | 'Connect to selected projector.'), | 106 | 'Connect to selected projector.'), |
67 | 128 | triggers=self.on_connect_projector) | 107 | triggers=self.on_connect_projector) |
68 | @@ -136,7 +115,7 @@ | |||
69 | 136 | self.one_toolbar.add_toolbar_action('disconnect_projector', | 115 | self.one_toolbar.add_toolbar_action('disconnect_projector', |
70 | 137 | text=translate('OpenLP.ProjectorManager', | 116 | text=translate('OpenLP.ProjectorManager', |
71 | 138 | 'Disconnect from selected projectors'), | 117 | 'Disconnect from selected projectors'), |
73 | 139 | icon=UiIcons().projector_disconnect, | 118 | icon=UiIcons().projector_select_disconnect, |
74 | 140 | tooltip=translate('OpenLP.ProjectorManager', | 119 | tooltip=translate('OpenLP.ProjectorManager', |
75 | 141 | 'Disconnect from selected projector.'), | 120 | 'Disconnect from selected projector.'), |
76 | 142 | triggers=self.on_disconnect_projector) | 121 | triggers=self.on_disconnect_projector) |
77 | @@ -151,7 +130,7 @@ | |||
78 | 151 | self.one_toolbar.add_toolbar_action('poweron_projector', | 130 | self.one_toolbar.add_toolbar_action('poweron_projector', |
79 | 152 | text=translate('OpenLP.ProjectorManager', | 131 | text=translate('OpenLP.ProjectorManager', |
80 | 153 | 'Power on selected projector'), | 132 | 'Power on selected projector'), |
82 | 154 | icon=UiIcons().projector_on, | 133 | icon=UiIcons().projector_power_on, |
83 | 155 | tooltip=translate('OpenLP.ProjectorManager', | 134 | tooltip=translate('OpenLP.ProjectorManager', |
84 | 156 | 'Power on selected projector.'), | 135 | 'Power on selected projector.'), |
85 | 157 | triggers=self.on_poweron_projector) | 136 | triggers=self.on_poweron_projector) |
86 | @@ -164,7 +143,7 @@ | |||
87 | 164 | triggers=self.on_poweron_projector) | 143 | triggers=self.on_poweron_projector) |
88 | 165 | self.one_toolbar.add_toolbar_action('poweroff_projector', | 144 | self.one_toolbar.add_toolbar_action('poweroff_projector', |
89 | 166 | text=translate('OpenLP.ProjectorManager', 'Standby selected projector'), | 145 | text=translate('OpenLP.ProjectorManager', 'Standby selected projector'), |
91 | 167 | icon=UiIcons().projector_off, | 146 | icon=UiIcons().projector_power_off, |
92 | 168 | tooltip=translate('OpenLP.ProjectorManager', | 147 | tooltip=translate('OpenLP.ProjectorManager', |
93 | 169 | 'Put selected projector in standby.'), | 148 | 'Put selected projector in standby.'), |
94 | 170 | triggers=self.on_poweroff_projector) | 149 | triggers=self.on_poweroff_projector) |
95 | @@ -309,7 +288,7 @@ | |||
96 | 309 | S_INITIALIZE: UiIcons().projector_on, | 288 | S_INITIALIZE: UiIcons().projector_on, |
97 | 310 | S_STANDBY: UiIcons().projector_off, | 289 | S_STANDBY: UiIcons().projector_off, |
98 | 311 | S_WARMUP: UiIcons().projector_warmup, | 290 | S_WARMUP: UiIcons().projector_warmup, |
100 | 312 | S_ON: UiIcons().projector_off, | 291 | S_ON: UiIcons().projector_on, |
101 | 313 | S_COOLDOWN: UiIcons().projector_cooldown, | 292 | S_COOLDOWN: UiIcons().projector_cooldown, |
102 | 314 | E_ERROR: UiIcons().projector_error, | 293 | E_ERROR: UiIcons().projector_error, |
103 | 315 | E_NETWORK: UiIcons().error, | 294 | E_NETWORK: UiIcons().error, |
104 | @@ -505,7 +484,8 @@ | |||
105 | 505 | projector = list_item.data(QtCore.Qt.UserRole) | 484 | projector = list_item.data(QtCore.Qt.UserRole) |
106 | 506 | try: | 485 | try: |
107 | 507 | projector.link.connect_to_host() | 486 | projector.link.connect_to_host() |
109 | 508 | except Exception: | 487 | except Exception as e: |
110 | 488 | print(e) | ||
111 | 509 | continue | 489 | continue |
112 | 510 | 490 | ||
113 | 511 | def on_delete_projector(self, opt=None): | 491 | def on_delete_projector(self, opt=None): |
114 | @@ -880,6 +860,7 @@ | |||
115 | 880 | """ | 860 | """ |
116 | 881 | Update the icons when the selected projectors change | 861 | Update the icons when the selected projectors change |
117 | 882 | """ | 862 | """ |
118 | 863 | log.debug('update_icons(): Checking for selected projector items in list') | ||
119 | 883 | count = len(self.projector_list_widget.selectedItems()) | 864 | count = len(self.projector_list_widget.selectedItems()) |
120 | 884 | projector = None | 865 | projector = None |
121 | 885 | if count == 0: | 866 | if count == 0: |
122 | @@ -900,6 +881,7 @@ | |||
123 | 900 | self.get_toolbar_item('blank_projector_multiple', hidden=True) | 881 | self.get_toolbar_item('blank_projector_multiple', hidden=True) |
124 | 901 | self.get_toolbar_item('show_projector_multiple', hidden=True) | 882 | self.get_toolbar_item('show_projector_multiple', hidden=True) |
125 | 902 | elif count == 1: | 883 | elif count == 1: |
126 | 884 | log.debug('update_icons(): Found one item selected') | ||
127 | 903 | projector = self.projector_list_widget.selectedItems()[0].data(QtCore.Qt.UserRole) | 885 | projector = self.projector_list_widget.selectedItems()[0].data(QtCore.Qt.UserRole) |
128 | 904 | connected = QSOCKET_STATE[projector.link.state()] == S_CONNECTED | 886 | connected = QSOCKET_STATE[projector.link.state()] == S_CONNECTED |
129 | 905 | power = projector.link.power == S_ON | 887 | power = projector.link.power == S_ON |
130 | @@ -910,12 +892,14 @@ | |||
131 | 910 | self.get_toolbar_item('blank_projector_multiple', hidden=True) | 892 | self.get_toolbar_item('blank_projector_multiple', hidden=True) |
132 | 911 | self.get_toolbar_item('show_projector_multiple', hidden=True) | 893 | self.get_toolbar_item('show_projector_multiple', hidden=True) |
133 | 912 | if connected: | 894 | if connected: |
134 | 895 | log.debug('update_icons(): Updating icons for connected state') | ||
135 | 913 | self.get_toolbar_item('view_projector', enabled=True) | 896 | self.get_toolbar_item('view_projector', enabled=True) |
136 | 914 | self.get_toolbar_item('source_view_projector', | 897 | self.get_toolbar_item('source_view_projector', |
138 | 915 | enabled=connected and power and projector.link.source_available is not None) | 898 | enabled=projector.link.source_available is not None and connected and power) |
139 | 916 | self.get_toolbar_item('edit_projector', hidden=True) | 899 | self.get_toolbar_item('edit_projector', hidden=True) |
140 | 917 | self.get_toolbar_item('delete_projector', hidden=True) | 900 | self.get_toolbar_item('delete_projector', hidden=True) |
141 | 918 | else: | 901 | else: |
142 | 902 | log.debug('update_icons(): Updating for not connected state') | ||
143 | 919 | self.get_toolbar_item('view_projector', hidden=True) | 903 | self.get_toolbar_item('view_projector', hidden=True) |
144 | 920 | self.get_toolbar_item('source_view_projector', hidden=True) | 904 | self.get_toolbar_item('source_view_projector', hidden=True) |
145 | 921 | self.get_toolbar_item('edit_projector', enabled=True) | 905 | self.get_toolbar_item('edit_projector', enabled=True) |
146 | @@ -931,6 +915,7 @@ | |||
147 | 931 | self.get_toolbar_item('blank_projector', enabled=False) | 915 | self.get_toolbar_item('blank_projector', enabled=False) |
148 | 932 | self.get_toolbar_item('show_projector', enabled=False) | 916 | self.get_toolbar_item('show_projector', enabled=False) |
149 | 933 | else: | 917 | else: |
150 | 918 | log.debug('update_icons(): Updating for multiple items selected') | ||
151 | 934 | self.get_toolbar_item('edit_projector', enabled=False) | 919 | self.get_toolbar_item('edit_projector', enabled=False) |
152 | 935 | self.get_toolbar_item('delete_projector', enabled=False) | 920 | self.get_toolbar_item('delete_projector', enabled=False) |
153 | 936 | self.get_toolbar_item('view_projector', hidden=True) | 921 | self.get_toolbar_item('view_projector', hidden=True) |
154 | 937 | 922 | ||
155 | === modified file 'openlp/core/projectors/pjlink.py' | |||
156 | --- openlp/core/projectors/pjlink.py 2019-02-14 15:09:09 +0000 | |||
157 | +++ openlp/core/projectors/pjlink.py 2019-03-08 15:20:31 +0000 | |||
158 | @@ -528,8 +528,9 @@ | |||
159 | 528 | sources.append(source) | 528 | sources.append(source) |
160 | 529 | sources.sort() | 529 | sources.sort() |
161 | 530 | self.source_available = sources | 530 | self.source_available = sources |
164 | 531 | log.debug('({ip}) Setting projector sources_available to "{data}"'.format(ip=self.entry.name, | 531 | log.debug('({ip}) Setting projector source_available to "{data}"'.format(ip=self.entry.name, |
165 | 532 | data=self.source_available)) | 532 | data=self.source_available)) |
166 | 533 | self.projectorUpdateIcons.emit() | ||
167 | 533 | return | 534 | return |
168 | 534 | 535 | ||
169 | 535 | def process_lamp(self, data): | 536 | def process_lamp(self, data): |
170 | @@ -886,6 +887,9 @@ | |||
171 | 886 | elif status >= S_NOT_CONNECTED and status in QSOCKET_STATE: | 887 | elif status >= S_NOT_CONNECTED and status in QSOCKET_STATE: |
172 | 887 | # Socket connection status update | 888 | # Socket connection status update |
173 | 888 | self.status_connect = status | 889 | self.status_connect = status |
174 | 890 | # Check if we need to update error state as well | ||
175 | 891 | if self.error_status != S_OK and status != S_NOT_CONNECTED: | ||
176 | 892 | self.error_status = S_OK | ||
177 | 889 | elif status >= S_NOT_CONNECTED and status in PROJECTOR_STATE: | 893 | elif status >= S_NOT_CONNECTED and status in PROJECTOR_STATE: |
178 | 890 | # Only affects the projector status | 894 | # Only affects the projector status |
179 | 891 | self.projector_status = status | 895 | self.projector_status = status |
180 | @@ -905,7 +909,14 @@ | |||
181 | 905 | message=status_message if msg is None else msg)) | 909 | message=status_message if msg is None else msg)) |
182 | 906 | 910 | ||
183 | 907 | # Now that we logged extra information for debugging, broadcast the original change/message | 911 | # Now that we logged extra information for debugging, broadcast the original change/message |
185 | 908 | (code, message) = self._get_status(status) | 912 | # Check for connection errors first |
186 | 913 | if self.error_status != S_OK: | ||
187 | 914 | log.debug('({ip}) Signalling error code'.format(ip=self.entry.name)) | ||
188 | 915 | (code, message) = self._get_status(self.error_status) | ||
189 | 916 | status = self.error_status | ||
190 | 917 | else: | ||
191 | 918 | log.debug('({ip}) Signalling status code'.format(ip=self.entry.name)) | ||
192 | 919 | (code, message) = self._get_status(status) | ||
193 | 909 | if msg is not None: | 920 | if msg is not None: |
194 | 910 | message = msg | 921 | message = msg |
195 | 911 | elif message is None: | 922 | elif message is None: |
196 | @@ -953,7 +964,7 @@ | |||
197 | 953 | log.error('({ip}) Invalid initial packet received - closing socket'.format(ip=self.entry.name)) | 964 | log.error('({ip}) Invalid initial packet received - closing socket'.format(ip=self.entry.name)) |
198 | 954 | return self.disconnect_from_host() | 965 | return self.disconnect_from_host() |
199 | 955 | # Convert the initial login prompt with the expected PJLink normal command format for processing | 966 | # Convert the initial login prompt with the expected PJLink normal command format for processing |
201 | 956 | log.debug('({ip}) check_login(): Formatting initial connection prompt' | 967 | log.debug('({ip}) check_login(): Formatting initial connection prompt ' |
202 | 957 | 'to PJLink packet'.format(ip=self.entry.name)) | 968 | 'to PJLink packet'.format(ip=self.entry.name)) |
203 | 958 | return self.get_data('{start}{clss}{data}'.format(start=PJLINK_PREFIX, | 969 | return self.get_data('{start}{clss}{data}'.format(start=PJLINK_PREFIX, |
204 | 959 | clss='1', | 970 | clss='1', |
205 | 960 | 971 | ||
206 | === modified file 'openlp/core/ui/icons.py' | |||
207 | --- openlp/core/ui/icons.py 2019-02-15 22:34:53 +0000 | |||
208 | +++ openlp/core/ui/icons.py 2019-03-08 15:20:31 +0000 | |||
209 | @@ -117,13 +117,17 @@ | |||
210 | 117 | 'presentation': {'icon': 'fa.bar-chart'}, | 117 | 'presentation': {'icon': 'fa.bar-chart'}, |
211 | 118 | 'preview': {'icon': 'fa.laptop'}, | 118 | 'preview': {'icon': 'fa.laptop'}, |
212 | 119 | 'projector': {'icon': 'op.video'}, | 119 | 'projector': {'icon': 'op.video'}, |
214 | 120 | 'projector_connect': {'icon': 'fa.plug'}, | 120 | 'projector_connect': {'icon': 'fa.plug'}, # Projector connect |
215 | 121 | 'projector_cooldown': {'icon': 'fa.video-camera', 'attr': 'blue'}, | 121 | 'projector_cooldown': {'icon': 'fa.video-camera', 'attr': 'blue'}, |
217 | 122 | 'projector_disconnect': {'icon': 'fa.plug', 'attr': 'lightGray'}, | 122 | 'projector_disconnect': {'icon': 'fa.plug', 'attr': 'lightGray'}, # Projector disconnect |
218 | 123 | 'projector_error': {'icon': 'fa.video-camera', 'attr': 'red'}, | 123 | 'projector_error': {'icon': 'fa.video-camera', 'attr': 'red'}, |
219 | 124 | 'projector_hdmi': {'icon': 'op.hdmi'}, | 124 | 'projector_hdmi': {'icon': 'op.hdmi'}, |
222 | 125 | 'projector_off': {'icon': 'fa.video-camera', 'attr': 'black'}, | 125 | 'projector_power_off': {'icon': 'fa.video-camera', 'attr': 'red'}, # Toolbar power off |
223 | 126 | 'projector_on': {'icon': 'fa.video-camera', 'attr': 'green'}, | 126 | 'projector_power_on': {'icon': 'fa.video-camera', 'attr': 'green'}, # Toolbar power on |
224 | 127 | 'projector_off': {'icon': 'fa.video-camera', 'attr': 'black'}, # Projector off | ||
225 | 128 | 'projector_on': {'icon': 'fa.video-camera', 'attr': 'green'}, # Projector on | ||
226 | 129 | 'projector_select_connect': {'icon': 'fa.plug', 'attr': 'green'}, # Toolbar connect | ||
227 | 130 | 'projector_select_disconnect': {'icon': 'fa.plug', 'attr': 'red'}, # Toolbar disconnect | ||
228 | 127 | 'projector_warmup': {'icon': 'fa.video-camera', 'attr': 'yellow'}, | 131 | 'projector_warmup': {'icon': 'fa.video-camera', 'attr': 'yellow'}, |
229 | 128 | 'picture': {'icon': 'fa.picture-o'}, | 132 | 'picture': {'icon': 'fa.picture-o'}, |
230 | 129 | 'print': {'icon': 'fa.print'}, | 133 | 'print': {'icon': 'fa.print'}, |
231 | 130 | 134 | ||
232 | === modified file 'setup.cfg' | |||
233 | --- setup.cfg 2018-10-30 19:46:55 +0000 | |||
234 | +++ setup.cfg 2019-03-08 15:20:31 +0000 | |||
235 | @@ -9,6 +9,7 @@ | |||
236 | 9 | 9 | ||
237 | 10 | [flake8] | 10 | [flake8] |
238 | 11 | exclude=resources.py,vlc.py | 11 | exclude=resources.py,vlc.py |
239 | 12 | max-line-length = 120 | ||
240 | 12 | ignore = E402,W503,W504,D | 13 | ignore = E402,W503,W504,D |
241 | 13 | 14 | ||
242 | 14 | [pycodestyle] | 15 | [pycodestyle] |
243 | 15 | 16 | ||
244 | === modified file 'tests/functional/openlp_core/lib/test_image_manager.py' | |||
245 | --- tests/functional/openlp_core/lib/test_image_manager.py 2019-02-14 15:09:09 +0000 | |||
246 | +++ tests/functional/openlp_core/lib/test_image_manager.py 2019-03-08 15:20:31 +0000 | |||
247 | @@ -178,7 +178,7 @@ | |||
248 | 178 | # THEN a KeyError is thrown | 178 | # THEN a KeyError is thrown |
249 | 179 | with self.assertRaises(KeyError) as context: | 179 | with self.assertRaises(KeyError) as context: |
250 | 180 | self.image_manager.get_image(TEST_PATH, 'church1.jpg') | 180 | self.image_manager.get_image(TEST_PATH, 'church1.jpg') |
252 | 181 | assert context.exception is not '', 'KeyError exception should have been thrown for missing image' | 181 | assert context.exception != '', 'KeyError exception should have been thrown for missing image' |
253 | 182 | 182 | ||
254 | 183 | @patch('openlp.core.lib.imagemanager.run_thread') | 183 | @patch('openlp.core.lib.imagemanager.run_thread') |
255 | 184 | def test_different_dimension_image(self, mocked_run_thread): | 184 | def test_different_dimension_image(self, mocked_run_thread): |
256 | @@ -211,7 +211,7 @@ | |||
257 | 211 | # WHEN: calling with correct image, but wrong dimensions | 211 | # WHEN: calling with correct image, but wrong dimensions |
258 | 212 | with self.assertRaises(KeyError) as context: | 212 | with self.assertRaises(KeyError) as context: |
259 | 213 | self.image_manager.get_image(full_path, 'church.jpg', 120, 120) | 213 | self.image_manager.get_image(full_path, 'church.jpg', 120, 120) |
261 | 214 | assert context.exception is not '', 'KeyError exception should have been thrown for missing dimension' | 214 | assert context.exception != '', 'KeyError exception should have been thrown for missing dimension' |
262 | 215 | 215 | ||
263 | 216 | @patch('openlp.core.lib.imagemanager.resize_image') | 216 | @patch('openlp.core.lib.imagemanager.resize_image') |
264 | 217 | @patch('openlp.core.lib.imagemanager.image_to_byte') | 217 | @patch('openlp.core.lib.imagemanager.image_to_byte') |
265 | 218 | 218 | ||
266 | === modified file 'tests/functional/openlp_plugins/media/test_mediaplugin.py' | |||
267 | --- tests/functional/openlp_plugins/media/test_mediaplugin.py 2019-02-14 15:09:09 +0000 | |||
268 | +++ tests/functional/openlp_plugins/media/test_mediaplugin.py 2019-03-08 15:20:31 +0000 | |||
269 | @@ -57,4 +57,4 @@ | |||
270 | 57 | # THEN: about() should return a string object | 57 | # THEN: about() should return a string object |
271 | 58 | assert isinstance(MediaPlugin.about(), str) | 58 | assert isinstance(MediaPlugin.about(), str) |
272 | 59 | # THEN: about() should return a non-empty string | 59 | # THEN: about() should return a non-empty string |
274 | 60 | assert len(MediaPlugin.about()) is not 0 | 60 | assert len(MediaPlugin.about()) != 0 |
275 | 61 | 61 | ||
276 | === modified file 'tests/functional/openlp_plugins/songs/test_lib.py' | |||
277 | --- tests/functional/openlp_plugins/songs/test_lib.py 2019-02-14 15:09:09 +0000 | |||
278 | +++ tests/functional/openlp_plugins/songs/test_lib.py 2019-03-08 15:20:31 +0000 | |||
279 | @@ -199,7 +199,7 @@ | |||
280 | 199 | result = _remove_typos(diff) | 199 | result = _remove_typos(diff) |
281 | 200 | 200 | ||
282 | 201 | # THEN: There should be no typos in the middle anymore. The remaining equals should have been merged. | 201 | # THEN: There should be no typos in the middle anymore. The remaining equals should have been merged. |
284 | 202 | assert len(result) is 1, 'The result should contain only one element.' | 202 | assert len(result) == 1, 'The result should contain only one element.' |
285 | 203 | assert result[0][0] == 'equal', 'The result should contain an equal element.' | 203 | assert result[0][0] == 'equal', 'The result should contain an equal element.' |
286 | 204 | assert result[0][1] == 0, 'The start indices should be kept.' | 204 | assert result[0][1] == 0, 'The start indices should be kept.' |
287 | 205 | assert result[0][2] == 22, 'The stop indices should be kept.' | 205 | assert result[0][2] == 22, 'The stop indices should be kept.' |
288 | 206 | 206 | ||
289 | === modified file 'tests/functional/openlp_plugins/songusage/test_songusage.py' | |||
290 | --- tests/functional/openlp_plugins/songusage/test_songusage.py 2019-02-14 15:09:09 +0000 | |||
291 | +++ tests/functional/openlp_plugins/songusage/test_songusage.py 2019-03-08 15:20:31 +0000 | |||
292 | @@ -45,8 +45,8 @@ | |||
293 | 45 | # THEN: about() should return a string object | 45 | # THEN: about() should return a string object |
294 | 46 | assert isinstance(SongUsagePlugin.about(), str) | 46 | assert isinstance(SongUsagePlugin.about(), str) |
295 | 47 | # THEN: about() should return a non-empty string | 47 | # THEN: about() should return a non-empty string |
298 | 48 | assert len(SongUsagePlugin.about()) is not 0 | 48 | assert len(SongUsagePlugin.about()) != 0 |
299 | 49 | assert len(SongUsagePlugin.about()) is not 0 | 49 | assert len(SongUsagePlugin.about()) != 0 |
300 | 50 | 50 | ||
301 | 51 | @patch('openlp.plugins.songusage.songusageplugin.Manager') | 51 | @patch('openlp.plugins.songusage.songusageplugin.Manager') |
302 | 52 | def test_song_usage_init(self, MockedManager): | 52 | def test_song_usage_init(self, MockedManager): |
303 | 53 | 53 | ||
304 | === modified file 'tests/openlp_core/projectors/test_projector_db.py' | |||
305 | --- tests/openlp_core/projectors/test_projector_db.py 2019-02-14 15:09:09 +0000 | |||
306 | +++ tests/openlp_core/projectors/test_projector_db.py 2019-03-08 15:20:31 +0000 | |||
307 | @@ -134,6 +134,7 @@ | |||
308 | 134 | """ | 134 | """ |
309 | 135 | Set up anything necessary for all tests | 135 | Set up anything necessary for all tests |
310 | 136 | """ | 136 | """ |
311 | 137 | self.tmp_folder = mkdtemp(prefix='openlp_') | ||
312 | 137 | # Create a test app to keep from segfaulting | 138 | # Create a test app to keep from segfaulting |
313 | 138 | Registry.create() | 139 | Registry.create() |
314 | 139 | self.registry = Registry() | 140 | self.registry = Registry() |
315 | @@ -153,11 +154,11 @@ | |||
316 | 153 | patch('openlp.core.ui.mainwindow.ThemeManager'), \ | 154 | patch('openlp.core.ui.mainwindow.ThemeManager'), \ |
317 | 154 | patch('openlp.core.ui.mainwindow.ProjectorManager'), \ | 155 | patch('openlp.core.ui.mainwindow.ProjectorManager'), \ |
318 | 155 | patch('openlp.core.ui.mainwindow.websockets.WebSocketServer'), \ | 156 | patch('openlp.core.ui.mainwindow.websockets.WebSocketServer'), \ |
320 | 156 | patch('openlp.core.ui.mainwindow.server.HttpServer'): | 157 | patch('openlp.core.ui.mainwindow.server.HttpServer'), \ |
321 | 158 | patch('openlp.core.state.State.list_plugins') as mock_plugins: | ||
322 | 159 | mock_plugins.return_value = [] | ||
323 | 157 | self.main_window = MainWindow() | 160 | self.main_window = MainWindow() |
324 | 158 | 161 | ||
325 | 159 | # Create a temporary database directory and database | ||
326 | 160 | self.tmp_folder = mkdtemp(prefix='openlp_') | ||
327 | 161 | tmpdb_url = 'sqlite:///{db}'.format(db=os.path.join(self.tmp_folder, TEST_DB)) | 162 | tmpdb_url = 'sqlite:///{db}'.format(db=os.path.join(self.tmp_folder, TEST_DB)) |
328 | 162 | mocked_init_url.return_value = tmpdb_url | 163 | mocked_init_url.return_value = tmpdb_url |
329 | 163 | self.projector = ProjectorDB() | 164 | self.projector = ProjectorDB() |
330 | 164 | 165 | ||
331 | === modified file 'tests/openlp_core/projectors/test_projector_pjlink_commands_01.py' | |||
332 | --- tests/openlp_core/projectors/test_projector_pjlink_commands_01.py 2019-02-14 15:09:09 +0000 | |||
333 | +++ tests/openlp_core/projectors/test_projector_pjlink_commands_01.py 2019-03-08 15:20:31 +0000 | |||
334 | @@ -452,12 +452,16 @@ | |||
335 | 452 | """ | 452 | """ |
336 | 453 | Test saving video source available information | 453 | Test saving video source available information |
337 | 454 | """ | 454 | """ |
338 | 455 | |||
339 | 455 | # GIVEN: Test object | 456 | # GIVEN: Test object |
340 | 456 | with patch.object(openlp.core.projectors.pjlink, 'log') as mock_log: | 457 | with patch.object(openlp.core.projectors.pjlink, 'log') as mock_log: |
341 | 457 | pjlink = PJLink(Projector(**TEST1_DATA), no_poll=True) | 458 | pjlink = PJLink(Projector(**TEST1_DATA), no_poll=True) |
342 | 458 | pjlink.source_available = [] | 459 | pjlink.source_available = [] |
344 | 459 | log_debug_calls = [call('({ip}) Setting projector sources_available to ' | 460 | log_debug_calls = [call('({ip}) reset_information() connect status is ' |
345 | 461 | 'S_NOT_CONNECTED'.format(ip=pjlink.name)), | ||
346 | 462 | call('({ip}) Setting projector source_available to ' | ||
347 | 460 | '"[\'11\', \'12\', \'21\', \'22\', \'31\', \'32\']"'.format(ip=pjlink.name))] | 463 | '"[\'11\', \'12\', \'21\', \'22\', \'31\', \'32\']"'.format(ip=pjlink.name))] |
348 | 464 | |||
349 | 461 | chk_data = '21 12 11 22 32 31' # Although they should already be sorted, use unsorted to verify method | 465 | chk_data = '21 12 11 22 32 31' # Although they should already be sorted, use unsorted to verify method |
350 | 462 | chk_test = ['11', '12', '21', '22', '31', '32'] | 466 | chk_test = ['11', '12', '21', '22', '31', '32'] |
351 | 463 | 467 |
------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- --- /ci.openlp. io/job/ Branch- 01-Pull/ 2696/ [SUCCESS] /ci.openlp. io/job/ Branch- 02a-Linux- Tests/2590/ [SUCCESS] /ci.openlp. io/job/ Branch- 02b-macOS- Tests/360/ [FAILURE] /ci.openlp. io/job/ Branch- 03a-Build- Source/ 190/ [SUCCESS] /ci.openlp. io/job/ Branch- 03b-Build- macOS/169/ [FAILURE] /ci.openlp. io/job/ Branch- 04a-Code- Lint/1652/ [SUCCESS] /ci.openlp. io/job/ Branch- 04b-Test- Coverage/ 1465/ [SUCCESS] /ci.openlp. io/job/ Branch- 05-AppVeyor- Tests/352/ [FAILURE]
lp:~alisonken1/openlp/pjlink2-u (revision 2849)
https:/
https:/
https:/
https:/
https:/
https:/
https:/
https:/