[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-v07 into lp:openlp
The proposal to merge lp:~alisonken1/openlp/pjlink2-v07 into lp:openlp has been updated. Status: Needs review => Merged For more details, see: https://code.launchpad.net/~alisonken1/openlp/pjlink2-v07/+merge/367473 -- Your team OpenLP Core is subscribed to branch lp:openlp. ___ Mailing list: https://launchpad.net/~openlp-core Post to : openlp-core@lists.launchpad.net Unsubscribe : https://launchpad.net/~openlp-core More help : https://help.launchpad.net/ListHelp
Re: [Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-v07 into lp:openlp
Review: Approve -- https://code.launchpad.net/~alisonken1/openlp/pjlink2-v07/+merge/367473 Your team OpenLP Core is subscribed to branch lp:openlp. ___ Mailing list: https://launchpad.net/~openlp-core Post to : openlp-core@lists.launchpad.net Unsubscribe : https://launchpad.net/~openlp-core More help : https://help.launchpad.net/ListHelp
Re: [Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-v07 into lp:openlp
Review: Approve Looks OK to me. -- https://code.launchpad.net/~alisonken1/openlp/pjlink2-v07/+merge/367473 Your team OpenLP Core is subscribed to branch lp:openlp. ___ Mailing list: https://launchpad.net/~openlp-core Post to : openlp-core@lists.launchpad.net Unsubscribe : https://launchpad.net/~openlp-core More help : https://help.launchpad.net/ListHelp
[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-v07 into lp:openlp
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-v07 into lp:openlp with lp:~alisonken1/openlp/pjlink2-v06 as a prerequisite. Commit message: PJLink 2 Update v07 Requested reviews: Phill (phill-ridout) For more details, see: https://code.launchpad.net/~alisonken1/openlp/pjlink2-v07/+merge/367473 NOTE: Part 7 of a multi-part merge. v[1..n] merges are to fix tests - Move reset_information() test from commands_03 module to pjlink_base_03 module - Add missing attribute pjlink.projector_errors {} for ERST data - Remove extraneous translates from process_erst() - Added import string to pjlinkcommands to validate authentication token - Fix return codes for PJLINK command - Update/add tests for PJLINK command - Remove tests for commands not handled yet - Remove extraneous parens in asserts lp:~alisonken1/openlp/pjlink2-v07 (revision 2871) https://ci.openlp.io/job/Branch-01-Pull/2737/ [SUCCESS] https://ci.openlp.io/job/Branch-02a-Linux-Tests/2631/ [SUCCESS] https://ci.openlp.io/job/Branch-02b-macOS-Tests/406/ [SUCCESS] https://ci.openlp.io/job/Branch-03a-Build-Source/228/ [SUCCESS] https://ci.openlp.io/job/Branch-03b-Build-macOS/212/ [SUCCESS] https://ci.openlp.io/job/Branch-04a-Code-Lint/1690/[SUCCESS] https://ci.openlp.io/job/Branch-04b-Test-Coverage/1503/[SUCCESS] https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/381/ [SUCCESS] All builds passed -- Your team OpenLP Core is subscribed to branch lp:openlp. === modified file 'openlp/core/projectors/constants.py' --- openlp/core/projectors/constants.py 2019-05-04 05:25:07 + +++ openlp/core/projectors/constants.py 2019-05-15 13:39:42 + @@ -39,6 +39,7 @@ PJLINK_PORT = 4352 PJLINK_SUFFIX = CR PJLINK_TIMEOUT = 30.0 +PJLINK_TOKEN_SIZE = 8 # PJLINK 1 : where is 8 characters # Error and status codes S_OK = E_OK = 0 # E_OK included since I sometimes forget === modified file 'openlp/core/projectors/pjlink.py' --- openlp/core/projectors/pjlink.py 2019-05-05 04:08:32 + +++ openlp/core/projectors/pjlink.py 2019-05-15 13:39:42 + @@ -281,6 +281,7 @@ self.pjlink_class = copy(PJLINK_CLASS) self.pjlink_name = None # NAME self.power = S_OFF # POWR +self.projector_errors = {} # Full ERST errors self.serial_no = None # SNUM self.serial_no_received = None self.sw_version = None # SVER === modified file 'openlp/core/projectors/pjlinkcommands.py' --- openlp/core/projectors/pjlinkcommands.py 2019-05-05 04:08:32 + +++ openlp/core/projectors/pjlinkcommands.py 2019-05-15 13:39:42 + @@ -29,13 +29,13 @@ import logging import re +import string -from openlp.core.common.i18n import translate from openlp.core.common.settings import Settings from openlp.core.projectors.constants import E_AUTHENTICATION, PJLINK_DEFAULT_CODES, PJLINK_ERRORS, \ -PJLINK_ERST_DATA, PJLINK_ERST_STATUS, PJLINK_POWR_STATUS, S_AUTHENTICATE, S_CONNECT, S_DATA_OK, S_OFF, S_OK, S_ON, \ -S_STANDBY, STATUS_MSG +PJLINK_ERST_DATA, PJLINK_ERST_LIST, PJLINK_ERST_STATUS, PJLINK_POWR_STATUS, PJLINK_TOKEN_SIZE, \ +E_NO_AUTHENTICATION, S_AUTHENTICATE, S_CONNECT, S_DATA_OK, S_OFF, S_OK, S_ON, S_STANDBY, STATUS_MSG log = logging.getLogger(__name__) log.debug('Loading pjlinkcommands') @@ -195,8 +195,7 @@ # Bad data - ignore log.warning('({ip}) Invalid error status response "{data}"'.format(ip=projector.entry.name, data=data)) return -datacheck = int(data) -if datacheck == 0: +if int(data) == 0: projector.projector_errors = None # No errors return @@ -209,23 +208,17 @@ data[PJLINK_ERST_DATA['FILTER']], data[PJLINK_ERST_DATA['OTHER']]) if fan != PJLINK_ERST_STATUS[S_OK]: -projector.projector_errors[translate('OpenLP.ProjectorPJLink', 'Fan')] = \ -PJLINK_ERST_STATUS[fan] +projector.projector_errors[PJLINK_ERST_LIST['FAN']] = PJLINK_ERST_STATUS[fan] if lamp != PJLINK_ERST_STATUS[S_OK]: -projector.projector_errors[translate('OpenLP.ProjectorPJLink', 'Lamp')] = \ -PJLINK_ERST_STATUS[lamp] +projector.projector_errors[PJLINK_ERST_LIST['LAMP']] = PJLINK_ERST_STATUS[lamp] if temp != PJLINK_ERST_STATUS[S_OK]: -projector.projector_errors[translate('OpenLP.ProjectorPJLink', 'Temperature')] = \ -PJLINK_ERST_STATUS[temp] +projector.projector_errors[PJLINK_ERST_LIST['TEMP']] = PJLINK_ERST_STATUS[temp] if cover != PJLINK_ERST_STATUS[S_OK]: -projector.projector_errors[translate('OpenLP.ProjectorPJLink', 'Cover')] = \ -PJLINK_ERST_STATUS[cover] +projector.projector_errors[PJLINK_ERST_LIST[
[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-v07 into lp:openlp
The proposal to merge lp:~alisonken1/openlp/pjlink2-v07 into lp:openlp has been updated. Status: Needs review => Superseded For more details, see: https://code.launchpad.net/~alisonken1/openlp/pjlink2-v07/+merge/367304 -- Your team OpenLP Core is subscribed to branch lp:openlp. ___ Mailing list: https://launchpad.net/~openlp-core Post to : openlp-core@lists.launchpad.net Unsubscribe : https://launchpad.net/~openlp-core More help : https://help.launchpad.net/ListHelp
Re: [Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-v07 into lp:openlp
Review: Needs Fixing You have quite a few "assert (chk == E_NO_AUTHENTICATION), ''" the brackets are not needed. Also you're "@patch.object(openlp.core.projectors.pjlinkcommands, 'log')" a lot, have you considered putting it in the setUp method? Other than that looks good to me! -- https://code.launchpad.net/~alisonken1/openlp/pjlink2-v07/+merge/367304 Your team OpenLP Core is subscribed to branch lp:openlp. ___ Mailing list: https://launchpad.net/~openlp-core Post to : openlp-core@lists.launchpad.net Unsubscribe : https://launchpad.net/~openlp-core More help : https://help.launchpad.net/ListHelp
[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-v07 into lp:openlp
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-v07 into lp:openlp with lp:~alisonken1/openlp/pjlink2-v06 as a prerequisite. Commit message: PJLink 2 Update v07 Requested reviews: OpenLP Core (openlp-core) For more details, see: https://code.launchpad.net/~alisonken1/openlp/pjlink2-v07/+merge/367304 NOTE: Part 7 of a multi-part merge. v[1..n] merges are to fix tests - Move reset_information() test from commands_03 module to pjlink_base_03 module - Add missing attribute pjlink.projector_errors {} for ERST data - Remove extraneous translates from process_erst() - Added import string to pjlinkcommands to validate authentication token - Fix return codes for PJLINK command - Update/add tests for PJLINK command - Remove tests for commands not handled yet NOTE: MAC offline, all tests except 2 MAC tests passed -- Your team OpenLP Core is requested to review the proposed merge of lp:~alisonken1/openlp/pjlink2-v07 into lp:openlp. === modified file 'openlp/core/projectors/constants.py' --- openlp/core/projectors/constants.py 2019-05-04 05:25:07 + +++ openlp/core/projectors/constants.py 2019-05-11 09:24:01 + @@ -39,6 +39,7 @@ PJLINK_PORT = 4352 PJLINK_SUFFIX = CR PJLINK_TIMEOUT = 30.0 +PJLINK_TOKEN_SIZE = 8 # PJLINK 1 : where is 8 characters # Error and status codes S_OK = E_OK = 0 # E_OK included since I sometimes forget === modified file 'openlp/core/projectors/pjlink.py' --- openlp/core/projectors/pjlink.py 2019-05-05 04:08:32 + +++ openlp/core/projectors/pjlink.py 2019-05-11 09:24:01 + @@ -281,6 +281,7 @@ self.pjlink_class = copy(PJLINK_CLASS) self.pjlink_name = None # NAME self.power = S_OFF # POWR +self.projector_errors = {} # Full ERST errors self.serial_no = None # SNUM self.serial_no_received = None self.sw_version = None # SVER === modified file 'openlp/core/projectors/pjlinkcommands.py' --- openlp/core/projectors/pjlinkcommands.py 2019-05-05 04:08:32 + +++ openlp/core/projectors/pjlinkcommands.py 2019-05-11 09:24:01 + @@ -29,13 +29,13 @@ import logging import re +import string -from openlp.core.common.i18n import translate from openlp.core.common.settings import Settings from openlp.core.projectors.constants import E_AUTHENTICATION, PJLINK_DEFAULT_CODES, PJLINK_ERRORS, \ -PJLINK_ERST_DATA, PJLINK_ERST_STATUS, PJLINK_POWR_STATUS, S_AUTHENTICATE, S_CONNECT, S_DATA_OK, S_OFF, S_OK, S_ON, \ -S_STANDBY, STATUS_MSG +PJLINK_ERST_DATA, PJLINK_ERST_LIST, PJLINK_ERST_STATUS, PJLINK_POWR_STATUS, PJLINK_TOKEN_SIZE, \ +E_NO_AUTHENTICATION, S_AUTHENTICATE, S_CONNECT, S_DATA_OK, S_OFF, S_OK, S_ON, S_STANDBY, STATUS_MSG log = logging.getLogger(__name__) log.debug('Loading pjlinkcommands') @@ -195,8 +195,7 @@ # Bad data - ignore log.warning('({ip}) Invalid error status response "{data}"'.format(ip=projector.entry.name, data=data)) return -datacheck = int(data) -if datacheck == 0: +if int(data) == 0: projector.projector_errors = None # No errors return @@ -209,23 +208,17 @@ data[PJLINK_ERST_DATA['FILTER']], data[PJLINK_ERST_DATA['OTHER']]) if fan != PJLINK_ERST_STATUS[S_OK]: -projector.projector_errors[translate('OpenLP.ProjectorPJLink', 'Fan')] = \ -PJLINK_ERST_STATUS[fan] +projector.projector_errors[PJLINK_ERST_LIST['FAN']] = PJLINK_ERST_STATUS[fan] if lamp != PJLINK_ERST_STATUS[S_OK]: -projector.projector_errors[translate('OpenLP.ProjectorPJLink', 'Lamp')] = \ -PJLINK_ERST_STATUS[lamp] +projector.projector_errors[PJLINK_ERST_LIST['LAMP']] = PJLINK_ERST_STATUS[lamp] if temp != PJLINK_ERST_STATUS[S_OK]: -projector.projector_errors[translate('OpenLP.ProjectorPJLink', 'Temperature')] = \ -PJLINK_ERST_STATUS[temp] +projector.projector_errors[PJLINK_ERST_LIST['TEMP']] = PJLINK_ERST_STATUS[temp] if cover != PJLINK_ERST_STATUS[S_OK]: -projector.projector_errors[translate('OpenLP.ProjectorPJLink', 'Cover')] = \ -PJLINK_ERST_STATUS[cover] +projector.projector_errors[PJLINK_ERST_LIST['COVER']] = PJLINK_ERST_STATUS[cover] if filt != PJLINK_ERST_STATUS[S_OK]: -projector.projector_errors[translate('OpenLP.ProjectorPJLink', 'Filter')] = \ -PJLINK_ERST_STATUS[filt] +projector.projector_errors[PJLINK_ERST_LIST['FILTER']] = PJLINK_ERST_STATUS[filt] if other != PJLINK_ERST_STATUS[S_OK]: -projector.projector_errors[translate('OpenLP.ProjectorPJLink', 'Other')] = \ -PJLINK_ERST_STATUS[other] +projector.projector_errors[PJLINK_ERST_LIST['OTHER']] = PJLINK_ERST_STATUS[other] return @@ -389,20 +382,29 @@ if len(chk) > 1: # Invalid data - there should be nothing after a normal authentication scheme