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: |
375 lines (+60/-49) 13 files modified
openlp/core/projectors/db.py (+7/-1) openlp/core/projectors/manager.py (+11/-27) openlp/core/projectors/pjlink.py (+15/-4) openlp/core/ui/advancedtab.py (+2/-2) openlp/core/ui/icons.py (+8/-4) openlp/core/ui/themestab.py (+1/-1) 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 |
---|---|---|---|
Tim Bentley | Approve | ||
Review via email: mp+364164@code.launchpad.net |
This proposal supersedes a proposal from 2019-03-08.
This proposal has been superseded by a proposal from 2019-03-09.
Commit message
PJLink2 Update U
Description of the change
Honest - last merge request for this series
(found oops in running code not found during test)
- 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 source select check for db id in projector object
- 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 : 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.
- 2850. By Ken Roberts
-
Minor cleanups
Tim Bentley (trb143) : | # |
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-09 03:53:55 +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-09 03:53:55 +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 | @@ -880,6 +859,7 @@ | |||
105 | 880 | """ | 859 | """ |
106 | 881 | Update the icons when the selected projectors change | 860 | Update the icons when the selected projectors change |
107 | 882 | """ | 861 | """ |
108 | 862 | log.debug('update_icons(): Checking for selected projector items in list') | ||
109 | 883 | count = len(self.projector_list_widget.selectedItems()) | 863 | count = len(self.projector_list_widget.selectedItems()) |
110 | 884 | projector = None | 864 | projector = None |
111 | 885 | if count == 0: | 865 | if count == 0: |
112 | @@ -900,6 +880,7 @@ | |||
113 | 900 | self.get_toolbar_item('blank_projector_multiple', hidden=True) | 880 | self.get_toolbar_item('blank_projector_multiple', hidden=True) |
114 | 901 | self.get_toolbar_item('show_projector_multiple', hidden=True) | 881 | self.get_toolbar_item('show_projector_multiple', hidden=True) |
115 | 902 | elif count == 1: | 882 | elif count == 1: |
116 | 883 | log.debug('update_icons(): Found one item selected') | ||
117 | 903 | projector = self.projector_list_widget.selectedItems()[0].data(QtCore.Qt.UserRole) | 884 | projector = self.projector_list_widget.selectedItems()[0].data(QtCore.Qt.UserRole) |
118 | 904 | connected = QSOCKET_STATE[projector.link.state()] == S_CONNECTED | 885 | connected = QSOCKET_STATE[projector.link.state()] == S_CONNECTED |
119 | 905 | power = projector.link.power == S_ON | 886 | power = projector.link.power == S_ON |
120 | @@ -910,12 +891,14 @@ | |||
121 | 910 | self.get_toolbar_item('blank_projector_multiple', hidden=True) | 891 | self.get_toolbar_item('blank_projector_multiple', hidden=True) |
122 | 911 | self.get_toolbar_item('show_projector_multiple', hidden=True) | 892 | self.get_toolbar_item('show_projector_multiple', hidden=True) |
123 | 912 | if connected: | 893 | if connected: |
124 | 894 | log.debug('update_icons(): Updating icons for connected state') | ||
125 | 913 | self.get_toolbar_item('view_projector', enabled=True) | 895 | self.get_toolbar_item('view_projector', enabled=True) |
126 | 914 | self.get_toolbar_item('source_view_projector', | 896 | self.get_toolbar_item('source_view_projector', |
128 | 915 | enabled=connected and power and projector.link.source_available is not None) | 897 | enabled=projector.link.source_available is not None and connected and power) |
129 | 916 | self.get_toolbar_item('edit_projector', hidden=True) | 898 | self.get_toolbar_item('edit_projector', hidden=True) |
130 | 917 | self.get_toolbar_item('delete_projector', hidden=True) | 899 | self.get_toolbar_item('delete_projector', hidden=True) |
131 | 918 | else: | 900 | else: |
132 | 901 | log.debug('update_icons(): Updating for not connected state') | ||
133 | 919 | self.get_toolbar_item('view_projector', hidden=True) | 902 | self.get_toolbar_item('view_projector', hidden=True) |
134 | 920 | self.get_toolbar_item('source_view_projector', hidden=True) | 903 | self.get_toolbar_item('source_view_projector', hidden=True) |
135 | 921 | self.get_toolbar_item('edit_projector', enabled=True) | 904 | self.get_toolbar_item('edit_projector', enabled=True) |
136 | @@ -931,6 +914,7 @@ | |||
137 | 931 | self.get_toolbar_item('blank_projector', enabled=False) | 914 | self.get_toolbar_item('blank_projector', enabled=False) |
138 | 932 | self.get_toolbar_item('show_projector', enabled=False) | 915 | self.get_toolbar_item('show_projector', enabled=False) |
139 | 933 | else: | 916 | else: |
140 | 917 | log.debug('update_icons(): Updating for multiple items selected') | ||
141 | 934 | self.get_toolbar_item('edit_projector', enabled=False) | 918 | self.get_toolbar_item('edit_projector', enabled=False) |
142 | 935 | self.get_toolbar_item('delete_projector', enabled=False) | 919 | self.get_toolbar_item('delete_projector', enabled=False) |
143 | 936 | self.get_toolbar_item('view_projector', hidden=True) | 920 | self.get_toolbar_item('view_projector', hidden=True) |
144 | 937 | 921 | ||
145 | === modified file 'openlp/core/projectors/pjlink.py' | |||
146 | --- openlp/core/projectors/pjlink.py 2019-02-14 15:09:09 +0000 | |||
147 | +++ openlp/core/projectors/pjlink.py 2019-03-09 03:53:55 +0000 | |||
148 | @@ -528,8 +528,9 @@ | |||
149 | 528 | sources.append(source) | 528 | sources.append(source) |
150 | 529 | sources.sort() | 529 | sources.sort() |
151 | 530 | self.source_available = sources | 530 | self.source_available = sources |
154 | 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, |
155 | 532 | data=self.source_available)) | 532 | data=self.source_available)) |
156 | 533 | self.projectorUpdateIcons.emit() | ||
157 | 533 | return | 534 | return |
158 | 534 | 535 | ||
159 | 535 | def process_lamp(self, data): | 536 | def process_lamp(self, data): |
160 | @@ -886,6 +887,9 @@ | |||
161 | 886 | elif status >= S_NOT_CONNECTED and status in QSOCKET_STATE: | 887 | elif status >= S_NOT_CONNECTED and status in QSOCKET_STATE: |
162 | 887 | # Socket connection status update | 888 | # Socket connection status update |
163 | 888 | self.status_connect = status | 889 | self.status_connect = status |
164 | 890 | # Check if we need to update error state as well | ||
165 | 891 | if self.error_status != S_OK and status != S_NOT_CONNECTED: | ||
166 | 892 | self.error_status = S_OK | ||
167 | 889 | elif status >= S_NOT_CONNECTED and status in PROJECTOR_STATE: | 893 | elif status >= S_NOT_CONNECTED and status in PROJECTOR_STATE: |
168 | 890 | # Only affects the projector status | 894 | # Only affects the projector status |
169 | 891 | self.projector_status = status | 895 | self.projector_status = status |
170 | @@ -905,7 +909,14 @@ | |||
171 | 905 | message=status_message if msg is None else msg)) | 909 | message=status_message if msg is None else msg)) |
172 | 906 | 910 | ||
173 | 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 |
175 | 908 | (code, message) = self._get_status(status) | 912 | # Check for connection errors first |
176 | 913 | if self.error_status != S_OK: | ||
177 | 914 | log.debug('({ip}) Signalling error code'.format(ip=self.entry.name)) | ||
178 | 915 | code, message = self._get_status(self.error_status) | ||
179 | 916 | status = self.error_status | ||
180 | 917 | else: | ||
181 | 918 | log.debug('({ip}) Signalling status code'.format(ip=self.entry.name)) | ||
182 | 919 | code, message = self._get_status(status) | ||
183 | 909 | if msg is not None: | 920 | if msg is not None: |
184 | 910 | message = msg | 921 | message = msg |
185 | 911 | elif message is None: | 922 | elif message is None: |
186 | @@ -953,7 +964,7 @@ | |||
187 | 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)) |
188 | 954 | return self.disconnect_from_host() | 965 | return self.disconnect_from_host() |
189 | 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 |
191 | 956 | log.debug('({ip}) check_login(): Formatting initial connection prompt' | 967 | log.debug('({ip}) check_login(): Formatting initial connection prompt ' |
192 | 957 | 'to PJLink packet'.format(ip=self.entry.name)) | 968 | 'to PJLink packet'.format(ip=self.entry.name)) |
193 | 958 | return self.get_data('{start}{clss}{data}'.format(start=PJLINK_PREFIX, | 969 | return self.get_data('{start}{clss}{data}'.format(start=PJLINK_PREFIX, |
194 | 959 | clss='1', | 970 | clss='1', |
195 | 960 | 971 | ||
196 | === modified file 'openlp/core/ui/advancedtab.py' | |||
197 | --- openlp/core/ui/advancedtab.py 2019-02-14 15:09:09 +0000 | |||
198 | +++ openlp/core/ui/advancedtab.py 2019-03-09 03:53:55 +0000 | |||
199 | @@ -455,7 +455,7 @@ | |||
200 | 455 | Service Name options changed | 455 | Service Name options changed |
201 | 456 | """ | 456 | """ |
202 | 457 | self.service_name_day.setEnabled(default_service_enabled) | 457 | self.service_name_day.setEnabled(default_service_enabled) |
204 | 458 | time_enabled = default_service_enabled and self.service_name_day.currentIndex() is not 7 | 458 | time_enabled = default_service_enabled and self.service_name_day.currentIndex() != 7 |
205 | 459 | self.service_name_time.setEnabled(time_enabled) | 459 | self.service_name_time.setEnabled(time_enabled) |
206 | 460 | self.service_name_edit.setEnabled(default_service_enabled) | 460 | self.service_name_edit.setEnabled(default_service_enabled) |
207 | 461 | self.service_name_revert_button.setEnabled(default_service_enabled) | 461 | self.service_name_revert_button.setEnabled(default_service_enabled) |
208 | @@ -497,7 +497,7 @@ | |||
209 | 497 | """ | 497 | """ |
210 | 498 | React to the day of the service name changing. | 498 | React to the day of the service name changing. |
211 | 499 | """ | 499 | """ |
213 | 500 | self.service_name_time.setEnabled(service_day is not 7) | 500 | self.service_name_time.setEnabled(service_day != 7) |
214 | 501 | self.update_service_name_example(None) | 501 | self.update_service_name_example(None) |
215 | 502 | 502 | ||
216 | 503 | def on_service_name_revert_button_clicked(self): | 503 | def on_service_name_revert_button_clicked(self): |
217 | 504 | 504 | ||
218 | === modified file 'openlp/core/ui/icons.py' | |||
219 | --- openlp/core/ui/icons.py 2019-02-15 22:34:53 +0000 | |||
220 | +++ openlp/core/ui/icons.py 2019-03-09 03:53:55 +0000 | |||
221 | @@ -117,13 +117,17 @@ | |||
222 | 117 | 'presentation': {'icon': 'fa.bar-chart'}, | 117 | 'presentation': {'icon': 'fa.bar-chart'}, |
223 | 118 | 'preview': {'icon': 'fa.laptop'}, | 118 | 'preview': {'icon': 'fa.laptop'}, |
224 | 119 | 'projector': {'icon': 'op.video'}, | 119 | 'projector': {'icon': 'op.video'}, |
226 | 120 | 'projector_connect': {'icon': 'fa.plug'}, | 120 | 'projector_connect': {'icon': 'fa.plug'}, # Projector connect |
227 | 121 | 'projector_cooldown': {'icon': 'fa.video-camera', 'attr': 'blue'}, | 121 | 'projector_cooldown': {'icon': 'fa.video-camera', 'attr': 'blue'}, |
229 | 122 | 'projector_disconnect': {'icon': 'fa.plug', 'attr': 'lightGray'}, | 122 | 'projector_disconnect': {'icon': 'fa.plug', 'attr': 'lightGray'}, # Projector disconnect |
230 | 123 | 'projector_error': {'icon': 'fa.video-camera', 'attr': 'red'}, | 123 | 'projector_error': {'icon': 'fa.video-camera', 'attr': 'red'}, |
231 | 124 | 'projector_hdmi': {'icon': 'op.hdmi'}, | 124 | 'projector_hdmi': {'icon': 'op.hdmi'}, |
234 | 125 | 'projector_off': {'icon': 'fa.video-camera', 'attr': 'black'}, | 125 | 'projector_power_off': {'icon': 'fa.video-camera', 'attr': 'red'}, # Toolbar power off |
235 | 126 | 'projector_on': {'icon': 'fa.video-camera', 'attr': 'green'}, | 126 | 'projector_power_on': {'icon': 'fa.video-camera', 'attr': 'green'}, # Toolbar power on |
236 | 127 | 'projector_off': {'icon': 'fa.video-camera', 'attr': 'black'}, # Projector off | ||
237 | 128 | 'projector_on': {'icon': 'fa.video-camera', 'attr': 'green'}, # Projector on | ||
238 | 129 | 'projector_select_connect': {'icon': 'fa.plug', 'attr': 'green'}, # Toolbar connect | ||
239 | 130 | 'projector_select_disconnect': {'icon': 'fa.plug', 'attr': 'red'}, # Toolbar disconnect | ||
240 | 127 | 'projector_warmup': {'icon': 'fa.video-camera', 'attr': 'yellow'}, | 131 | 'projector_warmup': {'icon': 'fa.video-camera', 'attr': 'yellow'}, |
241 | 128 | 'picture': {'icon': 'fa.picture-o'}, | 132 | 'picture': {'icon': 'fa.picture-o'}, |
242 | 129 | 'print': {'icon': 'fa.print'}, | 133 | 'print': {'icon': 'fa.print'}, |
243 | 130 | 134 | ||
244 | === modified file 'openlp/core/ui/themestab.py' | |||
245 | --- openlp/core/ui/themestab.py 2019-02-14 15:09:09 +0000 | |||
246 | +++ openlp/core/ui/themestab.py 2019-03-09 03:53:55 +0000 | |||
247 | @@ -206,7 +206,7 @@ | |||
248 | 206 | find_and_set_in_combo_box(self.default_combo_box, self.global_theme) | 206 | find_and_set_in_combo_box(self.default_combo_box, self.global_theme) |
249 | 207 | # self.renderer.set_global_theme() | 207 | # self.renderer.set_global_theme() |
250 | 208 | self.renderer.set_theme_level(self.theme_level) | 208 | self.renderer.set_theme_level(self.theme_level) |
252 | 209 | if self.global_theme is not '': | 209 | if self.global_theme != '': |
253 | 210 | self._preview_global_theme() | 210 | self._preview_global_theme() |
254 | 211 | 211 | ||
255 | 212 | def _preview_global_theme(self): | 212 | def _preview_global_theme(self): |
256 | 213 | 213 | ||
257 | === modified file 'setup.cfg' | |||
258 | --- setup.cfg 2018-10-30 19:46:55 +0000 | |||
259 | +++ setup.cfg 2019-03-09 03:53:55 +0000 | |||
260 | @@ -9,6 +9,7 @@ | |||
261 | 9 | 9 | ||
262 | 10 | [flake8] | 10 | [flake8] |
263 | 11 | exclude=resources.py,vlc.py | 11 | exclude=resources.py,vlc.py |
264 | 12 | max-line-length = 120 | ||
265 | 12 | ignore = E402,W503,W504,D | 13 | ignore = E402,W503,W504,D |
266 | 13 | 14 | ||
267 | 14 | [pycodestyle] | 15 | [pycodestyle] |
268 | 15 | 16 | ||
269 | === modified file 'tests/functional/openlp_core/lib/test_image_manager.py' | |||
270 | --- tests/functional/openlp_core/lib/test_image_manager.py 2019-02-14 15:09:09 +0000 | |||
271 | +++ tests/functional/openlp_core/lib/test_image_manager.py 2019-03-09 03:53:55 +0000 | |||
272 | @@ -178,7 +178,7 @@ | |||
273 | 178 | # THEN a KeyError is thrown | 178 | # THEN a KeyError is thrown |
274 | 179 | with self.assertRaises(KeyError) as context: | 179 | with self.assertRaises(KeyError) as context: |
275 | 180 | self.image_manager.get_image(TEST_PATH, 'church1.jpg') | 180 | self.image_manager.get_image(TEST_PATH, 'church1.jpg') |
277 | 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' |
278 | 182 | 182 | ||
279 | 183 | @patch('openlp.core.lib.imagemanager.run_thread') | 183 | @patch('openlp.core.lib.imagemanager.run_thread') |
280 | 184 | def test_different_dimension_image(self, mocked_run_thread): | 184 | def test_different_dimension_image(self, mocked_run_thread): |
281 | @@ -211,7 +211,7 @@ | |||
282 | 211 | # WHEN: calling with correct image, but wrong dimensions | 211 | # WHEN: calling with correct image, but wrong dimensions |
283 | 212 | with self.assertRaises(KeyError) as context: | 212 | with self.assertRaises(KeyError) as context: |
284 | 213 | self.image_manager.get_image(full_path, 'church.jpg', 120, 120) | 213 | self.image_manager.get_image(full_path, 'church.jpg', 120, 120) |
286 | 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' |
287 | 215 | 215 | ||
288 | 216 | @patch('openlp.core.lib.imagemanager.resize_image') | 216 | @patch('openlp.core.lib.imagemanager.resize_image') |
289 | 217 | @patch('openlp.core.lib.imagemanager.image_to_byte') | 217 | @patch('openlp.core.lib.imagemanager.image_to_byte') |
290 | 218 | 218 | ||
291 | === modified file 'tests/functional/openlp_plugins/media/test_mediaplugin.py' | |||
292 | --- tests/functional/openlp_plugins/media/test_mediaplugin.py 2019-02-14 15:09:09 +0000 | |||
293 | +++ tests/functional/openlp_plugins/media/test_mediaplugin.py 2019-03-09 03:53:55 +0000 | |||
294 | @@ -57,4 +57,4 @@ | |||
295 | 57 | # THEN: about() should return a string object | 57 | # THEN: about() should return a string object |
296 | 58 | assert isinstance(MediaPlugin.about(), str) | 58 | assert isinstance(MediaPlugin.about(), str) |
297 | 59 | # THEN: about() should return a non-empty string | 59 | # THEN: about() should return a non-empty string |
299 | 60 | assert len(MediaPlugin.about()) is not 0 | 60 | assert len(MediaPlugin.about()) != 0 |
300 | 61 | 61 | ||
301 | === modified file 'tests/functional/openlp_plugins/songs/test_lib.py' | |||
302 | --- tests/functional/openlp_plugins/songs/test_lib.py 2019-02-14 15:09:09 +0000 | |||
303 | +++ tests/functional/openlp_plugins/songs/test_lib.py 2019-03-09 03:53:55 +0000 | |||
304 | @@ -199,7 +199,7 @@ | |||
305 | 199 | result = _remove_typos(diff) | 199 | result = _remove_typos(diff) |
306 | 200 | 200 | ||
307 | 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. |
309 | 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.' |
310 | 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.' |
311 | 204 | assert result[0][1] == 0, 'The start indices should be kept.' | 204 | assert result[0][1] == 0, 'The start indices should be kept.' |
312 | 205 | assert result[0][2] == 22, 'The stop indices should be kept.' | 205 | assert result[0][2] == 22, 'The stop indices should be kept.' |
313 | 206 | 206 | ||
314 | === modified file 'tests/functional/openlp_plugins/songusage/test_songusage.py' | |||
315 | --- tests/functional/openlp_plugins/songusage/test_songusage.py 2019-02-14 15:09:09 +0000 | |||
316 | +++ tests/functional/openlp_plugins/songusage/test_songusage.py 2019-03-09 03:53:55 +0000 | |||
317 | @@ -45,8 +45,8 @@ | |||
318 | 45 | # THEN: about() should return a string object | 45 | # THEN: about() should return a string object |
319 | 46 | assert isinstance(SongUsagePlugin.about(), str) | 46 | assert isinstance(SongUsagePlugin.about(), str) |
320 | 47 | # THEN: about() should return a non-empty string | 47 | # THEN: about() should return a non-empty string |
323 | 48 | assert len(SongUsagePlugin.about()) is not 0 | 48 | assert len(SongUsagePlugin.about()) != 0 |
324 | 49 | assert len(SongUsagePlugin.about()) is not 0 | 49 | assert len(SongUsagePlugin.about()) != 0 |
325 | 50 | 50 | ||
326 | 51 | @patch('openlp.plugins.songusage.songusageplugin.Manager') | 51 | @patch('openlp.plugins.songusage.songusageplugin.Manager') |
327 | 52 | def test_song_usage_init(self, MockedManager): | 52 | def test_song_usage_init(self, MockedManager): |
328 | 53 | 53 | ||
329 | === modified file 'tests/openlp_core/projectors/test_projector_db.py' | |||
330 | --- tests/openlp_core/projectors/test_projector_db.py 2019-02-14 15:09:09 +0000 | |||
331 | +++ tests/openlp_core/projectors/test_projector_db.py 2019-03-09 03:53:55 +0000 | |||
332 | @@ -134,6 +134,7 @@ | |||
333 | 134 | """ | 134 | """ |
334 | 135 | Set up anything necessary for all tests | 135 | Set up anything necessary for all tests |
335 | 136 | """ | 136 | """ |
336 | 137 | self.tmp_folder = mkdtemp(prefix='openlp_') | ||
337 | 137 | # Create a test app to keep from segfaulting | 138 | # Create a test app to keep from segfaulting |
338 | 138 | Registry.create() | 139 | Registry.create() |
339 | 139 | self.registry = Registry() | 140 | self.registry = Registry() |
340 | @@ -153,11 +154,11 @@ | |||
341 | 153 | patch('openlp.core.ui.mainwindow.ThemeManager'), \ | 154 | patch('openlp.core.ui.mainwindow.ThemeManager'), \ |
342 | 154 | patch('openlp.core.ui.mainwindow.ProjectorManager'), \ | 155 | patch('openlp.core.ui.mainwindow.ProjectorManager'), \ |
343 | 155 | patch('openlp.core.ui.mainwindow.websockets.WebSocketServer'), \ | 156 | patch('openlp.core.ui.mainwindow.websockets.WebSocketServer'), \ |
345 | 156 | patch('openlp.core.ui.mainwindow.server.HttpServer'): | 157 | patch('openlp.core.ui.mainwindow.server.HttpServer'), \ |
346 | 158 | patch('openlp.core.state.State.list_plugins') as mock_plugins: | ||
347 | 159 | mock_plugins.return_value = [] | ||
348 | 157 | self.main_window = MainWindow() | 160 | self.main_window = MainWindow() |
349 | 158 | 161 | ||
350 | 159 | # Create a temporary database directory and database | ||
351 | 160 | self.tmp_folder = mkdtemp(prefix='openlp_') | ||
352 | 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)) |
353 | 162 | mocked_init_url.return_value = tmpdb_url | 163 | mocked_init_url.return_value = tmpdb_url |
354 | 163 | self.projector = ProjectorDB() | 164 | self.projector = ProjectorDB() |
355 | 164 | 165 | ||
356 | === modified file 'tests/openlp_core/projectors/test_projector_pjlink_commands_01.py' | |||
357 | --- tests/openlp_core/projectors/test_projector_pjlink_commands_01.py 2019-02-14 15:09:09 +0000 | |||
358 | +++ tests/openlp_core/projectors/test_projector_pjlink_commands_01.py 2019-03-09 03:53:55 +0000 | |||
359 | @@ -452,12 +452,16 @@ | |||
360 | 452 | """ | 452 | """ |
361 | 453 | Test saving video source available information | 453 | Test saving video source available information |
362 | 454 | """ | 454 | """ |
363 | 455 | |||
364 | 455 | # GIVEN: Test object | 456 | # GIVEN: Test object |
365 | 456 | with patch.object(openlp.core.projectors.pjlink, 'log') as mock_log: | 457 | with patch.object(openlp.core.projectors.pjlink, 'log') as mock_log: |
366 | 457 | pjlink = PJLink(Projector(**TEST1_DATA), no_poll=True) | 458 | pjlink = PJLink(Projector(**TEST1_DATA), no_poll=True) |
367 | 458 | pjlink.source_available = [] | 459 | pjlink.source_available = [] |
369 | 459 | log_debug_calls = [call('({ip}) Setting projector sources_available to ' | 460 | log_debug_calls = [call('({ip}) reset_information() connect status is ' |
370 | 461 | 'S_NOT_CONNECTED'.format(ip=pjlink.name)), | ||
371 | 462 | call('({ip}) Setting projector source_available to ' | ||
372 | 460 | '"[\'11\', \'12\', \'21\', \'22\', \'31\', \'32\']"'.format(ip=pjlink.name))] | 463 | '"[\'11\', \'12\', \'21\', \'22\', \'31\', \'32\']"'.format(ip=pjlink.name))] |
373 | 464 | |||
374 | 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 |
375 | 462 | chk_test = ['11', '12', '21', '22', '31', '32'] | 466 | chk_test = ['11', '12', '21', '22', '31', '32'] |
376 | 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:/