[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-v07 into lp:openlp

2019-05-15 Thread Ken Roberts
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

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-v07 into lp:openlp

2019-05-15 Thread Ken Roberts
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


[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-v07 into lp:openlp

2019-05-11 Thread Ken Roberts
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 authenti

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-v06 into lp:openlp

2019-05-04 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-v06 into 
lp:openlp with lp:~alisonken1/openlp/pjlink2-v05 as a prerequisite.

Commit message:
PJLink2 Update v06

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-v06/+merge/366954

NOTE: Part 6 of a multi-part merge.
  v[1..n] merges are to fix tests

- Fix socket timing issue in PJLink.get_socket()

- Rename file tests/openlp_core/projectors
from test_projector_pjlink_commands_02.py
to test_projector_commands_03.py

- Refactor/fix tests
- Delete edge-case test from pjlink2-v05 update (bad test)


lp:~alisonken1/openlp/pjlink2-v06 (revision 2867)
https://ci.openlp.io/job/Branch-01-Pull/2733/  [SUCCESS]
https://ci.openlp.io/job/Branch-02a-Linux-Tests/2627/  [SUCCESS]
https://ci.openlp.io/job/Branch-02b-macOS-Tests/402/   [SUCCESS]
https://ci.openlp.io/job/Branch-03a-Build-Source/224/  [SUCCESS]
https://ci.openlp.io/job/Branch-03b-Build-macOS/203/   [SUCCESS]
https://ci.openlp.io/job/Branch-04a-Code-Lint/1686/[SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test-Coverage/1499/[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/377/ [SUCCESS]

All builds passed

-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2-v06 into lp:openlp.
=== modified file 'openlp/core/projectors/pjlink.py'
--- openlp/core/projectors/pjlink.py	2019-05-05 04:19:17 +
+++ openlp/core/projectors/pjlink.py	2019-05-05 04:19:17 +
@@ -520,14 +520,23 @@
 self.send_busy = False
 return
 # Although we have a packet length limit, go ahead and use a larger buffer
-read = self.readLine(1024)
-log.debug('({ip}) get_socket(): "{buff}"'.format(ip=self.entry.name, buff=read))
-if read == -1:
+self.socket_timer.start()
+while self.bytesAvailable() >= 1:
+data = self.readLine(1024)
+data = data.strip()
+if not data:
+log.warning('({ip}) get_socket(): Ignoring empty packet'.format(ip=self.entry.name))
+if self.bytesAvailable() < 1:
+break
+
+self.socket_timer.stop()
+if data:
+log.debug('({ip}) get_socket(): "{buff}"'.format(ip=self.entry.name, buff=data))
+if data == -1:
 # No data available
 log.debug('({ip}) get_socket(): No data available (-1)'.format(ip=self.entry.name))
-return self.receive_data_signal()
-self.socket_timer.stop()
-return self.get_data(buff=read)
+return
+return self.get_data(buff=data)
 
 def get_data(self, buff, *args, **kwargs):
 """
@@ -540,21 +549,22 @@
 # NOTE: Class2 has changed to some values being UTF-8
 data_in = decode(buff, 'utf-8') if isinstance(buff, bytes) else buff
 data = data_in.strip()
+self.receive_data_signal()
 # Initial packet checks
 if (len(data) < 7):
 self._trash_buffer(msg='get_data(): Invalid packet - length')
-return self.receive_data_signal()
+return
 elif len(data) > self.max_size:
 self._trash_buffer(msg='get_data(): Invalid packet - too long ({length} bytes)'.format(length=len(data)))
-return self.receive_data_signal()
+return
 elif not data.startswith(PJLINK_PREFIX):
 self._trash_buffer(msg='get_data(): Invalid packet - PJLink prefix missing')
-return self.receive_data_signal()
+return
 elif data[6] != '=' and data[8] != '=':
 # data[6] = standard command packet
 # data[8] = initial PJLink connection (after mangling)
 self._trash_buffer(msg='get_data(): Invalid reply - Does not have "="')
-return self.receive_data_signal()
+return
 log.debug('({ip}) get_data(): Checking new data "{data}"'.format(ip=self.entry.name, data=data))
 header, data = data.split('=')
 log.debug('({ip}) get_data() header="{header}" data="{data}"'.format(ip=self.entry.name,
@@ -572,20 +582,20 @@
data=data))
 if cmd not in PJLINK_VALID_CMD:
 self._trash_buffer('get_data(): Invalid packet - unknown command "{data}"'.format(data=cmd))
-return self.receive_data_signal()
+return
 elif version not in PJLINK_VALID_CMD[cmd]['version']:
 self._trash_buffer(msg='get_data() Command reply version does not match a valid comma

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-v05 into lp:openlp

2019-05-04 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-v05 into 
lp:openlp with lp:~alisonken1/openlp/pjlink2_v04 as a prerequisite.

Commit message:
PJLink2 Update v05

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-v05/+merge/366947

NOTE: Part 5 of a multi-part merge.
  v[1..n] merges are to fix tests

NOTE: Large diff due to test refactoring into multiple files

- Move PJLink ERR[1234A] tests
from test_projector_pjlink_cmd_routing
to test_projector_command_routing
- Rename file
from tests/openlp_core/projectors/test_projector_pjlink_commands_01.py
to test/openlp_core/test_projector_commands_01.py

- Split test_projector_command_01 into 2 parts to manage tests easier:
test_projector_commands_01: PJLink get status part 1
test_projector_commands_02: PJLink get status part 2

- Added set_audio_muted() and set_audio_normal() methods to PJLink class
- Refactor/fix tests test_projector_commands_01


lp:~alisonken1/openlp/pjlink2-v05 (revision 2866)
https://ci.openlp.io/job/Branch-01-Pull/2731/  [SUCCESS]
https://ci.openlp.io/job/Branch-02a-Linux-Tests/2625/  [SUCCESS]
https://ci.openlp.io/job/Branch-02b-macOS-Tests/400/   [SUCCESS]
https://ci.openlp.io/job/Branch-03a-Build-Source/222/  [SUCCESS]
https://ci.openlp.io/job/Branch-03b-Build-macOS/201/   [SUCCESS]
https://ci.openlp.io/job/Branch-04a-Code-Lint/1684/[SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test-Coverage/1497/[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/376/ [SUCCESS]

All builds passed

-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2-v05 into lp:openlp.
=== modified file 'openlp/core/projectors/pjlink.py'
--- openlp/core/projectors/pjlink.py	2019-05-04 10:29:17 +
+++ openlp/core/projectors/pjlink.py	2019-05-04 10:29:17 +
@@ -861,6 +861,24 @@
 log.debug('({ip}) Sending POWR command'.format(ip=self.entry.name))
 return self.send_command(cmd='POWR', priority=priority)
 
+def set_audio_mute(self, priority=False):
+"""
+Send command to set audio to muted
+"""
+log.debug('({ip}) Setting AVMT to 21 (audio mute)'.format(ip=self.entry.name))
+self.send_command(cmd='AVMT', opts='21', priority=True)
+self.status_timer_add(cmd='AVMT', callback=self.get_av_mute_status)
+self.poll_loop()
+
+def set_audio_normal(self, priority=False):
+"""
+Send command to set audio to normal
+"""
+log.debug('({ip}) Setting AVMT to 20 (audio normal)'.format(ip=self.entry.name))
+self.send_command(cmd='AVMT', opts='20', priority=True)
+self.status_timer_add(cmd='AVMT', callback=self.get_av_mute_status)
+self.poll_loop()
+
 def set_input_source(self, src=None):
 """
 Verify input source available as listed in 'INST' command,
@@ -924,9 +942,9 @@
 log.warning('({ip}) "{cmd}" already in checks - returning'.format(ip=self.entry.name, cmd=cmd))
 return
 log.debug('({ip}) Adding "{cmd}" callback for status timer'.format(ip=self.entry.name, cmd=cmd))
+self.status_timer_checks[cmd] = callback
 if not self.status_timer.isActive():
 self.status_timer.start()
-self.status_timer_checks[cmd] = callback
 
 def status_timer_delete(self, cmd):
 """

=== modified file 'openlp/core/projectors/pjlinkcommands.py'
--- openlp/core/projectors/pjlinkcommands.py	2019-05-04 10:29:17 +
+++ openlp/core/projectors/pjlinkcommands.py	2019-05-04 10:29:17 +
@@ -113,15 +113,21 @@
 '31': {'shutter': True, 'mute': True}
 }
 if data not in settings:
-log.warning('({ip}) Invalid shutter response: {data}'.format(ip=projector.entry.name, data=data))
+log.warning('({ip}) Invalid av mute response: {data}'.format(ip=projector.entry.name, data=data))
 return
 shutter = settings[data]['shutter']
 mute = settings[data]['mute']
 # Check if we need to update the icons
 update_icons = (shutter != projector.shutter) or (mute != projector.mute)
-projector.shutter = shutter
-projector.mute = mute
 if update_icons:
+if projector.shutter != shutter:
+projector.shutter = shutter
+log.debug('({ip}) Setting shutter to {chk}'.format(ip=projector.entry.name,
+   chk='closed' if shutter else 'open'))
+if projector.mute != mute:
+   

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2_v04 into lp:openlp

2019-05-03 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2_v04 into 
lp:openlp.

Commit message:
PJLink2 update V04

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2_v04/+merge/366946

NOTE: Part 4 of a multi-part merge.
  v[1..n] merges are to fix tests

- Fixed/Added routing tests for PJLink.get_data() method
- Move process_command() routing tests to separate module
- Refactor/add process_command() tests
- Refactor process_pjlink() command and tests
- Fix PJLink socket state check causing loss of connection (regression)
- Added 3 new status codes for initial connection processing


lp:~alisonken1/openlp/pjlink2_v04 (revision 2865)
https://ci.openlp.io/job/Branch-01-Pull/2729/  [SUCCESS]
https://ci.openlp.io/job/Branch-02a-Linux-Tests/2623/  [SUCCESS]
https://ci.openlp.io/job/Branch-02b-macOS-Tests/398/   [SUCCESS]
https://ci.openlp.io/job/Branch-03a-Build-Source/220/  [SUCCESS]
https://ci.openlp.io/job/Branch-03b-Build-macOS/199/   [SUCCESS]
https://ci.openlp.io/job/Branch-04a-Code-Lint/1682/[SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test-Coverage/1495/[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/375/ [SUCCESS]

All builds passed

-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2_v04 into lp:openlp.
=== modified file 'openlp/core/projectors/constants.py'
--- openlp/core/projectors/constants.py	2019-04-13 13:00:22 +
+++ openlp/core/projectors/constants.py	2019-05-04 05:43:42 +
@@ -106,6 +106,9 @@
 S_ON = 315
 S_COOLDOWN = 316
 S_INFO = 317
+S_CONNECT = 318  # Initial connection, connected
+S_AUTHENTICATE = 319  # Initial connection, send pin hash
+S_DATA_OK = 320  # Previous command returned OK
 
 # Information that does not affect status
 S_NETWORK_IDLE = 400
@@ -369,11 +372,14 @@
 E_UNKNOWN_SOCKET_ERROR: 'E_UNKNOWN_SOCKET_ERROR',
 E_UNSUPPORTED_SOCKET_OPERATION: 'E_UNSUPPORTED_SOCKET_OPERATION',
 E_WARN: 'E_WARN',
+S_AUTHENTICATE: 'S_AUTHENTICATE',
 S_BOUND: 'S_BOUND',
+S_CONNECT: 'S_CONNECT',
 S_COOLDOWN: 'S_COOLDOWN',
 S_CLOSING: 'S_CLOSING',
 S_CONNECTED: 'S_CONNECTED',
 S_CONNECTING: 'S_CONNECTING',
+S_DATA_OK: 'S_DATA_OK',
 S_HOST_LOOKUP: 'S_HOST_LOOKUP',
 S_INFO: 'S_INFO',
 S_INITIALIZE: 'S_INITIALIZE',
@@ -387,7 +393,7 @@
 S_ON: 'S_ON',
 S_STANDBY: 'S_STANDBY',
 S_STATUS: 'S_STATUS',
-S_WARMUP: 'S_WARMUP',
+S_WARMUP: 'S_WARMUP'
 }
 
 # Map status codes to message strings
@@ -459,11 +465,14 @@
   'The requested socket operation is not supported by the local '
   'operating system (e.g., lack of IPv6 support)'),
 E_WARN: translate('OpenLP.ProjectorConstants', 'Warning condition detected'),
+S_AUTHENTICATE: translate('OpenLP.ProjectorConstants', 'Connection initializing with pin'),
 S_BOUND: translate('OpenLP.ProjectorConstants', 'Socket is bount to an address or port'),
+S_CONNECT: translate('OpenLP.ProjectorConstants', 'Connection initializing'),
 S_CLOSING: translate('OpenLP.ProjectorConstants', 'Socket is about to close'),
 S_CONNECTED: translate('OpenLP.ProjectorConstants', 'Connected'),
 S_CONNECTING: translate('OpenLP.ProjectorConstants', 'Connecting'),
 S_COOLDOWN: translate('OpenLP.ProjectorConstants', 'Cooldown in progress'),
+S_DATA_OK: translate('OpenLP.ProjectorConstants', 'Command returned with OK'),
 S_HOST_LOOKUP: translate('OpenLP.ProjectorConstants', 'Performing a host name lookup'),
 S_INFO: translate('OpenLP.ProjectorConstants', 'Projector Information available'),
 S_INITIALIZE: translate('OpenLP.ProjectorConstants', 'Initialize in progress'),

=== modified file 'openlp/core/projectors/pjlink.py'
--- openlp/core/projectors/pjlink.py	2019-04-28 19:21:23 +
+++ openlp/core/projectors/pjlink.py	2019-05-04 05:43:42 +
@@ -52,14 +52,15 @@
 
 from PyQt5 import QtCore, QtNetwork
 
+from openlp.core.common import qmd5_hash
 from openlp.core.common.i18n import translate
 from openlp.core.common.settings import Settings
 from openlp.core.projectors.pjlinkcommands import process_command
-from openlp.core.projectors.constants import CONNECTION_ERRORS, E_CONNECTION_REFUSED, E_GENERAL, \
+from openlp.core.projectors.constants import CONNECTION_ERRORS, E_AUTHENTICATION, E_CONNECTION_REFUSED, E_GENERAL, \
 E_NETWORK, E_NOT_CONNECTED, E_SOCKET_TIMEOUT, PJLINK_CLASS, \
 PJLINK_MAX_PACKET, PJLINK_PORT, PJLINK_PREFIX, PJLINK_SUFFIX, \
-PJLINK_VALID_CMD, PROJECTOR_STATE, QSOCKET_STATE, S_CONNECTED, S_CONNECTING, S_NOT_CONNECTED, S_OFF, S_OK, S_ON, \
-STATUS_CODE, STATUS_MSG
+PJLINK_VALID_CMD

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-v03 into lp:openlp

2019-04-28 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-v03 into 
lp:openlp with lp:~alisonken1/openlp/pjlink2-v02 as a prerequisite.

Commit message:
PJLink2 Update V03

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-v03/+merge/366612

NOTE: Part 3 of a multi-part merge.
  v[1..n] merges are to fix tests

WARNING: Requires merge of lp:~alisonken1/openlp/pjlink2-v02

- Update tests for test_projector_pjlink_base_02.py
- Added setUp() and tearDown() to have a common pjlink instance
- Rename test_send_command_no_data() to test_send_command_not_connected() to 
reflect actual test
- Add tests for PJLink.send_command and PJLink._underscore_send_command
- Fix test_projector_pjlink_cmd_routing for logging change to 
PJLink._underscore_send_command()

- In openlp.core.projectors.pjlink.PJLink class:
- Added copy import for PJLink reset information so PJLINK_CLASS default is 
not changed
- Fix send_command() socket state check
- Change some log entries from debug to warning
- Add call to pjlink._underscore_send_command() for invalid command check if
  send_queue or priority_queue has data to send
- Fix _underscore_send_command no data check to include setting send_busy 
to False


lp:~alisonken1/openlp/pjlink2-v03 (revision 2861)
https://ci.openlp.io/job/Branch-01-Pull/2722/  [SUCCESS]
https://ci.openlp.io/job/Branch-02a-Linux-Tests/2616/  [SUCCESS]
https://ci.openlp.io/job/Branch-02b-macOS-Tests/391/   [SUCCESS]
https://ci.openlp.io/job/Branch-03a-Build-Source/214/  [SUCCESS]
https://ci.openlp.io/job/Branch-03b-Build-macOS/193/   [SUCCESS]
https://ci.openlp.io/job/Branch-04a-Code-Lint/1676/[SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test-Coverage/1489/[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/371/ [SUCCESS]

All builds passed
-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2-v03 into lp:openlp.
=== modified file 'openlp/core/projectors/pjlink.py'
--- openlp/core/projectors/pjlink.py	2019-04-28 07:10:59 +
+++ openlp/core/projectors/pjlink.py	2019-04-28 07:10:59 +
@@ -48,6 +48,7 @@
 """
 import logging
 from codecs import decode
+from copy import copy
 
 from PyQt5 import QtCore, QtNetwork
 
@@ -276,6 +277,7 @@
 self.model_lamp = None  # RLMP
 self.mute = None  # AVMT
 self.other_info = None  # INFO
+self.pjlink_class = copy(PJLINK_CLASS)
 self.pjlink_name = None  # NAME
 self.power = S_OFF  # POWR
 self.serial_no = None  # SNUM
@@ -629,11 +631,14 @@
 :param salt: Optional  salt for md5 hash initial authentication
 :param priority: Option to send packet now rather than queue it up
 """
-if QSOCKET_STATE[self.state()] != S_CONNECTED:
+if QSOCKET_STATE[self.state()] != QSOCKET_STATE[S_CONNECTED]:
 log.warning('({ip}) send_command(): Not connected - returning'.format(ip=self.entry.name))
 return self.reset_information()
 if cmd not in PJLINK_VALID_CMD:
 log.error('({ip}) send_command(): Invalid command requested - ignoring.'.format(ip=self.entry.name))
+if self.priority_queue or self.send_queue:
+# Just in case there's already something to send
+return self._send_command()
 return
 log.debug('({ip}) send_command(): Building cmd="{command}" opts="{data}"{salt}'.format(ip=self.entry.name,
command=cmd,
@@ -649,9 +654,9 @@
  options=opts,
  suffix=PJLINK_SUFFIX)
 if out in self.priority_queue:
-log.debug('({ip}) send_command(): Already in priority queue - skipping'.format(ip=self.entry.name))
+log.warning('({ip}) send_command(): Already in priority queue - skipping'.format(ip=self.entry.name))
 elif out in self.send_queue:
-log.debug('({ip}) send_command(): Already in normal queue - skipping'.format(ip=self.entry.name))
+log.warning('({ip}) send_command(): Already in normal queue - skipping'.format(ip=self.entry.name))
 else:
 if priority:
 log.debug('({ip}) send_command(): Adding to priority queue'.format(ip=self.entry.name))
@@ -672,7 +677,8 @@
 :param utf8: Send as UTF-8 string otherwise send as ASCII string
 """
 if not data and not self.priority_queue and not self.send_queue:
-log.debu

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-v02 into lp:openlp

2019-04-26 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-v02 into 
lp:openlp with lp:~alisonken1/openlp/pjlink2-v1 as a prerequisite.

Commit message:
PJLink2 Update V02

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-v02/+merge/366554

NOTE: Part 2 of a multi-part merge.
  v[2..n] merges are to fix tests

WARNING: Requires merge of lp:~alisonken1/openlp/pjlink2-v1

- Updated pjlink imports
- Added setUp() and tearDown() to pjlinkcommands.py::TestPJLinkBase to have a 
common
  pjlink() instance creation
- Fix tests in test_projector_pjlink_base_01.py
- Move patch.object context managers to decorators


lp:~alisonken1/openlp/pjlink2-v02 (revision 2860)
https://ci.openlp.io/job/Branch-01-Pull/2720/  [SUCCESS]
https://ci.openlp.io/job/Branch-02a-Linux-Tests/2614/  [SUCCESS]
https://ci.openlp.io/job/Branch-02b-macOS-Tests/389/   [SUCCESS]
https://ci.openlp.io/job/Branch-03a-Build-Source/212/  [SUCCESS]
https://ci.openlp.io/job/Branch-03b-Build-macOS/191/   [SUCCESS]
https://ci.openlp.io/job/Branch-04a-Code-Lint/1674/[SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test-Coverage/1487/[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/369/ [FAILURE]
Stopping after failure


-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2-v02 into lp:openlp.
=== modified file 'tests/openlp_core/projectors/test_projector_pjlink_base_01.py'
--- tests/openlp_core/projectors/test_projector_pjlink_base_01.py	2019-04-26 07:51:13 +
+++ tests/openlp_core/projectors/test_projector_pjlink_base_01.py	2019-04-26 07:51:13 +
@@ -22,10 +22,11 @@
 """
 Package to test the openlp.core.projectors.pjlink base package.
 """
-from unittest import TestCase, skip
+from unittest import TestCase
 from unittest.mock import MagicMock, call, patch
 
 import openlp.core.projectors.pjlink
+from openlp.core.projectors.pjlinkcommands import process_command
 from openlp.core.projectors.constants import E_NOT_CONNECTED, E_PARAMETER, E_UNKNOWN_SOCKET_ERROR, QSOCKET_STATE, \
 S_CONNECTED, S_CONNECTING, S_NOT_CONNECTED, S_OK, S_ON, STATUS_CODE, STATUS_MSG
 from openlp.core.projectors.db import Projector
@@ -37,47 +38,56 @@
 """
 Tests for the PJLink module
 """
-@skip('Needs update to new setup')
-def test_status_change(self):
+def setUp(self):
+"""
+Initialize test state(s)
+"""
+# Default PJLink instance for tests
+self.pjlink = PJLink(Projector(**TEST1_DATA), no_poll=True)
+
+def tearDown(self):
+"""
+Cleanup test state(s)
+"""
+del(self.pjlink)
+
+@patch.object(openlp.core.projectors.pjlink.PJLink, 'changeStatus')
+def test_status_change(self, mock_changeStatus):
 """
 Test process_command call with ERR2 (Parameter) status
 """
 # GIVEN: Test object
-with patch('openlp.core.projectors.pjlink.PJLink.changeStatus') as mock_changeStatus:
-
-pjlink = PJLink(Projector(**TEST1_DATA), no_poll=True)
-
-# WHEN: process_command is called with "ERR2" status from projector
-pjlink.process_command('POWR', 'ERR2')
-
-# THEN: change_status should have called change_status with E_UNDEFINED
-#   as first parameter
-mock_changeStatus.called_with(E_PARAMETER,
-  'change_status should have been called with "{}"'.format(
-  STATUS_CODE[E_PARAMETER]))
-
-@skip('Needs update to new setup')
-def test_socket_abort(self):
+pjlink = self.pjlink
+
+# WHEN: process_command is called with "ERR2" status from projector
+process_command(projector=pjlink, cmd='POWR', data='ERR2')
+
+# THEN: change_status should have called change_status with E_UNDEFINED
+#   as first parameter
+mock_changeStatus.called_with(E_PARAMETER,
+  'change_status should have been called '
+  'with "{}"'.format(STATUS_CODE[E_PARAMETER]))
+
+@patch.object(openlp.core.projectors.pjlink.PJLink, 'disconnect_from_host')
+def test_socket_abort(self, mock_disconnect):
 """
 Test PJLink.socket_abort calls disconnect_from_host
 """
 # GIVEN: Test object
-with patch('openlp.core.projectors.pjlink.PJLink.disconnect_from_host') as mock_disconnect:
-  

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-v1 into lp:openlp

2019-04-20 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/pjlink2-v1 into lp:openlp has been 
updated.

Description changed to:

NOTE: Part 1 of a multi-part merge. Rest of pjlink2-v[2..n]
  merges are to fix tests

- Move projectors.pjlink.PJLinkCommand class/methods to
  separate projectors.pjlinkcommands module/functions to
  simplify PJLinkUDP commands processing.

- Mark projector tests that involve command processing as
  "skip('Needs update to new setup')" while fixing tests.
NOTE: projector controller tested live and works - some unit tests
  are skipped at this time until fixed.

NOTE: Jenkins tests passed except MacOS (offline)
  no cli output from MacOS+ tests

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-v1/+merge/366334
-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2-v1 into 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-v1 into lp:openlp

2019-04-20 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-v1 into 
lp:openlp.

Commit message:
PJLink2 Update V1

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-v1/+merge/366334

NOTE: Part 1 of a multi-part merge. Rest of pjlink2-v[2..n]
  merges are to fix tests

- Move projectors.pjlink.PJLinkCommand class/methods to
  separate projectors.pjlinkcommands module/functions to simplify PJLinkUDP
  commands processing.

- Mark projector tests that involve command processing as
  "skip('Needs update to new setup')" while fixing tests.
NOTE: projector controller tested live and works - some unit tests
  are skipped at this time until fixed.

NOTE: Jenkins tests passed except MacOS (offline) no cli output from MacOS+ 
tests
-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2-v1 into lp:openlp.
=== modified file 'openlp/core/projectors/editform.py'
--- openlp/core/projectors/editform.py	2019-02-14 15:09:09 +
+++ openlp/core/projectors/editform.py	2019-04-21 01:35:00 +
@@ -37,6 +37,8 @@
 log = logging.getLogger(__name__)
 log.debug('editform loaded')
 
+# TODO: Fix db entries for input source(s)
+
 
 class Ui_ProjectorEditForm(object):
 """

=== modified file 'openlp/core/projectors/pjlink.py'
--- openlp/core/projectors/pjlink.py	2019-03-09 03:53:20 +
+++ openlp/core/projectors/pjlink.py	2019-04-21 01:35:00 +
@@ -47,19 +47,18 @@
 where ```` is the PJLink command being processed
 """
 import logging
-import re
 from codecs import decode
 
 from PyQt5 import QtCore, QtNetwork
 
-from openlp.core.common import qmd5_hash
 from openlp.core.common.i18n import translate
 from openlp.core.common.settings import Settings
-from openlp.core.projectors.constants import CONNECTION_ERRORS, E_AUTHENTICATION, E_CONNECTION_REFUSED, E_GENERAL, \
-E_NETWORK, E_NOT_CONNECTED, E_SOCKET_TIMEOUT, PJLINK_CLASS, PJLINK_DEFAULT_CODES, PJLINK_ERRORS, PJLINK_ERST_DATA, \
-PJLINK_ERST_STATUS, PJLINK_MAX_PACKET, PJLINK_PORT, PJLINK_POWR_STATUS, PJLINK_PREFIX, PJLINK_SUFFIX, \
+from openlp.core.projectors.pjlinkcommands import process_command
+from openlp.core.projectors.constants import CONNECTION_ERRORS, E_CONNECTION_REFUSED, E_GENERAL, \
+E_NETWORK, E_NOT_CONNECTED, E_SOCKET_TIMEOUT, PJLINK_CLASS, \
+PJLINK_MAX_PACKET, PJLINK_PORT, PJLINK_PREFIX, PJLINK_SUFFIX, \
 PJLINK_VALID_CMD, PROJECTOR_STATE, QSOCKET_STATE, S_CONNECTED, S_CONNECTING, S_NOT_CONNECTED, S_OFF, S_OK, S_ON, \
-S_STANDBY, STATUS_CODE, STATUS_MSG
+STATUS_CODE, STATUS_MSG
 
 
 log = logging.getLogger(__name__)
@@ -183,544 +182,7 @@
 self.udp_stop()
 
 
-class PJLinkCommands(object):
-"""
-Process replies from PJLink projector.
-"""
-# List of IP addresses and mac addresses found via UDP search command
-ackn_list = []
-
-def __init__(self, *args, **kwargs):
-"""
-Setup for the process commands
-"""
-log.debug('PJlinkCommands(args={args} kwargs={kwargs})'.format(args=args, kwargs=kwargs))
-super().__init__()
-# Map PJLink command to method and include pjlink class version for this instance
-# Default initial pjlink class version is '1'
-self.pjlink_functions = {
-'ACKN': {"method": self.process_ackn,  # Class 2 (command is SRCH)
- "version": "2"},
-'AVMT': {"method": self.process_avmt,
- "version": "1"},
-'CLSS': {"method": self.process_clss,
- "version": "1"},
-'ERST': {"method": self.process_erst,
- "version": "1"},
-'INFO': {"method": self.process_info,
- "version": "1"},
-'INF1': {"method": self.process_inf1,
- "version": "1"},
-'INF2': {"method": self.process_inf2,
- "version": "1"},
-'INPT': {"method": self.process_inpt,
- "version": "1"},
-'INST': {"method": self.process_inst,
- "version": "1"},
-'LAMP': {"method": self.process_lamp,
- "version": "1"},
-'LKUP': {"method": self.process_lkup,  # Class 2  (reply only - no cmd)
- "version": "2"},
-'NAME': {"method": self.process_name,
- "version": "1"},
-'PJLINK': {"method"

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-v1 into lp:openlp

2019-04-20 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/pjlink2-v1 into lp:openlp has been 
updated.

Description changed to:

NOTE: Part 1 of a multi-part merge. Rest of pjlink2-v[2..n]
  merges are to fix tests

- Move projectors.pjlink.PJLinkCommand class/methods to
  separate projectors.pjlinkcommands module/functions to simplify PJLinkUDP
  commands processing.

- Mark projector tests that involve command processing as
  "skip('Needs update to new setup')" while fixing tests.
NOTE: projector controller tested live and works - some unit tests
  are skipped at this time until fixed.

NOTE: Jenkins tests passed except MacOS (offline) no cli output from MacOS+ 
tests

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-v1/+merge/366334
-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2-v1 into 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-u into lp:openlp

2019-03-08 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-u into lp:openlp.

Commit message:
PJLink2 Update U

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-u/+merge/364200

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/connecting 
projector
- 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
- Minor cleanups


lp:~alisonken1/openlp/pjlink2-u (revision 2850)
https://ci.openlp.io/job/Branch-01-Pull/2702/  [SUCCESS]
https://ci.openlp.io/job/Branch-02a-Linux-Tests/2596/  [SUCCESS]
https://ci.openlp.io/job/Branch-02b-macOS-Tests/366/   [FAILURE]
https://ci.openlp.io/job/Branch-03a-Build-Source/195/  [SUCCESS]
https://ci.openlp.io/job/Branch-03b-Build-macOS/174/   [FAILURE]
https://ci.openlp.io/job/Branch-04a-Code-Lint/1657/[SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test-Coverage/1470/[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/357/ [SUCCESS]

-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2-u into lp:openlp.
=== modified file 'openlp/core/projectors/db.py'
--- openlp/core/projectors/db.py	2019-02-14 15:09:09 +
+++ openlp/core/projectors/db.py	2019-03-09 04:02:45 +
@@ -417,11 +417,17 @@
   value: (str) From ProjectorSource, Sources tables or PJLink default code list
 """
 source_dict = {}
+# Apparently, there was a change to the projector object. Test for which object has db id
+if hasattr(projector, "id"):
+chk = projector.id
+elif hasattr(projector.entry, "id"):
+chk = projector.entry.id
+
 # Get default list first
 for key in projector.source_available:
 item = self.get_object_filtered(ProjectorSource,
 and_(ProjectorSource.code == key,
- ProjectorSource.projector_id == projector.id))
+ ProjectorSource.projector_id == chk))
 if item is None:
 source_dict[key] = PJLINK_DEFAULT_CODES[key]
 else:

=== modified file 'openlp/core/projectors/manager.py'
--- openlp/core/projectors/manager.py	2019-02-14 15:09:09 +
+++ openlp/core/projectors/manager.py	2019-03-09 04:02:45 +
@@ -46,31 +46,10 @@
 from openlp.core.ui.icons import UiIcons
 from openlp.core.widgets.toolbar import OpenLPToolbar
 
-
 log = logging.getLogger(__name__)
 log.debug('projectormanager loaded')
 
 
-# Dict for matching projector status to display icon
-STATUS_ICONS = {
-S_NOT_CONNECTED: ':/projector/projector_item_disconnect.png',
-S_CONNECTING: ':/projector/projector_item_connect.png',
-S_CONNECTED: ':/projector/projector_off.png',
-S_OFF: ':/projector/projector_off.png',
-S_INITIALIZE: ':/projector/projector_off.png',
-S_STANDBY: ':/projector/projector_off.png',
-S_WARMUP: ':/projector/projector_warmup.png',
-S_ON: ':/projector/projector_on.png',
-S_COOLDOWN: ':/projector/projector_cooldown.png',
-E_ERROR: ':/projector/projector_error.png',
-E_NETWORK: ':/projector/projector_not_connected_error.png',
-E_SOCKET_TIMEOUT: ':/projector/projector_not_connected_error.png',
-E_AUTHENTICATION: ':/projector/projector_not_connected_error.png',
-E_UNKNOWN_SOCKET_ERROR: ':/projector/projector_not_connected_error.png',
-E_NOT_CONNECTED: ':/projector/projector_not_connected_error.png'
-}
-
-
 class UiProjectorManager(object):
 """
 UI part of the Projector Manager
@@ -122,7 +101,7 @@
 self.one_toolbar.add_toolbar_action('connect_projector',
 text=translate('OpenLP.ProjectorManager',
'Connect to selected projector.'),
-icon=UiIcons().projector_connect,
+icon=UiIcons().projector_select_connect,
 tooltip=translate('OpenLP.ProjectorManager',
   'Connect to selected projector.'),
   

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-u into lp:openlp

2019-03-08 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/pjlink2-u into lp:openlp has been 
updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-u/+merge/364164
-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2-u into 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-u into lp:openlp

2019-03-08 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-u into lp:openlp.

Commit message:
PJLink2 Update U

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-u/+merge/364164

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/connecting 
projector
- 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://ci.openlp.io/job/Branch-01-Pull/2699/  [SUCCESS]
https://ci.openlp.io/job/Branch-02a-Linux-Tests/2593/  [SUCCESS]
https://ci.openlp.io/job/Branch-02b-macOS-Tests/363/   [FAILURE]
https://ci.openlp.io/job/Branch-03a-Build-Source/192/  [SUCCESS]
https://ci.openlp.io/job/Branch-03b-Build-macOS/171/   [FAILURE]
https://ci.openlp.io/job/Branch-04a-Code-Lint/1654/[SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test-Coverage/1467/[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/354/ [FAILURE]


-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2-u into lp:openlp.
=== modified file 'openlp/core/projectors/db.py'
--- openlp/core/projectors/db.py	2019-02-14 15:09:09 +
+++ openlp/core/projectors/db.py	2019-03-08 15:31:44 +
@@ -417,11 +417,17 @@
   value: (str) From ProjectorSource, Sources tables or PJLink default code list
 """
 source_dict = {}
+# Apparently, there was a change to the projector object. Test for which object has db id
+if hasattr(projector, "id"):
+chk = projector.id
+elif hasattr(projector.entry, "id"):
+chk = projector.entry.id
+
 # Get default list first
 for key in projector.source_available:
 item = self.get_object_filtered(ProjectorSource,
 and_(ProjectorSource.code == key,
- ProjectorSource.projector_id == projector.id))
+ ProjectorSource.projector_id == chk))
 if item is None:
 source_dict[key] = PJLINK_DEFAULT_CODES[key]
 else:

=== modified file 'openlp/core/projectors/manager.py'
--- openlp/core/projectors/manager.py	2019-02-14 15:09:09 +
+++ openlp/core/projectors/manager.py	2019-03-08 15:31:44 +
@@ -46,31 +46,10 @@
 from openlp.core.ui.icons import UiIcons
 from openlp.core.widgets.toolbar import OpenLPToolbar
 
-
 log = logging.getLogger(__name__)
 log.debug('projectormanager loaded')
 
 
-# Dict for matching projector status to display icon
-STATUS_ICONS = {
-S_NOT_CONNECTED: ':/projector/projector_item_disconnect.png',
-S_CONNECTING: ':/projector/projector_item_connect.png',
-S_CONNECTED: ':/projector/projector_off.png',
-S_OFF: ':/projector/projector_off.png',
-S_INITIALIZE: ':/projector/projector_off.png',
-S_STANDBY: ':/projector/projector_off.png',
-S_WARMUP: ':/projector/projector_warmup.png',
-S_ON: ':/projector/projector_on.png',
-S_COOLDOWN: ':/projector/projector_cooldown.png',
-E_ERROR: ':/projector/projector_error.png',
-E_NETWORK: ':/projector/projector_not_connected_error.png',
-E_SOCKET_TIMEOUT: ':/projector/projector_not_connected_error.png',
-E_AUTHENTICATION: ':/projector/projector_not_connected_error.png',
-E_UNKNOWN_SOCKET_ERROR: ':/projector/projector_not_connected_error.png',
-E_NOT_CONNECTED: ':/projector/projector_not_connected_error.png'
-}
-
-
 class UiProjectorManager(object):
 """
 UI part of the Projector Manager
@@ -122,7 +101,7 @@
 self.one_toolbar.add_toolbar_action('connect_projector',
 text=translate('OpenLP.ProjectorManager',
'Connect to selected projector.'),
-icon=UiIcons().projector_connect,
+icon=UiIcons().projector_select_connect,
 tooltip=translate('OpenLP.ProjectorManager',
   'Connect to selected projector.'),
 

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-u into lp:openlp

2019-03-08 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/pjlink2-u into lp:openlp has been 
updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-u/+merge/364153
-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2-u into 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-u into lp:openlp

2019-03-08 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-u into lp:openlp.

Commit message:
PJLink2 Update U

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-u/+merge/364153

- 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/connecting 
projector
- Add max-line-length option for flake8 tests in setup.cfg
- Fix projector tests



lp:~alisonken1/openlp/pjlink2-u (revision 2849)
https://ci.openlp.io/job/Branch-01-Pull/2697/  [SUCCESS]
https://ci.openlp.io/job/Branch-02a-Linux-Tests/2591/  [SUCCESS]
https://ci.openlp.io/job/Branch-02b-macOS-Tests/361/   [FAILURE]
https://ci.openlp.io/job/Branch-03a-Build-Source/191/  [SUCCESS]
https://ci.openlp.io/job/Branch-03b-Build-macOS/170/   [FAILURE]
https://ci.openlp.io/job/Branch-04a-Code-Lint/1653/[SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test-Coverage/1466/[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/353/ [FAILURE]

-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2-u into lp:openlp.
=== modified file 'openlp/core/projectors/manager.py'
--- openlp/core/projectors/manager.py	2019-02-14 15:09:09 +
+++ openlp/core/projectors/manager.py	2019-03-08 12:08:48 +
@@ -46,31 +46,10 @@
 from openlp.core.ui.icons import UiIcons
 from openlp.core.widgets.toolbar import OpenLPToolbar
 
-
 log = logging.getLogger(__name__)
 log.debug('projectormanager loaded')
 
 
-# Dict for matching projector status to display icon
-STATUS_ICONS = {
-S_NOT_CONNECTED: ':/projector/projector_item_disconnect.png',
-S_CONNECTING: ':/projector/projector_item_connect.png',
-S_CONNECTED: ':/projector/projector_off.png',
-S_OFF: ':/projector/projector_off.png',
-S_INITIALIZE: ':/projector/projector_off.png',
-S_STANDBY: ':/projector/projector_off.png',
-S_WARMUP: ':/projector/projector_warmup.png',
-S_ON: ':/projector/projector_on.png',
-S_COOLDOWN: ':/projector/projector_cooldown.png',
-E_ERROR: ':/projector/projector_error.png',
-E_NETWORK: ':/projector/projector_not_connected_error.png',
-E_SOCKET_TIMEOUT: ':/projector/projector_not_connected_error.png',
-E_AUTHENTICATION: ':/projector/projector_not_connected_error.png',
-E_UNKNOWN_SOCKET_ERROR: ':/projector/projector_not_connected_error.png',
-E_NOT_CONNECTED: ':/projector/projector_not_connected_error.png'
-}
-
-
 class UiProjectorManager(object):
 """
 UI part of the Projector Manager
@@ -122,7 +101,7 @@
 self.one_toolbar.add_toolbar_action('connect_projector',
 text=translate('OpenLP.ProjectorManager',
'Connect to selected projector.'),
-icon=UiIcons().projector_connect,
+icon=UiIcons().projector_select_connect,
 tooltip=translate('OpenLP.ProjectorManager',
   'Connect to selected projector.'),
 triggers=self.on_connect_projector)
@@ -136,7 +115,7 @@
 self.one_toolbar.add_toolbar_action('disconnect_projector',
 text=translate('OpenLP.ProjectorManager',
'Disconnect from selected projectors'),
-icon=UiIcons().projector_disconnect,
+icon=UiIcons().projector_select_disconnect,
 tooltip=translate('OpenLP.ProjectorManager',
   'Disconnect from selected projector.'),
 triggers=self.on_disconnect_projector)
@@ -151,7 +130,7 @@
 self.one_toolbar.add_toolbar_action('poweron_projector',
 text=translate('OpenLP.ProjectorManager',
'Power on selected projector'),
-icon=UiIcons().projector_on,
+icon=UiIcons().projector_power_on,
 tooltip=translate('OpenLP.P

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-u into lp:openlp

2019-03-08 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/pjlink2-u into lp:openlp has been 
updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-u/+merge/364148
-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2-u into 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-u into lp:openlp

2019-03-08 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-u into lp:openlp.

Commit message:
PJLink2 Update U

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-u/+merge/364148

- 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/connecting 
projector
- Add max-line-length option for flake8 tests in setup.cfg
- Fix projector tests

-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2-u into lp:openlp.
=== modified file 'openlp/core/projectors/manager.py'
--- openlp/core/projectors/manager.py	2019-02-14 15:09:09 +
+++ openlp/core/projectors/manager.py	2019-03-08 11:21:42 +
@@ -46,31 +46,10 @@
 from openlp.core.ui.icons import UiIcons
 from openlp.core.widgets.toolbar import OpenLPToolbar
 
-
 log = logging.getLogger(__name__)
 log.debug('projectormanager loaded')
 
 
-# Dict for matching projector status to display icon
-STATUS_ICONS = {
-S_NOT_CONNECTED: ':/projector/projector_item_disconnect.png',
-S_CONNECTING: ':/projector/projector_item_connect.png',
-S_CONNECTED: ':/projector/projector_off.png',
-S_OFF: ':/projector/projector_off.png',
-S_INITIALIZE: ':/projector/projector_off.png',
-S_STANDBY: ':/projector/projector_off.png',
-S_WARMUP: ':/projector/projector_warmup.png',
-S_ON: ':/projector/projector_on.png',
-S_COOLDOWN: ':/projector/projector_cooldown.png',
-E_ERROR: ':/projector/projector_error.png',
-E_NETWORK: ':/projector/projector_not_connected_error.png',
-E_SOCKET_TIMEOUT: ':/projector/projector_not_connected_error.png',
-E_AUTHENTICATION: ':/projector/projector_not_connected_error.png',
-E_UNKNOWN_SOCKET_ERROR: ':/projector/projector_not_connected_error.png',
-E_NOT_CONNECTED: ':/projector/projector_not_connected_error.png'
-}
-
-
 class UiProjectorManager(object):
 """
 UI part of the Projector Manager
@@ -122,7 +101,7 @@
 self.one_toolbar.add_toolbar_action('connect_projector',
 text=translate('OpenLP.ProjectorManager',
'Connect to selected projector.'),
-icon=UiIcons().projector_connect,
+icon=UiIcons().projector_select_connect,
 tooltip=translate('OpenLP.ProjectorManager',
   'Connect to selected projector.'),
 triggers=self.on_connect_projector)
@@ -136,7 +115,7 @@
 self.one_toolbar.add_toolbar_action('disconnect_projector',
 text=translate('OpenLP.ProjectorManager',
'Disconnect from selected projectors'),
-icon=UiIcons().projector_disconnect,
+icon=UiIcons().projector_select_disconnect,
 tooltip=translate('OpenLP.ProjectorManager',
   'Disconnect from selected projector.'),
 triggers=self.on_disconnect_projector)
@@ -151,7 +130,7 @@
 self.one_toolbar.add_toolbar_action('poweron_projector',
 text=translate('OpenLP.ProjectorManager',
'Power on selected projector'),
-icon=UiIcons().projector_on,
+icon=UiIcons().projector_power_on,
 tooltip=translate('OpenLP.ProjectorManager',
   'Power on selected projector.'),
 triggers=self.on_poweron_projector)
@@ -164,7 +143,7 @@
 triggers=self.on_poweron_projector)
 self.one_toolbar.add_toolbar_action('poweroff_projector',
 text=translate('OpenLP.ProjectorManager', 'Standby selected projector'),
-icon=UiIcons().projector_off,
+icon=UiIcons().projector_power_off,
 tooltip=translate('OpenLP.ProjectorManager',
   'Put selected proje

Re: [Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-u into lp:openlp

2019-03-08 Thread Ken Roberts

lp:~alisonken1/openlp/pjlink2-u (revision 2849)
https://ci.openlp.io/job/Branch-01-Pull/2696/  [SUCCESS]
https://ci.openlp.io/job/Branch-02a-Linux-Tests/2590/  [SUCCESS]
https://ci.openlp.io/job/Branch-02b-macOS-Tests/360/   [FAILURE]
https://ci.openlp.io/job/Branch-03a-Build-Source/190/  [SUCCESS]
https://ci.openlp.io/job/Branch-03b-Build-macOS/169/   [FAILURE]
https://ci.openlp.io/job/Branch-04a-Code-Lint/1652/[SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test-Coverage/1465/[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/352/ [FAILURE]


-- 
https://code.launchpad.net/~alisonken1/openlp/pjlink2-u/+merge/364148
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2-u into 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-t into lp:openlp

2018-10-19 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-t into lp:openlp.

Commit message:
PJLink2 Update T


lp:~alisonken1/openlp/pjlink2-t (revision 2835)
https://ci.openlp.io/job/Branch-01-Pull/2587/  [SUCCESS]
https://ci.openlp.io/job/Branch-02a-Linux-Tests/2485/  [SUCCESS]
https://ci.openlp.io/job/Branch-02b-macOS-Tests/263/   [SUCCESS]
https://ci.openlp.io/job/Branch-03a-Build-Source/168/  [SUCCESS]
https://ci.openlp.io/job/Branch-03b-Build-macOS/147/   [FAILURE]
https://ci.openlp.io/job/Branch-04a-Code-Analysis/1630/[SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test-Coverage/1443/[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/340/ [FAILURE]


Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-t/+merge/357428

- Move tests/functional/openlp_core/common/test_networkinterfaces.py to 
tests/openlp_core/common
- Minor cleanups in openlp.core.common.__init__.get_local_ip4()
- Add more get_local_ip4 tests
- Fix some oops in ProjectorManager when add/edit projector entry
- Update tests/openlp_core/projectors/test_projector_pjlink_udp.py with correct 
log entries
- Add tests to tests/openlp/core/projectors/test_projector_pjlink_udp
- Add UDP 'projector/udp broadcast listen' status in Settings() (default=False)
- Add UDP broadcast listen option in projector settings tab
- pep8 cleanup in tests/functional/openlp_core/common/test_i18n.py
- pep8 cleanup in openlp/core/lib/__init__.py
- Add check_settings(), udp_start(), and udp_stop() methods in PJLinkUDP
- Add add_udp_listener(), remove_udp_listener(), call_udp_listener() methods to 
projector settings tab

-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2-t into lp:openlp.
=== modified file 'openlp/core/common/__init__.py'
--- openlp/core/common/__init__.py	2018-08-03 22:32:32 +
+++ openlp/core/common/__init__.py	2018-10-20 04:41:58 +
@@ -60,7 +60,6 @@
 
 :returns: Dict of interfaces
 """
-# Get the local IPv4 active address(es) that are NOT localhost (lo or '127.0.0.1')
 log.debug('Getting local IPv4 interface(es) information')
 my_ip4 = {}
 for iface in QNetworkInterface.allInterfaces():
@@ -70,8 +69,6 @@
 log.debug('Checking address(es) protocol')
 for address in iface.addressEntries():
 ip = address.ip()
-# NOTE: Next line will skip if interface is localhost - keep for now until we decide about it later
-# if (ip.protocol() == QAbstractSocket.IPv4Protocol) and (ip != QHostAddress.LocalHost):
 log.debug('Checking for protocol == IPv4Protocol')
 if ip.protocol() == QAbstractSocket.IPv4Protocol:
 log.debug('Getting interface information')
@@ -83,12 +80,13 @@
  ip.toIPv4Address()).toString()
 }
 log.debug('Adding {iface} to active list'.format(iface=iface.name()))
+if len(my_ip4) == 0:
+log.warning('No active IPv4 network interfaces detected')
+return my_ip4
 if 'localhost' in my_ip4:
 log.debug('Renaming windows localhost to lo')
 my_ip4['lo'] = my_ip4['localhost']
 my_ip4.pop('localhost')
-if len(my_ip4) == 0:
-log.warning('No active IPv4 network interfaces detected')
 if len(my_ip4) == 1:
 if 'lo' in my_ip4:
 # No active interfaces - so leave localhost in there

=== modified file 'openlp/core/common/settings.py'
--- openlp/core/common/settings.py	2018-06-07 17:44:35 +
+++ openlp/core/common/settings.py	2018-10-20 04:41:58 +
@@ -217,7 +217,8 @@
 'projector/last directory export': None,
 'projector/poll time': 20,  # PJLink  timeout is 30 seconds
 'projector/socket timeout': 5,  # 5 second socket timeout
-'projector/source dialog type': 0  # Source select dialog box type
+'projector/source dialog type': 0,  # Source select dialog box type
+'projector/udp broadcast listen': False  # Enable/disable listening for PJLink 2 UDP broadcast packets
 }
 __file_path__ = ''
 # Settings upgrades prior to 3.0

=== modified file 'openlp/core/projectors/editform.py'
--- openlp/core/projectors/editform.py	2018-04-21 19:57:51 +
+++ openlp/core/projectors/editform.py	2018-10-20 04:41:58 +
@@ -179,6 +179,7 @@
 Validate input before accepting input.
 """
 log.debug('accept_me() signal received')
+valid = True
 if len(self.name_text.text().strip()) < 1:
 QtWidgets.QMessageBox.warning(self,
   transl

Re: [Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-t into lp:openlp

2018-10-13 Thread Ken Roberts
I spent some time trying to work with signals, but since signals have to be 
bound to be used, trying to get a signal connected from the projector code to 
the settings tab instance was convoluted and not as clean as the registry.

The other consideration is how often will projector instances be added/deleted 
once the system is set up and running. The only case where I could think of 
might be a portable setting but once set up should not be changing during 
service. For normal use at a church, I haven't made any changes to projector 
manager since hardware typically does not change unless building gets a 
hardware makeover.

Any suggestions would be appreciated.
-- 
https://code.launchpad.net/~alisonken1/openlp/pjlink2-t/+merge/356677
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-t into lp:openlp

2018-10-13 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-t into lp:openlp.

Commit message:
PJLink2-T Update (UDP updates and some cleanups)

Having network issues - ci failed when running ci but passed when looked at 
branch webpage:

lp:~alisonken1/openlp/pjlink2-t (revision 2834)
https://ci.openlp.io/job/Branch-01-Pull/2578/  [SUCCESS]
https://ci.openlp.io/job/Branch-02a-Linux-Tests/2475/  
[WAITING]Traceback (most recent call last):
...
Exception: Build has not started yet, it may be stuck in the queue
===

Jenkins branch webpage:
---
Success Branch-01-Pull (#2578)
Success Branch-02a-Linux-Tests (#2475)
Failed  Branch-02b-macOS-Tests (#249)
Success Branch-03a-Build-Source (#162)
Success Branch-03b-Build-macOS (#141)
Success Branch-04a-Code-Analysis (#1624)
Success Branch-04b-Test-Coverage (#1437)
Success Branch-04c-Lint-Check (#567)
Failed  Branch-05-AppVeyor-Tests (#336)
Failed  Branch-06-Build_API_Docs (#486)


Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-t/+merge/356677

- Move tests/functional/openlp_core/common/test_networkinterfaces.py to 
tests/openlp_core/common
- Minor cleanups in openlp.core.common.__init__.get_local_ip4()
- Add more get_local_ip4 tests
- Fix some oops in ProjectorManager when add/edit projector entry
- Update tests/openlp_core/projectors/test_projector_pjlink_udp.py with correct 
log entries
- Add UDP 'projector/udp broadcast listen' status in Settings() (default=False)
- Add UDP broadcast listen option in projector settings tab
- Add check_settings(), udp_start(), and udp_stop(), udp_add(), udp_delete() 
methods in PJLinkUDP
- Add Registry().register_function('udp_broadcast_listen') call for UDP 
settings update
- Add udp_listen_add(), udp_listen_delete() methods to ProjectorManager
- pep8 cleanup in tests/functional/openlp_core/common/test_i18n.py
- pep8 cleanup in openlp/core/lib/__init__.py

-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2-t into lp:openlp.
=== modified file 'openlp/core/common/__init__.py'
--- openlp/core/common/__init__.py	2018-08-03 22:32:32 +
+++ openlp/core/common/__init__.py	2018-10-13 12:21:32 +
@@ -60,7 +60,6 @@
 
 :returns: Dict of interfaces
 """
-# Get the local IPv4 active address(es) that are NOT localhost (lo or '127.0.0.1')
 log.debug('Getting local IPv4 interface(es) information')
 my_ip4 = {}
 for iface in QNetworkInterface.allInterfaces():
@@ -70,8 +69,6 @@
 log.debug('Checking address(es) protocol')
 for address in iface.addressEntries():
 ip = address.ip()
-# NOTE: Next line will skip if interface is localhost - keep for now until we decide about it later
-# if (ip.protocol() == QAbstractSocket.IPv4Protocol) and (ip != QHostAddress.LocalHost):
 log.debug('Checking for protocol == IPv4Protocol')
 if ip.protocol() == QAbstractSocket.IPv4Protocol:
 log.debug('Getting interface information')
@@ -83,12 +80,13 @@
  ip.toIPv4Address()).toString()
 }
 log.debug('Adding {iface} to active list'.format(iface=iface.name()))
+if len(my_ip4) == 0:
+log.warning('No active IPv4 network interfaces detected')
+return my_ip4
 if 'localhost' in my_ip4:
 log.debug('Renaming windows localhost to lo')
 my_ip4['lo'] = my_ip4['localhost']
 my_ip4.pop('localhost')
-if len(my_ip4) == 0:
-log.warning('No active IPv4 network interfaces detected')
 if len(my_ip4) == 1:
 if 'lo' in my_ip4:
 # No active interfaces - so leave localhost in there

=== modified file 'openlp/core/common/settings.py'
--- openlp/core/common/settings.py	2018-06-07 17:44:35 +
+++ openlp/core/common/settings.py	2018-10-13 12:21:32 +
@@ -217,7 +217,8 @@
 'projector/last directory export': None,
 'projector/poll time': 20,  # PJLink  timeout is 30 seconds
 'projector/socket timeout': 5,  # 5 second socket timeout
-'projector/source dialog type': 0  # Source select dialog box type
+'projector/source dialog type': 0,  # Source select dialog box type
+'projector/udp broadcast listen': False  # Enable/disable listening for PJLink 2 UDP broadcast packets
 }
 __file_path__ = ''
 # Settings upgrades prior to 3.0

=== modified file 'openlp/core/lib/__init__.py'
--- openlp/core/lib/__init__.py	2018-08-25 14:08:19 +
+++ openlp/core/lib/__init__.py	2018-10-13 12:21:32 +
@

[Openlp-core] [Bug 1796506] Re: Making listening network connections opt-in

2018-10-10 Thread Ken Roberts
Speaking only about the projector -

The reason 2.4 did not open a socket and listen for projectors is
because PJLink did not have an option to broadcast projector status
packets - by design, PJLink version 1 would only talk to controllers
that had opened a TCP connection directly to the projector. Unsolicited
selected status changes in the projector sending UDP packets to the
controller were only added in PJLink version 2 (which came out after
OpenLP had frozen 2.4.6 as the last 2.4 series)

I understand and agree with your assessment of the projector listening
for projectors - there would be no sense in listening on localhost for
the projector code since your computer is typically not a projector -
unless you're using a local emulator to test functionality.

I will add an enable/disable option in the projector settings.

-- 
You received this bug notification because you are a member of OpenLP
Core, which is subscribed to OpenLP.
https://bugs.launchpad.net/bugs/1796506

Title:
  Making listening network connections opt-in

Status in OpenLP:
  New

Bug description:
  On trunk OpenLP establishes listening network sockets for the
  projector component, the web remote control, and the websockets API. I
  cannot disable any of them. In version 2.4.6 there are no listening
  connections if you do not explicitly enable the remote control.

  The user should be able to disable the connections and they should be
  disabled by default (opt-in). If you do not want to disable by
  default, the default listening IP should at least not be the world
  (0.0.0.0) but localhost (127.0.0.1).

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1796506/+subscriptions

___
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-t into lp:openlp

2018-08-22 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-t into lp:openlp.

Commit message:
PJLink Update T

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-t/+merge/353593

- Move tests/functional/openlp_core/common/test_networkinterfaces.py to 
tests/openlp_core/common
- Minor cleanups in openlp.core.common.__init__.get_local_ip4()
- Add more get_local_ip4 tests
- Add missing __init__.py files in projector test directories


lp:~alisonken1/openlp/pjlink2-t (revision 2829)
https://ci.openlp.io/job/Branch-01-Pull/2568/  [SUCCESS]
https://ci.openlp.io/job/Branch-02a-Linux-Tests/2466/  [SUCCESS]
https://ci.openlp.io/job/Branch-02b-macOS-Tests/247/   [FAILURE]
https://ci.openlp.io/job/Branch-03a-Build-Source/154/  [SUCCESS]
https://ci.openlp.io/job/Branch-03b-Build-macOS/139/   [SUCCESS]
https://ci.openlp.io/job/Branch-04a-Code-Analysis/1616/[SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test-Coverage/1429/[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/333/ [FAILURE]


-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2-t into lp:openlp.
=== modified file 'openlp/core/common/__init__.py'
--- openlp/core/common/__init__.py	2018-08-03 22:32:32 +
+++ openlp/core/common/__init__.py	2018-08-22 18:09:46 +
@@ -60,7 +60,6 @@
 
 :returns: Dict of interfaces
 """
-# Get the local IPv4 active address(es) that are NOT localhost (lo or '127.0.0.1')
 log.debug('Getting local IPv4 interface(es) information')
 my_ip4 = {}
 for iface in QNetworkInterface.allInterfaces():
@@ -70,8 +69,6 @@
 log.debug('Checking address(es) protocol')
 for address in iface.addressEntries():
 ip = address.ip()
-# NOTE: Next line will skip if interface is localhost - keep for now until we decide about it later
-# if (ip.protocol() == QAbstractSocket.IPv4Protocol) and (ip != QHostAddress.LocalHost):
 log.debug('Checking for protocol == IPv4Protocol')
 if ip.protocol() == QAbstractSocket.IPv4Protocol:
 log.debug('Getting interface information')
@@ -83,12 +80,13 @@
  ip.toIPv4Address()).toString()
 }
 log.debug('Adding {iface} to active list'.format(iface=iface.name()))
+if len(my_ip4) == 0:
+log.warning('No active IPv4 network interfaces detected')
+return my_ip4
 if 'localhost' in my_ip4:
 log.debug('Renaming windows localhost to lo')
 my_ip4['lo'] = my_ip4['localhost']
 my_ip4.pop('localhost')
-if len(my_ip4) == 0:
-log.warning('No active IPv4 network interfaces detected')
 if len(my_ip4) == 1:
 if 'lo' in my_ip4:
 # No active interfaces - so leave localhost in there

=== added directory 'tests/openlp_core/common'
=== added file 'tests/openlp_core/common/__init__.py'
--- tests/openlp_core/common/__init__.py	1970-01-01 00:00:00 +
+++ tests/openlp_core/common/__init__.py	2018-08-22 18:09:46 +
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
+
+###
+# OpenLP - Open Source Lyrics Projection  #
+# --- #
+# Copyright (c) 2008-2018 OpenLP Developers   #
+# --- #
+# This program is free software; you can redistribute it and/or modify it #
+# under the terms of the GNU General Public License as published by the Free  #
+# Software Foundation; version 2 of the License.  #
+# #
+# This program is distributed in the hope that it will be useful, but WITHOUT #
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or   #
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for#
+# more details.   #
+# #
+# You should have received a copy of the GNU General Public License along #
+# with this program; if not, write to the Free Software Foundation, Inc., 59  #
+# Temple Place, Suite 330, Boston, MA 02111-1307 USA  #
+###
+

[Openlp-core] [Merge] lp:~alisonken1/openlp/windows_lo_fix into lp:openlp

2018-08-03 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/windows_lo_fix into 
lp:openlp.

Commit message:
Fix windows not naming localhost interface to lo


Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/windows_lo_fix/+merge/352333

- Rename localhost to lo if found in iterfaces
- Add check for lo not in interface list before trying to remove lo
- Add extra log debug info
- Add test to check for get_local_ip4() returning no interfaces


lp:~alisonken1/openlp/windows_lo_fix (revision 2825)
https://ci.openlp.io/job/Branch-01-Pull/2562/  [SUCCESS]
https://ci.openlp.io/job/Branch-02a-Linux-Tests/2460/  [SUCCESS]
https://ci.openlp.io/job/Branch-02b-macOS-Tests/242/   [SUCCESS]
https://ci.openlp.io/job/Branch-03a-Build-Source/149/  [SUCCESS]
https://ci.openlp.io/job/Branch-03b-Build-macOS/135/   [SUCCESS]
https://ci.openlp.io/job/Branch-04a-Code-Analysis/1611/[SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test-Coverage/1424/[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/330/ [FAILURE]

-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/windows_lo_fix into lp:openlp.
=== modified file 'openlp/core/common/__init__.py'
--- openlp/core/common/__init__.py	2018-04-17 19:26:18 +
+++ openlp/core/common/__init__.py	2018-08-03 22:40:28 +
@@ -64,13 +64,17 @@
 log.debug('Getting local IPv4 interface(es) information')
 my_ip4 = {}
 for iface in QNetworkInterface.allInterfaces():
+log.debug('Checking for isValid and flags == IsUP | IsRunning')
 if not iface.isValid() or not (iface.flags() & (QNetworkInterface.IsUp | QNetworkInterface.IsRunning)):
 continue
+log.debug('Checking address(es) protocol')
 for address in iface.addressEntries():
 ip = address.ip()
 # NOTE: Next line will skip if interface is localhost - keep for now until we decide about it later
 # if (ip.protocol() == QAbstractSocket.IPv4Protocol) and (ip != QHostAddress.LocalHost):
+log.debug('Checking for protocol == IPv4Protocol')
 if ip.protocol() == QAbstractSocket.IPv4Protocol:
+log.debug('Getting interface information')
 my_ip4[iface.name()] = {'ip': ip.toString(),
 'broadcast': address.broadcast().toString(),
 'netmask': address.netmask().toString(),
@@ -79,14 +83,21 @@
  ip.toIPv4Address()).toString()
 }
 log.debug('Adding {iface} to active list'.format(iface=iface.name()))
+if 'localhost' in my_ip4:
+log.debug('Renaming windows localhost to lo')
+my_ip4['lo'] = my_ip4['localhost']
+my_ip4.pop('localhost')
+if len(my_ip4) == 0:
+log.warning('No active IPv4 network interfaces detected')
 if len(my_ip4) == 1:
 if 'lo' in my_ip4:
 # No active interfaces - so leave localhost in there
 log.warning('No active IPv4 interfaces found except localhost')
 else:
 # Since we have a valid IP4 interface, remove localhost
-log.debug('Found at least one IPv4 interface, removing localhost')
-my_ip4.pop('lo')
+if 'lo' in my_ip4:
+log.debug('Found at least one IPv4 interface, removing localhost')
+my_ip4.pop('lo')
 
 return my_ip4
 

=== added file 'tests/functional/openlp_core/common/test_network_interfaces.py'
--- tests/functional/openlp_core/common/test_network_interfaces.py	1970-01-01 00:00:00 +
+++ tests/functional/openlp_core/common/test_network_interfaces.py	2018-08-03 22:40:28 +
@@ -0,0 +1,78 @@
+# -*- coding: utf-8 -*-
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
+
+###
+# OpenLP - Open Source Lyrics Projection  #
+# --- #
+# Copyright (c) 2008-2017 OpenLP Developers   #
+# --- #
+# This program is free software; you can redistribute it and/or modify it #
+# under the terms of the GNU General Public License as published by the Free  #
+# Software Foundation; version 2 of the License.  #
+# #
+# This program is distributed in the hope that it will be useful, but WITHOUT #
+# ANY WARRANTY; without even the imp

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-s into lp:openlp

2018-06-28 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-s into lp:openlp.

Commit message:
PJLink2 update S

Requested reviews:
  Tim Bentley (trb143)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-s/+merge/348709

- Convert action.remove raise ValueError on missing action to log.warning
- Added 2-second status timer to update icons during projector state change
- Update set power methods to use status timer
- Update set shutter methods to use status timer
- Fix process_avmt to include missing valid status from projector
- Update projector info menu to include version 2 information
- Add E_SOCKET_TIMEOUT to STATUS_ICONS dictionary
- Change 'Action "{action}" does not exist' from raise ValueError to log.warning
- Update projector to include PJLink2 extras
- Fix version check exception if server returns status code != 200
- Fix version tests for status code
- Fix actions tests for remove action not in list
- Fix projector tests for changed calls
- Update setup.cfg to inlude pycodestyle (pep8 deprecaded)
- PEP8 fix for scripts/lp-merge.txt
- Updated fix for version check exception


lp:~alisonken1/openlp/pjlink2-s (revision 2822)
https://ci.openlp.io/job/Branch-01-Pull/2538/  [SUCCESS]
https://ci.openlp.io/job/Branch-02a-Linux-Tests/2436/  [SUCCESS]
https://ci.openlp.io/job/Branch-02b-macOS-Tests/225/   [FAILURE]
https://ci.openlp.io/job/Branch-03a-Build-Source/127/  [SUCCESS]
https://ci.openlp.io/job/Branch-03b-Build-macOS/120/   [SUCCESS]
https://ci.openlp.io/job/Branch-04a-Code-Analysis/1589/[SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test-Coverage/1402/[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/323/ [FAILURE]

-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/common/actions.py'
--- openlp/core/common/actions.py	2017-12-29 09:15:48 +
+++ openlp/core/common/actions.py	2018-06-28 17:08:08 +
@@ -113,7 +113,7 @@
 if item[1] == action:
 self.actions.remove(item)
 return
-raise ValueError('Action "{action}" does not exist.'.format(action=action))
+log.warning('Action "{action}" does not exist.'.format(action=action))
 
 
 class CategoryList(object):

=== modified file 'openlp/core/projectors/manager.py'
--- openlp/core/projectors/manager.py	2018-05-19 00:48:33 +
+++ openlp/core/projectors/manager.py	2018-06-28 17:08:08 +
@@ -36,8 +36,8 @@
 from openlp.core.lib.ui import create_widget_action
 from openlp.core.projectors import DialogSourceStyle
 from openlp.core.projectors.constants import E_AUTHENTICATION, E_ERROR, E_NETWORK, E_NOT_CONNECTED, \
-E_UNKNOWN_SOCKET_ERROR, S_CONNECTED, S_CONNECTING, S_COOLDOWN, S_INITIALIZE, S_NOT_CONNECTED, S_OFF, S_ON, \
-S_STANDBY, S_WARMUP, PJLINK_PORT, STATUS_CODE, STATUS_MSG, QSOCKET_STATE
+E_SOCKET_TIMEOUT, E_UNKNOWN_SOCKET_ERROR, S_CONNECTED, S_CONNECTING, S_COOLDOWN, S_INITIALIZE, \
+S_NOT_CONNECTED, S_OFF, S_ON, S_STANDBY, S_WARMUP, PJLINK_PORT, STATUS_CODE, STATUS_MSG, QSOCKET_STATE
 
 from openlp.core.projectors.db import ProjectorDB
 from openlp.core.projectors.editform import ProjectorEditForm
@@ -62,6 +62,7 @@
 S_COOLDOWN: ':/projector/projector_cooldown.png',
 E_ERROR: ':/projector/projector_error.png',
 E_NETWORK: ':/projector/projector_not_connected_error.png',
+E_SOCKET_TIMEOUT: ':/projector/projector_not_connected_error.png',
 E_AUTHENTICATION: ':/projector/projector_not_connected_error.png',
 E_UNKNOWN_SOCKET_ERROR: ':/projector/projector_not_connected_error.png',
 E_NOT_CONNECTED: ':/projector/projector_not_connected_error.png'
@@ -360,22 +361,14 @@
 self.connect_action.setVisible(not visible)
 self.disconnect_action.setVisible(visible)
 self.status_action.setVisible(visible)
-if visible:
-self.select_input_action.setVisible(real_projector.link.power == S_ON)
-self.edit_input_action.setVisible(real_projector.link.power == S_ON)
-self.poweron_action.setVisible(real_projector.link.power == S_STANDBY)
-self.poweroff_action.setVisible(real_projector.link.power == S_ON)
-self.blank_action.setVisible(real_projector.link.power == S_ON and
- not real_projector.link.shutter)
-self.show_action.setVisible(real_projector.link.power == S_ON and
-real_projector.link.shutter)
-else:
-self.select_input_action.setVisible(False)
-self.edit_input_action.setVisible(False)
-self.poweron_action.setVisible(False)
-self.poweroff_action.setVisible(False)
-self

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-s into lp:openlp

2018-06-28 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/pjlink2-s into lp:openlp has been 
updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-s/+merge/348698
-- 
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-s into lp:openlp

2018-06-28 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-s into lp:openlp.

Commit message:
PJLink2 update S

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-s/+merge/348698

- Convert action.remove raise ValueError on missing action to log.warning
- Added 2-second status timer to update icons during projector state change
- Update set power methods to use status timer
- Update set shutter methods to use status timer
- Fix process_avmt to include missing valid status from projector
- Update projector info menu to include version 2 information
- Add E_SOCKET_TIMEOUT to STATUS_ICONS dictionary
- Change 'Action "{action}" does not exist' from raise ValueError to log.warning
- Update projector to include PJLink2 extras
- Fix version check exception if server returns status code != 200
- Fix version tests for status code
- Fix actions tests for remove action not in list
- Fix projector tests for changed calls
- Update setup.cfg to inlude pycodestyle (pep8 deprecaded)
- PEP8 fix for scripts/lp-merge.txt


lp:~alisonken1/openlp/pjlink2-s (revision 2821)
https://ci.openlp.io/job/Branch-01-Pull/2537/  [SUCCESS]
https://ci.openlp.io/job/Branch-02a-Linux-Tests/2435/  [SUCCESS]
https://ci.openlp.io/job/Branch-02b-macOS-Tests/224/   [FAILURE]
https://ci.openlp.io/job/Branch-03a-Build-Source/126/  [SUCCESS]
https://ci.openlp.io/job/Branch-03b-Build-macOS/119/   [SUCCESS]
https://ci.openlp.io/job/Branch-04a-Code-Analysis/1588/[SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test-Coverage/1401/[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/322/ [FAILURE]

-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2-s into lp:openlp.
=== modified file 'openlp/core/common/actions.py'
--- openlp/core/common/actions.py	2017-12-29 09:15:48 +
+++ openlp/core/common/actions.py	2018-06-28 15:48:46 +
@@ -113,7 +113,7 @@
 if item[1] == action:
 self.actions.remove(item)
 return
-raise ValueError('Action "{action}" does not exist.'.format(action=action))
+log.warning('Action "{action}" does not exist.'.format(action=action))
 
 
 class CategoryList(object):

=== modified file 'openlp/core/projectors/manager.py'
--- openlp/core/projectors/manager.py	2018-05-19 00:48:33 +
+++ openlp/core/projectors/manager.py	2018-06-28 15:48:46 +
@@ -36,8 +36,8 @@
 from openlp.core.lib.ui import create_widget_action
 from openlp.core.projectors import DialogSourceStyle
 from openlp.core.projectors.constants import E_AUTHENTICATION, E_ERROR, E_NETWORK, E_NOT_CONNECTED, \
-E_UNKNOWN_SOCKET_ERROR, S_CONNECTED, S_CONNECTING, S_COOLDOWN, S_INITIALIZE, S_NOT_CONNECTED, S_OFF, S_ON, \
-S_STANDBY, S_WARMUP, PJLINK_PORT, STATUS_CODE, STATUS_MSG, QSOCKET_STATE
+E_SOCKET_TIMEOUT, E_UNKNOWN_SOCKET_ERROR, S_CONNECTED, S_CONNECTING, S_COOLDOWN, S_INITIALIZE, \
+S_NOT_CONNECTED, S_OFF, S_ON, S_STANDBY, S_WARMUP, PJLINK_PORT, STATUS_CODE, STATUS_MSG, QSOCKET_STATE
 
 from openlp.core.projectors.db import ProjectorDB
 from openlp.core.projectors.editform import ProjectorEditForm
@@ -62,6 +62,7 @@
 S_COOLDOWN: ':/projector/projector_cooldown.png',
 E_ERROR: ':/projector/projector_error.png',
 E_NETWORK: ':/projector/projector_not_connected_error.png',
+E_SOCKET_TIMEOUT: ':/projector/projector_not_connected_error.png',
 E_AUTHENTICATION: ':/projector/projector_not_connected_error.png',
 E_UNKNOWN_SOCKET_ERROR: ':/projector/projector_not_connected_error.png',
 E_NOT_CONNECTED: ':/projector/projector_not_connected_error.png'
@@ -360,22 +361,14 @@
 self.connect_action.setVisible(not visible)
 self.disconnect_action.setVisible(visible)
 self.status_action.setVisible(visible)
-if visible:
-self.select_input_action.setVisible(real_projector.link.power == S_ON)
-self.edit_input_action.setVisible(real_projector.link.power == S_ON)
-self.poweron_action.setVisible(real_projector.link.power == S_STANDBY)
-self.poweroff_action.setVisible(real_projector.link.power == S_ON)
-self.blank_action.setVisible(real_projector.link.power == S_ON and
- not real_projector.link.shutter)
-self.show_action.setVisible(real_projector.link.power == S_ON and
-real_projector.link.shutter)
-else:
-self.select_input_action.setVisible(False)
-self.edit_input_action.setVisible(False)
-self.poweron_action.setVisible(False)
-self.poweroff_action.setVisible(False)
-self

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-r into lp:openlp

2018-05-18 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-r into lp:openlp.

Commit message:
PJLink2 update R

Requested reviews:
  Tim Bentley (trb143)
  Phill (phill-ridout)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-r/+merge/345965

- Convert UDP packet to send pyqtSignal and let individual projectors decide 
who it's for
- Remove unneccessary *args **kwargs from commands
- Remove projector_list  and projector block search since switching to signals
- pass on ACKN, and SRCH commands until I think about it some more
- Cleanup extraneous args on process_* commands since switching to signals
- Add UDP socket listener(s) for PJLink2 UDP options
- Added process_lkup method code
- Add projector configure option to connect when LKUP packet received
- Fix _send_queue to ignore call if no data to send
- Rename tests/openlp_core/projectors/test_projector_pjlink_base.py to 
test_projector_pjlink_base_01.py
- Added tests/openlp_core/projectors/test_projector_pjlink_base_02.py
- Added test for PJLink._send_command
- Removed unused test_projector_pjlink_base_02.pjlink_test from module
- Cleanup tests/openlp_core/projectors/test_projector_pjlink_base_01 imports
- Fix test_projector_pjlink_cmd_routing.test_get_data_unknown_command
- Fix invalid delete projector signal disconnect call in manager
- Move try block under if block when disconnecting signal from deleted 
projector in manager
- Minor cleanups
- Fix settings calls



lp:~alisonken1/openlp/pjlink2-r (revision 2820)
https://ci.openlp.io/job/Branch-01-Pull/2515/  [SUCCESS]
https://ci.openlp.io/job/Branch-02a-Linux-Tests/2416/  [SUCCESS]
https://ci.openlp.io/job/Branch-02b-macOS-Tests/202/   [FAILURE]
https://ci.openlp.io/job/Branch-03a-Build-Source/112/  [SUCCESS]
https://ci.openlp.io/job/Branch-03b-Build-macOS/105/   [SUCCESS]
https://ci.openlp.io/job/Branch-04a-Code-Analysis/1574/[SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test-Coverage/1387/[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/315/ [FAILURE]

-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/common/settings.py'
--- openlp/core/common/settings.py	2018-02-02 21:33:41 +
+++ openlp/core/common/settings.py	2018-05-19 00:59:00 +
@@ -199,6 +199,7 @@
 'projector/db database': '',
 'projector/enable': True,
 'projector/connect on start': False,
+'projector/connect when LKUP received': True,  # PJLink v2: Projector sends LKUP command after it powers up
 'projector/last directory import': None,
 'projector/last directory export': None,
 'projector/poll time': 20,  # PJLink  timeout is 30 seconds

=== modified file 'openlp/core/projectors/manager.py'
--- openlp/core/projectors/manager.py	2018-04-20 06:04:43 +
+++ openlp/core/projectors/manager.py	2018-05-19 00:59:00 +
@@ -37,7 +37,7 @@
 from openlp.core.projectors import DialogSourceStyle
 from openlp.core.projectors.constants import E_AUTHENTICATION, E_ERROR, E_NETWORK, E_NOT_CONNECTED, \
 E_UNKNOWN_SOCKET_ERROR, S_CONNECTED, S_CONNECTING, S_COOLDOWN, S_INITIALIZE, S_NOT_CONNECTED, S_OFF, S_ON, \
-S_STANDBY, S_WARMUP, STATUS_CODE, STATUS_MSG, QSOCKET_STATE
+S_STANDBY, S_WARMUP, PJLINK_PORT, STATUS_CODE, STATUS_MSG, QSOCKET_STATE
 
 from openlp.core.projectors.db import ProjectorDB
 from openlp.core.projectors.editform import ProjectorEditForm
@@ -294,6 +294,9 @@
 self.projectordb = projectordb
 self.projector_list = []
 self.source_select_form = None
+# Dictionary of PJLinkUDP objects to listen for UDP broadcasts from PJLink 2+ projectors.
+# Key is port number that projectors use
+self.pjlink_udp = {}
 
 def bootstrap_initialise(self):
 """
@@ -307,12 +310,15 @@
 else:
 log.debug('Using existing ProjectorDB() instance')
 self.get_settings()
-self.pjlink_udp = PJLinkUDP(self.projector_list)
 
 def bootstrap_post_set_up(self):
 """
 Post-initialize setups.
 """
+# Default PJLink port UDP socket
+log.debug('Creating PJLinkUDP listener for default port {port}'.format(port=PJLINK_PORT))
+self.pjlink_udp = {PJLINK_PORT: PJLinkUDP(port=PJLINK_PORT)}
+self.pjlink_udp[PJLINK_PORT].bind(PJLINK_PORT)
 # Set 1.5 second delay before loading all projectors
 if self.autostart:
 log.debug('Delaying 1.5 seconds before loading all projectors')
@@ -330,14 +336,10 @@
 Retrieve the saved settings
 """
 log.debug('Updating ProjectorManager settings')
-settings = Settings()
-settings.beginGroup(self.setting

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-r into lp:openlp

2018-05-18 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/pjlink2-r into lp:openlp has been 
updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-r/+merge/345041
-- 
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-r into lp:openlp

2018-05-03 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-r into lp:openlp.

Commit message:
PJLink2 update R

Requested reviews:
  Phill (phill-ridout)
  Tim Bentley (trb143)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-r/+merge/345041

- Convert UDP packet to send pyqtSignal and let individual projectors decide 
who it's for
- Remove unneccessary *args **kwargs from commands
- Remove projector_list  and projector block search since switching to signals
- pass on ACKN, and SRCH commands until I think about it some more
- Cleanup extraneous args on process_* commands since switching to signals
- Add UDP socket listener(s) for PJLink2 UDP options
- Added process_lkup method code
- Add projector configure option to connect when LKUP packet received
- Fix _send_queue to ignore call if no data to send
- Rename tests/openlp_core/projectors/test_projector_pjlink_base.py to 
test_projector_pjlink_base_01.py
- Added tests/openlp_core/projectors/test_projector_pjlink_base_02.py
- Added test for PJLink._send_command
- Removed unused test_projector_pjlink_base_02.pjlink_test from module
- Cleanup tests/openlp_core/projectors/test_projector_pjlink_base_01 imports
- Fix test_projector_pjlink_cmd_routing.test_get_data_unknown_command
- Fix invalid delete projector signal disconnect call in manager
- Move try block under if block when disconnecting signal from deleted 
projector in manager
- Minor cleanups



lp:~alisonken1/openlp/pjlink2-r (revision 2819)
https://ci.openlp.io/job/Branch-01-Pull/2514/  [SUCCESS]
https://ci.openlp.io/job/Branch-02a-Linux-Tests/2415/  [SUCCESS]
https://ci.openlp.io/job/Branch-02b-macOS-Tests/201/   [FAILURE]
https://ci.openlp.io/job/Branch-03a-Build-Source/111/  [SUCCESS]
https://ci.openlp.io/job/Branch-03b-Build-macOS/104/   [SUCCESS]
https://ci.openlp.io/job/Branch-04a-Code-Analysis/1573/[SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test-Coverage/1386/[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/314/ [FAILURE]

-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/common/settings.py'
--- openlp/core/common/settings.py	2018-02-02 21:33:41 +
+++ openlp/core/common/settings.py	2018-05-03 15:10:54 +
@@ -199,6 +199,7 @@
 'projector/db database': '',
 'projector/enable': True,
 'projector/connect on start': False,
+'projector/connect when LKUP received': True,  # PJLink v2: Projector sends LKUP command after it powers up
 'projector/last directory import': None,
 'projector/last directory export': None,
 'projector/poll time': 20,  # PJLink  timeout is 30 seconds

=== modified file 'openlp/core/projectors/manager.py'
--- openlp/core/projectors/manager.py	2018-04-20 06:04:43 +
+++ openlp/core/projectors/manager.py	2018-05-03 15:10:54 +
@@ -37,7 +37,7 @@
 from openlp.core.projectors import DialogSourceStyle
 from openlp.core.projectors.constants import E_AUTHENTICATION, E_ERROR, E_NETWORK, E_NOT_CONNECTED, \
 E_UNKNOWN_SOCKET_ERROR, S_CONNECTED, S_CONNECTING, S_COOLDOWN, S_INITIALIZE, S_NOT_CONNECTED, S_OFF, S_ON, \
-S_STANDBY, S_WARMUP, STATUS_CODE, STATUS_MSG, QSOCKET_STATE
+S_STANDBY, S_WARMUP, PJLINK_PORT, STATUS_CODE, STATUS_MSG, QSOCKET_STATE
 
 from openlp.core.projectors.db import ProjectorDB
 from openlp.core.projectors.editform import ProjectorEditForm
@@ -294,6 +294,9 @@
 self.projectordb = projectordb
 self.projector_list = []
 self.source_select_form = None
+# Dictionary of PJLinkUDP objects to listen for UDP broadcasts from PJLink 2+ projectors.
+# Key is port number that projectors use
+self.pjlink_udp = {}
 
 def bootstrap_initialise(self):
 """
@@ -307,12 +310,15 @@
 else:
 log.debug('Using existing ProjectorDB() instance')
 self.get_settings()
-self.pjlink_udp = PJLinkUDP(self.projector_list)
 
 def bootstrap_post_set_up(self):
 """
 Post-initialize setups.
 """
+# Default PJLink port UDP socket
+log.debug('Creating PJLinkUDP listener for default port {port}'.format(port=PJLINK_PORT))
+self.pjlink_udp = {PJLINK_PORT: PJLinkUDP(port=PJLINK_PORT)}
+self.pjlink_udp[PJLINK_PORT].bind(PJLINK_PORT)
 # Set 1.5 second delay before loading all projectors
 if self.autostart:
 log.debug('Delaying 1.5 seconds before loading all projectors')
@@ -513,6 +519,14 @@
 projector.socket_timer.timeout.disconnect(projector.link.socket_abort)
 except (AttributeError, TypeError):
 pass
+# Disconnect signals from projector being deleted
+if self

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-r into lp:openlp

2018-05-03 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/pjlink2-r into lp:openlp has been 
updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-r/+merge/344798
-- 
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-r into lp:openlp

2018-04-28 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-r into lp:openlp.

Commit message:
PJLink2 update R

Requested reviews:
  Phill (phill-ridout)
  Tim Bentley (trb143)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-r/+merge/344798

- Convert UDP packet to send pyqtSignal and let individual projectors decide 
who it's for
- Remove unneccessary *args **kwargs from commands
- Remove projector_list  and projector block search since switching to signals
- pass on ACKN, and SRCH commands until I think about it some more
- Cleanup extraneous args on process_* commands since switching to signals
- Add UDP socket listener(s) for PJLink2 UDP options
- Added process_lkup method code
- Add projector configure option to connect when LKUP packet received
- Fix _send_queue to ignore call if no data to send
- Rename tests/openlp_core/projectors/test_projector_pjlink_base.py to 
test_projector_pjlink_base_01.py
- Added tests/openlp_core/projectors/test_projector_pjlink_base_02.py
- Added test for PJLink._send_command
- Removed unused test_projector_pjlink_base_02.pjlink_test from module
- Cleanup tests/openlp_core/projectors/test_projector_pjlink_base_01 imports
- Fix test_projector_pjlink_cmd_routing.test_get_data_unknown_command
- Fix invalid delete projector signal disconnect call in manager
- Move try block under if block when disconnecting signal from deleted 
projector in manager
- Minor cleanups


lp:~alisonken1/openlp/pjlink2-r (revision 2819)
https://ci.openlp.io/job/Branch-01-Pull/2512/  [SUCCESS]
https://ci.openlp.io/job/Branch-02a-Linux-Tests/2413/  [SUCCESS]
https://ci.openlp.io/job/Branch-02b-macOS-Tests/199/   [FAILURE]
https://ci.openlp.io/job/Branch-03a-Build-Source/109/  [SUCCESS]
https://ci.openlp.io/job/Branch-03b-Build-macOS/102/   [SUCCESS]
https://ci.openlp.io/job/Branch-04a-Code-Analysis/1571/[SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test-Coverage/1384/[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/313/ [FAILURE]
-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/common/settings.py'
--- openlp/core/common/settings.py	2018-02-02 21:33:41 +
+++ openlp/core/common/settings.py	2018-04-28 07:52:45 +
@@ -199,6 +199,7 @@
 'projector/db database': '',
 'projector/enable': True,
 'projector/connect on start': False,
+'projector/connect when LKUP received': True,  # PJLink v2: Projector sends LKUP command after it powers up
 'projector/last directory import': None,
 'projector/last directory export': None,
 'projector/poll time': 20,  # PJLink  timeout is 30 seconds

=== modified file 'openlp/core/projectors/manager.py'
--- openlp/core/projectors/manager.py	2018-04-20 06:04:43 +
+++ openlp/core/projectors/manager.py	2018-04-28 07:52:45 +
@@ -37,7 +37,7 @@
 from openlp.core.projectors import DialogSourceStyle
 from openlp.core.projectors.constants import E_AUTHENTICATION, E_ERROR, E_NETWORK, E_NOT_CONNECTED, \
 E_UNKNOWN_SOCKET_ERROR, S_CONNECTED, S_CONNECTING, S_COOLDOWN, S_INITIALIZE, S_NOT_CONNECTED, S_OFF, S_ON, \
-S_STANDBY, S_WARMUP, STATUS_CODE, STATUS_MSG, QSOCKET_STATE
+S_STANDBY, S_WARMUP, PJLINK_PORT, STATUS_CODE, STATUS_MSG, QSOCKET_STATE
 
 from openlp.core.projectors.db import ProjectorDB
 from openlp.core.projectors.editform import ProjectorEditForm
@@ -294,6 +294,9 @@
 self.projectordb = projectordb
 self.projector_list = []
 self.source_select_form = None
+# Dictionary of PJLinkUDP objects to listen for UDP broadcasts from PJLink 2+ projectors.
+# Key is port number that projectors use
+self.pjlink_udp = {}
 
 def bootstrap_initialise(self):
 """
@@ -307,12 +310,15 @@
 else:
 log.debug('Using existing ProjectorDB() instance')
 self.get_settings()
-self.pjlink_udp = PJLinkUDP(self.projector_list)
 
 def bootstrap_post_set_up(self):
 """
 Post-initialize setups.
 """
+# Default PJLink port UDP socket
+log.debug('Creating PJLinkUDP listener for default port {port}'.format(port=PJLINK_PORT))
+self.pjlink_udp = {PJLINK_PORT: PJLinkUDP(port=PJLINK_PORT)}
+self.pjlink_udp[PJLINK_PORT].bind(PJLINK_PORT)
 # Set 1.5 second delay before loading all projectors
 if self.autostart:
 log.debug('Delaying 1.5 seconds before loading all projectors')
@@ -513,6 +519,14 @@
 projector.socket_timer.timeout.disconnect(projector.link.socket_abort)
 except (AttributeError, TypeError):
 pass
+# Disconnect signals from projector being deleted
+if self

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-r into lp:openlp

2018-04-28 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/pjlink2-r into lp:openlp has been 
updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-r/+merge/344797
-- 
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-r into lp:openlp

2018-04-28 Thread Ken Roberts
On Sat, Apr 28, 2018 at 12:15 AM, Phill  wrote:
> Review: Needs Fixing
>
> Ran out of time to complete a review, but a few in lines to start.
>
> Diff comments:
>
>>
>> === modified file 'openlp/core/projectors/manager.py'
>> --- openlp/core/projectors/manager.py 2018-04-20 06:04:43 +
>> +++ openlp/core/projectors/manager.py 2018-04-28 02:41:38 +
>>  if read_size < 0:
>>  log.warning('(UDP) No data (-1)')
>>  return
>> -if read_size < 1:
>> +elif read_size < 1:
>
> given the < 0 condition above, this condition will only be True when 
> read_size == 0, which to me is a bit readable / obvious at a quick glance.

-1 indicates a socket problem - which is distinct from no data (0 or
empty packet)

>> @@ -654,10 +651,10 @@
>>  :param host: IP address of sending host
>>  :param port: Port received on
>>  """
>> -log.warning('(UDP) SRCH packet received from {host} - 
>> ignoring'.format(host=host))
>> +log.warning("({ip}) I don't do SRCH packets - 
>> ignoring".format(ip=self.ip))
>
> Why this change? the original is more understandable to me!

This method is only called from within a projector instance - not the
UDP monitor.
However, just noticed it's using the wrong option for {ip} - should be
ip=self.entry.name

>
>>  return
>>
>> -def process_sver(self, data, *args, **kwargs):
>> +def process_sver(self, data):
>>  """
>>  Software version of projector
>>  """
>> @@ -1181,7 +1187,7 @@
>>  try:
>>  self.readyRead.disconnect(self.get_socket)
>>  except TypeError:
>> -pass
>> +log.debug('({ip}) disconnect_from_host(): TypeError 
>> detected'.format(ip=self.entry.name))
>
> You're just disconnecting a slot here right? Do we need to log that?

Since this is in the projector instance, I would like to know if
there's a type issue - if so, then I would like to see it in the log.

>
>>  log.debug('({ip}) disconnect_from_host() '
>>'Current status {data}'.format(ip=self.entry.name, 
>> data=self._get_status(self.status_connect)[0]))
>>  if abort:
>
>
> --
> https://code.launchpad.net/~alisonken1/openlp/pjlink2-r/+merge/344795
> You are the owner of lp:~alisonken1/openlp/pjlink2-r.



-- 
- Ken
Registered Linux user 296561
Slackin' since 1993
Slackware Linux (http://www.slackware.com)
OpenLP - Church Projection Software
Empower Your Church http://openlp.org

On Sat, Apr 28, 2018 at 12:15 AM, Phill  wrote:
> Review: Needs Fixing
>
> Ran out of time to complete a review, but a few in lines to start.
>
> Diff comments:
>
>>
>> === modified file 'openlp/core/projectors/manager.py'
>> --- openlp/core/projectors/manager.py 2018-04-20 06:04:43 +
>> +++ openlp/core/projectors/manager.py 2018-04-28 02:41:38 +
>> @@ -513,6 +519,18 @@
>>  
>> projector.socket_timer.timeout.disconnect(projector.link.socket_abort)
>>  except (AttributeError, TypeError):
>>  pass
>> +# Disconnect signals from projector being deleted
>> +try:
>> +self.pjlink_udp.data_received.disconnect(projector.get_buffer)
>
> He's disconnecting a slot here, so TypeError is the correct exception to 
> catch. Not sure it AttributeError is needed though
>
>> +except (AttributeError, TypeError):
>> +pass
>> +try:
>> +if self.pjlink_udp[projector.port]:
>> +
>> self.pjlink_udp[projector.port].data_received.disconnect(projector.get_buffer)
>> +except (AttributeError, TypeError):
>> +pass
>> +
>> +# Rebuild projector list
>>  new_list = []
>>  for item in self.projector_list:
>>  if item.link.db_item.id == projector.link.db_item.id:
>>
>> === modified file 'openlp/core/projectors/pjlink.py'
>> --- openlp/core/projectors/pjlink.py  2018-04-20 06:04:43 +
>> +++ openlp/core/projectors/pjlink.py  2018-04-28 02:41:38 +
>> @@ -108,22 +111,20 @@
>>  if read_size < 0:
>>  log.warning('(UDP) No data (-1)')
>>  return
>> -if read_size < 1:
>> +elif read_size < 1:
>
> given the < 0 condition above, this condition will only be True when 
> read_size == 0, which to me is a bit readable / obvious at a quick glance.
>
>>  log.warning('(UDP) get_datagram() called when pending data size 
>> is 0')
>>  return
>> -data, peer_address, peer_port = 
>> self.readDatagram(self.pendingDatagramSize())
>> +elif read_size > PJLINK_MAX_PACKET:
>> +log.warning('(UDP) UDP Packet too large ({size} bytes)- 
>> ignoring'.format(size=read_size))
>> +return
>> +data_in, peer_host, peer_port = self.readDatagram(read_size)
>> +data = data_in.decode('utf-8') if isinstance(data_in, bytes) else 
>> data_in
>>  log.debug('(UDP) 

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-r into lp:openlp

2018-04-28 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/pjlink2-r into lp:openlp has been 
updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-r/+merge/344795
-- 
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-r into lp:openlp

2018-04-28 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-r into lp:openlp.

Commit message:
PJLink2 update R

Requested reviews:
  Tim Bentley (trb143)
  Phill (phill-ridout)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-r/+merge/344797

- Convert UDP packet to send pyqtSignal and let individual projectors decide 
who it's for
- Remove unneccessary *args **kwargs from commands
- Remove projector_list  and projector block search since switching to signals
- pass on ACKN, and SRCH commands until I think about it some more
- Cleanup extraneous args on process_* commands since switching to signals
- Add UDP socket listener(s) for PJLink2 UDP options
- Added process_lkup method code
- Add projector configure option to connect when LKUP packet received
- Fix _send_queue to ignore call if no data to send
- Rename tests/openlp_core/projectors/test_projector_pjlink_base.py to 
test_projector_pjlink_base_01.py
- Added tests/openlp_core/projectors/test_projector_pjlink_base_02.py
- Added test for PJLink._send_command
- Removed unused test_projector_pjlink_base_02.pjlink_test from module
- Cleanup tests/openlp_core/projectors/test_projector_pjlink_base_01 imports
- Fix test_projector_pjlink_cmd_routing.test_get_data_unknown_command
- Fix invalid delete projector signal disconnect call in manager
- Move try block under if block when disconnecting signal from deleted 
projector in manager


lp:~alisonken1/openlp/pjlink2-r (revision 2819)
https://ci.openlp.io/job/Branch-01-Pull/2511/  [SUCCESS]
https://ci.openlp.io/job/Branch-02a-Linux-Tests/2412/  [SUCCESS]
https://ci.openlp.io/job/Branch-02b-macOS-Tests/198/   [FAILURE]
https://ci.openlp.io/job/Branch-03a-Build-Source/108/  [SUCCESS]
https://ci.openlp.io/job/Branch-03b-Build-macOS/101/   [SUCCESS]
https://ci.openlp.io/job/Branch-04a-Code-Analysis/1570/[SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test-Coverage/1383/[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/312/ [FAILURE]


-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/common/settings.py'
--- openlp/core/common/settings.py	2018-02-02 21:33:41 +
+++ openlp/core/common/settings.py	2018-04-28 07:22:55 +
@@ -199,6 +199,7 @@
 'projector/db database': '',
 'projector/enable': True,
 'projector/connect on start': False,
+'projector/connect when LKUP received': True,  # PJLink v2: Projector sends LKUP command after it powers up
 'projector/last directory import': None,
 'projector/last directory export': None,
 'projector/poll time': 20,  # PJLink  timeout is 30 seconds

=== modified file 'openlp/core/projectors/manager.py'
--- openlp/core/projectors/manager.py	2018-04-20 06:04:43 +
+++ openlp/core/projectors/manager.py	2018-04-28 07:22:55 +
@@ -37,7 +37,7 @@
 from openlp.core.projectors import DialogSourceStyle
 from openlp.core.projectors.constants import E_AUTHENTICATION, E_ERROR, E_NETWORK, E_NOT_CONNECTED, \
 E_UNKNOWN_SOCKET_ERROR, S_CONNECTED, S_CONNECTING, S_COOLDOWN, S_INITIALIZE, S_NOT_CONNECTED, S_OFF, S_ON, \
-S_STANDBY, S_WARMUP, STATUS_CODE, STATUS_MSG, QSOCKET_STATE
+S_STANDBY, S_WARMUP, PJLINK_PORT, STATUS_CODE, STATUS_MSG, QSOCKET_STATE
 
 from openlp.core.projectors.db import ProjectorDB
 from openlp.core.projectors.editform import ProjectorEditForm
@@ -294,6 +294,9 @@
 self.projectordb = projectordb
 self.projector_list = []
 self.source_select_form = None
+# Dictionary of PJLinkUDP objects to listen for UDP broadcasts from PJLink 2+ projectors.
+# Key is port number that projectors use
+self.pjlink_udp = {}
 
 def bootstrap_initialise(self):
 """
@@ -307,12 +310,15 @@
 else:
 log.debug('Using existing ProjectorDB() instance')
 self.get_settings()
-self.pjlink_udp = PJLinkUDP(self.projector_list)
 
 def bootstrap_post_set_up(self):
 """
 Post-initialize setups.
 """
+# Default PJLink port UDP socket
+log.debug('Creating PJLinkUDP listener for default port {port}'.format(port=PJLINK_PORT))
+self.pjlink_udp = {PJLINK_PORT: PJLinkUDP(port=PJLINK_PORT)}
+self.pjlink_udp[PJLINK_PORT].bind(PJLINK_PORT)
 # Set 1.5 second delay before loading all projectors
 if self.autostart:
 log.debug('Delaying 1.5 seconds before loading all projectors')
@@ -513,6 +519,14 @@
 projector.socket_timer.timeout.disconnect(projector.link.socket_abort)
 except (AttributeError, TypeError):
 pass
+# Disconnect signals from projector being deleted
+if self

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-q into lp:openlp

2018-04-20 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-q into lp:openlp.

Commit message:
PJLink2 update Q

Requested reviews:
  Tim Bentley (trb143)
  Phill (phill-ridout)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-q/+merge/343669

PJLink2 update Q



lp:~alisonken1/openlp/pjlink2-q (revision 2818)
https://ci.openlp.io/job/Branch-01-Pull/2506/  [SUCCESS]
https://ci.openlp.io/job/Branch-02a-Linux-Tests/2407/  [SUCCESS]
https://ci.openlp.io/job/Branch-02b-macOS-Tests/193/   [FAILURE]
https://ci.openlp.io/job/Branch-03a-Build-Source/105/  [SUCCESS]
https://ci.openlp.io/job/Branch-03b-Build-macOS/98/[SUCCESS]
https://ci.openlp.io/job/Branch-04a-Code-Analysis/1567/[SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test-Coverage/1380/[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/309/ [FAILURE]

--

- Fix test_projector_db:TestProjectorDBUpdate segfault by
creating self.main_window steps
- Pep8 on openlp/core/common/__init__.get_local_ip4()
- Collapse import from projector.constants from line-per-item to 
multi-items-per-line
- Change pjlink_functions to include class version for projector instance in 
command
- Set projector.editform to only allow editing IP address field for new entry 
only (used as db key entry)
- Collapse projector.manager imports from entry-per-line to compact import
- projector.pjlink:
- Merge pjlink_functions_udp into pjlink_functions
- Change pjlink_functions to add instance-specific version to commands
- Fix command checks to changed pjlink_funcions
- Update process_clss to update PJLink version in pjlink_functions
- Update reset_information to update PJLink version in pjlink_functions
- renamed test_projectorsourceform.py to test_projector_sourceform.py
- renamed test_projectoreditform.py to test_projector_editform.py
- Fix projector tests
- Fix list creation in constants (remove unneeded comma)
- Rename editform ip_text_show label to ip_text_label
- Refactor editform IP address check
- Add TODO on commented code block for breaking incoming packet into parts

-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/projectors/constants.py'
--- openlp/core/projectors/constants.py	2018-01-03 00:35:14 +
+++ openlp/core/projectors/constants.py	2018-04-20 06:16:23 +
@@ -154,110 +154,137 @@
 S_INFO
 ]
 
-# NOTE: Changed format to account for some commands are both class 1 and 2
+# NOTE: Changed format to account for some commands are both class 1 and 2.
+#   Make sure the sequence of 'version' is lowest-to-highest.
 PJLINK_VALID_CMD = {
-'ACKN': {'version': ['2', ],
+'ACKN': {'version': ['2'],
+ 'default': '2',
  'description': translate('OpenLP.PJLinkConstants',
   'Acknowledge a PJLink SRCH command - returns MAC address.')
  },
-'AVMT': {'version': ['1', ],
+'AVMT': {'version': ['1'],
+ 'default': '1',
  'description': translate('OpenLP.PJLinkConstants',
   'Blank/unblank video and/or mute audio.')
  },
-'CLSS': {'version': ['1', ],
+'CLSS': {'version': ['1'],
+ 'default': '1',
  'description': translate('OpenLP.PJLinkConstants',
   'Query projector PJLink class support.')
  },
 'ERST': {'version': ['1', '2'],
+ 'default': '1',
  'description': translate('OpenLP.PJLinkConstants',
   'Query error status from projector. '
   'Returns fan/lamp/temp/cover/filter/other error status.')
  },
-'FILT': {'version': ['2', ],
+'FILT': {'version': ['2'],
+ 'default': '1',
  'description': translate('OpenLP.PJLinkConstants',
   'Query number of hours on filter.')
  },
-'FREZ': {'version': ['2', ],
+'FREZ': {'version': ['2'],
+ 'default': '1',
  'description': translate('OpenLP.PJLinkConstants',
   'Freeze or unfreeze current image being projected.')
  },
-'INF1': {'version': ['1', ],
+'INF1': {'version': ['1'],
+ 'default': '1',
  'description': translate('OpenLP.PJLinkConstants',
   'Query projector manufacturer name.')
  },
-'INF2': {'version': ['1', ],
+'INF2': {'version': ['1'],
+ 'default': '1',
  'description': translate('OpenLP.PJLinkConstants

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-q into lp:openlp

2018-04-20 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/pjlink2-q into lp:openlp has been 
updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-q/+merge/343668
-- 
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-q into lp:openlp

2018-04-19 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-q into lp:openlp.

Commit message:
PJLink2 update Q

Requested reviews:
  Phill (phill-ridout)
  Tim Bentley (trb143)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-q/+merge/343668

PJLink2 update Q


lp:~alisonken1/openlp/pjlink2-q (revision 2818)
https://ci.openlp.io/job/Branch-01-Pull/2504/  [SUCCESS]
https://ci.openlp.io/job/Branch-02a-Linux-Tests/2405/  [SUCCESS]
https://ci.openlp.io/job/Branch-02b-macOS-Tests/191/   [FAILURE]
https://ci.openlp.io/job/Branch-03a-Build-Source/103/  [SUCCESS]
https://ci.openlp.io/job/Branch-03b-Build-macOS/96/[SUCCESS]
https://ci.openlp.io/job/Branch-04a-Code-Analysis/1565/[FAILURE]
https://ci.openlp.io/job/Branch-04b-Test-Coverage/1378/[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/309/ 
[WAITING]Traceback
--

- Fix test_projector_db:TestProjectorDBUpdate segfault by
creating self.main_window steps
- Pep8 on openlp/core/common/__init__.get_local_ip4()
- Collapse import from projector.constants from line-per-item to 
multi-items-per-line
- Change pjlink_functions to include class version for projector instance in 
command
- Set projector.editform to only allow editing IP address field for new entry 
only (used as db key entry)
- Collapse projector.manager imports from entry-per-line to compact import
- projector.pjlink:
- Merge pjlink_functions_udp into pjlink_functions
- Change pjlink_functions to add instance-specific version to commands
- Fix command checks to changed pjlink_funcions
- Update process_clss to update PJLink version in pjlink_functions
- Update reset_information to update PJLink version in pjlink_functions
- renamed test_projectorsourceform.py to test_projector_sourceform.py
- renamed test_projectoreditform.py to test_projector_editform.py
- Fix projector tests
- Fix list creation in constants (remove unneeded comma)
- Rename editform ip_text_show label to ip_text_label
- Refactor editform IP address check
- Add TODO on commented code block for breaking incoming packet into parts

-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/projectors/constants.py'
--- openlp/core/projectors/constants.py	2018-01-03 00:35:14 +
+++ openlp/core/projectors/constants.py	2018-04-20 05:55:41 +
@@ -154,110 +154,137 @@
 S_INFO
 ]
 
-# NOTE: Changed format to account for some commands are both class 1 and 2
+# NOTE: Changed format to account for some commands are both class 1 and 2.
+#   Make sure the sequence of 'version' is lowest-to-highest.
 PJLINK_VALID_CMD = {
-'ACKN': {'version': ['2', ],
+'ACKN': {'version': ['2'],
+ 'default': '2',
  'description': translate('OpenLP.PJLinkConstants',
   'Acknowledge a PJLink SRCH command - returns MAC address.')
  },
-'AVMT': {'version': ['1', ],
+'AVMT': {'version': ['1'],
+ 'default': '1',
  'description': translate('OpenLP.PJLinkConstants',
   'Blank/unblank video and/or mute audio.')
  },
-'CLSS': {'version': ['1', ],
+'CLSS': {'version': ['1'],
+ 'default': '1',
  'description': translate('OpenLP.PJLinkConstants',
   'Query projector PJLink class support.')
  },
 'ERST': {'version': ['1', '2'],
+ 'default': '1',
  'description': translate('OpenLP.PJLinkConstants',
   'Query error status from projector. '
   'Returns fan/lamp/temp/cover/filter/other error status.')
  },
-'FILT': {'version': ['2', ],
+'FILT': {'version': ['2'],
+ 'default': '1',
  'description': translate('OpenLP.PJLinkConstants',
   'Query number of hours on filter.')
  },
-'FREZ': {'version': ['2', ],
+'FREZ': {'version': ['2'],
+ 'default': '1',
  'description': translate('OpenLP.PJLinkConstants',
   'Freeze or unfreeze current image being projected.')
  },
-'INF1': {'version': ['1', ],
+'INF1': {'version': ['1'],
+ 'default': '1',
  'description': translate('OpenLP.PJLinkConstants',
   'Query projector manufacturer name.')
  },
-'INF2': {'version': ['1', ],
+'INF2': {'version': ['1'],
+ 'default': '1',
  'description': translate('OpenLP.PJLinkConstants

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-q into lp:openlp

2018-04-19 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/pjlink2-q into lp:openlp has been 
updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-q/+merge/342022
-- 
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-q into lp:openlp

2018-03-24 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-q into lp:openlp.

Commit message:
PJLink2 update Q

Requested reviews:
  Tim Bentley (trb143)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-q/+merge/342022

PJLink2 update Q


lp:~alisonken1/openlp/pjlink2-q (revision 2813)
https://ci.openlp.io/job/Branch-01-Pull/2482/  [SUCCESS]
https://ci.openlp.io/job/Branch-02a-Linux-Tests/2383/  [SUCCESS]
https://ci.openlp.io/job/Branch-02b-macOS-Tests/170/   [FAILURE]
https://ci.openlp.io/job/Branch-03a-Build-Source/92/   [SUCCESS]
https://ci.openlp.io/job/Branch-03b-Build-macOS/85/[SUCCESS]
https://ci.openlp.io/job/Branch-04a-Code-Analysis/1554/[SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test-Coverage/1367/[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/299/ [FAILURE]

- Fix test_projector_db:TestProjectorDBUpdate segfault by
creating self.main_window steps
- Pep8 on openlp/core/common/__init__.get_local_ip4()
- Collapse import from projector.constants from line-per-item to 
multi-items-per-line
- Change pjlink_functions to include class version for projector instance in 
command
- Set projector.editform to only allow editing IP address field for new entry 
only (used as db key entry)
- Collapse projector.manager imports from entry-per-line to compact import
- projector.pjlink:
- Merge pjlink_functions_udp into pjlink_functions
- Change pjlink_functions to add instance-specific version to commands
- Fix command checks to changed pjlink_funcions
- Update process_clss to update PJLink version in pjlink_functions
- Update reset_information to update PJLink version in pjlink_functions
- renamed test_projectorsourceform.py to test_projector_sourceform.py
- renamed test_projectoreditform.py to test_projector_editform.py
- Fix projector tests
- Fix list creation in constants (remove unneeded comma)

-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/common/__init__.py'
=== modified file 'openlp/core/projectors/constants.py'
--- openlp/core/projectors/constants.py	2018-01-03 00:35:14 +
+++ openlp/core/projectors/constants.py	2018-03-24 08:24:22 +
@@ -154,110 +154,137 @@
 S_INFO
 ]
 
-# NOTE: Changed format to account for some commands are both class 1 and 2
+# NOTE: Changed format to account for some commands are both class 1 and 2.
+#   Make sure the sequence of 'version' is lowest-to-highest.
 PJLINK_VALID_CMD = {
-'ACKN': {'version': ['2', ],
+'ACKN': {'version': ['2'],
+ 'default': '2',
  'description': translate('OpenLP.PJLinkConstants',
   'Acknowledge a PJLink SRCH command - returns MAC address.')
  },
-'AVMT': {'version': ['1', ],
+'AVMT': {'version': ['1'],
+ 'default': '1',
  'description': translate('OpenLP.PJLinkConstants',
   'Blank/unblank video and/or mute audio.')
  },
-'CLSS': {'version': ['1', ],
+'CLSS': {'version': ['1'],
+ 'default': '1',
  'description': translate('OpenLP.PJLinkConstants',
   'Query projector PJLink class support.')
  },
 'ERST': {'version': ['1', '2'],
+ 'default': '1',
  'description': translate('OpenLP.PJLinkConstants',
   'Query error status from projector. '
   'Returns fan/lamp/temp/cover/filter/other error status.')
  },
-'FILT': {'version': ['2', ],
+'FILT': {'version': ['2'],
+ 'default': '1',
  'description': translate('OpenLP.PJLinkConstants',
   'Query number of hours on filter.')
  },
-'FREZ': {'version': ['2', ],
+'FREZ': {'version': ['2'],
+ 'default': '1',
  'description': translate('OpenLP.PJLinkConstants',
   'Freeze or unfreeze current image being projected.')
  },
-'INF1': {'version': ['1', ],
+'INF1': {'version': ['1'],
+ 'default': '1',
  'description': translate('OpenLP.PJLinkConstants',
   'Query projector manufacturer name.')
  },
-'INF2': {'version': ['1', ],
+'INF2': {'version': ['1'],
+ 'default': '1',
  'description': translate('OpenLP.PJLinkConstants',
   'Query projector product name.')
  },
-'INFO': {'version': ['1', ],
+'INFO': {'version': ['1'],
+ 'default': '1',
  'description': translate

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-q into lp:openlp

2018-03-24 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/pjlink2-q into lp:openlp has been 
updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-q/+merge/341563
-- 
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-q into lp:openlp

2018-03-18 Thread Ken Roberts
which fix is clashing? I tried a merge from trunk and it merged fine.
-- 
https://code.launchpad.net/~alisonken1/openlp/pjlink2-q/+merge/341563
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-q into lp:openlp

2018-03-18 Thread Ken Roberts
> Sorry will clash with one of my fixes which has been merged
> 
> See question

>>  'ACKN': {'version': ['2', ],
>> + 'default': '2',

>Why do we have a missing slot?

2 new commands in PJLink are only valid for version 2 and have no version 1 
equivalent.
Missing slot is to maintain compatibility with version checker.

>> -def process_clss(self, data):
>> +def process_clss(self, data, *args, **kwargs):

>why args
Some commands take host,port arguments but not all of them do.
Since there is a common entry point, need to keep availability of consuming 
extra args/kwargs without causing exception due to extra parameters.
(Yes, there should be no args passed only keyword args, but better safe than 
sorry)

-- 
https://code.launchpad.net/~alisonken1/openlp/pjlink2-q/+merge/341563
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-q into lp:openlp

2018-03-17 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-q into lp:openlp.

Commit message:
PJLink2 update Q

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-q/+merge/341563

PJLink2 update Q


lp:~alisonken1/openlp/pjlink2-q (revision 2814)
https://ci.openlp.io/job/Branch-01-Pull/2479/  [SUCCESS]
https://ci.openlp.io/job/Branch-02a-Linux-Tests/2380/  [SUCCESS]
https://ci.openlp.io/job/Branch-02b-macOS-Tests/167/   [FAILURE]
https://ci.openlp.io/job/Branch-03a-Build-Source/89/   [SUCCESS]
https://ci.openlp.io/job/Branch-03b-Build-macOS/82/[SUCCESS]
https://ci.openlp.io/job/Branch-04a-Code-Analysis/1551/[SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test-Coverage/1364/[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/296/ [FAILURE]


- Fix test_projector_db:TestProjectorDBUpdate segfault by
creating self.main_window steps
- Pep8 on openlp/core/common/__init__.get_local_ip4()
- Collapse import from projector.constants from line-per-item to 
multi-items-per-line
- Change pjlink_functions to include class version for projector instance in 
command
- Set projector.editform to only allow editing IP address field for new entry 
only (used as db key entry)
- Collapse projector.manager imports from entry-per-line to compact import
- projector.pjlink:
- Merge pjlink_functions_udp into pjlink_functions
- Change pjlink_functions to add instance-specific version to commands
- Fix command checks to changed pjlink_funcions
- Update process_clss to update PJLink version in pjlink_functions
- Update reset_information to update PJLink version in pjlink_functions
- renamed test_projectorsourceform.py to test_projector_sourceform.py
- renamed test_projectoreditform.py to test_projector_editform.py
- Fix projector tests

-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2-q into lp:openlp.
=== modified file 'openlp/core/common/__init__.py'
--- openlp/core/common/__init__.py	2018-02-11 21:52:04 +
+++ openlp/core/common/__init__.py	2018-03-17 17:48:23 +
@@ -76,7 +76,7 @@
 'netmask': address.netmask().toString(),
 'prefix': address.prefixLength(),
 'localnet': QHostAddress(address.netmask().toIPv4Address() &
-ip.toIPv4Address()).toString()
+ ip.toIPv4Address()).toString()
 }
 log.debug('Adding {iface} to active list'.format(iface=iface.name()))
 if len(MY_IP4) == 1:

=== modified file 'openlp/core/projectors/constants.py'
--- openlp/core/projectors/constants.py	2018-01-03 00:35:14 +
+++ openlp/core/projectors/constants.py	2018-03-17 17:48:23 +
@@ -154,110 +154,137 @@
 S_INFO
 ]
 
-# NOTE: Changed format to account for some commands are both class 1 and 2
+# NOTE: Changed format to account for some commands are both class 1 and 2.
+#   Make sure the sequence of 'version' is lowest-to-highest.
 PJLINK_VALID_CMD = {
 'ACKN': {'version': ['2', ],
+ 'default': '2',
  'description': translate('OpenLP.PJLinkConstants',
   'Acknowledge a PJLink SRCH command - returns MAC address.')
  },
 'AVMT': {'version': ['1', ],
+ 'default': '1',
  'description': translate('OpenLP.PJLinkConstants',
   'Blank/unblank video and/or mute audio.')
  },
 'CLSS': {'version': ['1', ],
+ 'default': '1',
  'description': translate('OpenLP.PJLinkConstants',
   'Query projector PJLink class support.')
  },
 'ERST': {'version': ['1', '2'],
+ 'default': '1',
  'description': translate('OpenLP.PJLinkConstants',
   'Query error status from projector. '
   'Returns fan/lamp/temp/cover/filter/other error status.')
  },
 'FILT': {'version': ['2', ],
+ 'default': '1',
  'description': translate('OpenLP.PJLinkConstants',
   'Query number of hours on filter.')
  },
 'FREZ': {'version': ['2', ],
+ 'default': '1',
  'description': translate('OpenLP.PJLinkConstants',
   'Freeze or unfreeze current image being projected.')
  },
 'INF1': {'version': ['1', ],
+ 'default'

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-p into lp:openlp

2018-02-11 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-p into lp:openlp.

Commit message:
PJLink2 Update P

Requested reviews:
  Tim Bentley (trb143)
  Raoul Snyman (raoul-snyman)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-p/+merge/337519

- manager: Remove unused signal disconnect projectorNetwork.disconnect()
- Change PJLinkUDP.pjlink_udp_commands to dict with link to processing methods
- Add test_projector_pjlink_udp.test_process_ackn_duplicate
- Add test_projector_pjlink_udp.test_process_ackn_multiple
- Add test_projector_pjlink_udp.test_process_ackn_single
- Add test_projector_pjlink_udp.test_process_srch
- Add PJLinkUDP.get_datagram method
- Add PJLinkUDP._trash_udp_buffer method
- Add PJLinkUDP.process_ackn method
- Add PJLinkUDP.process_srch method
- Move projector tests to tests/openlp_core/projectors/
- Update resources.projector.data.TESTx_DATA to add mac_adx
- Added dictionary of IP interfaces/addresses to core.common
- Refactor tab.ApiTab.get_ip_address() to use MY_IP4 dict
- Fix tests for api.tab.ApiTab.get_ip_address()
- Move dictionary of IP interfaces to function


lp:~alisonken1/openlp/pjlink2-p (revision 2811)
https://ci.openlp.io/job/Branch-01-Pull/2446/  [SUCCESS]
https://ci.openlp.io/job/Branch-02a-Linux-Tests/2347/  [SUCCESS]
https://ci.openlp.io/job/Branch-02b-macOS-Tests/141/   [FAILURE]

Passed local tests so not sure what happened now

-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/api/tab.py'
--- openlp/core/api/tab.py	2017-12-29 09:15:48 +
+++ openlp/core/api/tab.py	2018-02-12 01:05:51 +
@@ -24,6 +24,7 @@
 """
 from PyQt5 import QtCore, QtGui, QtNetwork, QtWidgets
 
+from openlp.core.common import get_local_ip4
 from openlp.core.common.i18n import UiStrings, translate
 from openlp.core.common.registry import Registry
 from openlp.core.common.settings import Settings
@@ -219,17 +220,12 @@
 else: return ip_address
 """
 if ip_address == ZERO_URL:
-interfaces = QtNetwork.QNetworkInterface.allInterfaces()
-for interface in interfaces:
-if not interface.isValid():
-continue
-if not (interface.flags() & (QtNetwork.QNetworkInterface.IsUp | QtNetwork.QNetworkInterface.IsRunning)):
-continue
-for address in interface.addressEntries():
-ip = address.ip()
-if ip.protocol() == QtNetwork.QAbstractSocket.IPv4Protocol and \
-   ip != QtNetwork.QHostAddress.LocalHost:
-return ip.toString()
+# In case we have more than one interface
+ifaces = get_local_ip4()
+for key in iter(ifaces):
+ip_address = ifaces.get(key)['ip']
+# We only want the first interface returned
+break
 return ip_address
 
 def load(self):

=== modified file 'openlp/core/common/__init__.py'
--- openlp/core/common/__init__.py	2017-12-29 09:15:48 +
+++ openlp/core/common/__init__.py	2018-02-12 01:05:51 +
@@ -36,6 +36,7 @@
 
 from PyQt5 import QtGui
 from PyQt5.QtCore import QCryptographicHash as QHash
+from PyQt5.QtNetwork import QAbstractSocket, QHostAddress, QNetworkInterface
 from chardet.universaldetector import UniversalDetector
 
 log = logging.getLogger(__name__ + '.__init__')
@@ -52,6 +53,44 @@
 WHITESPACE_REGEX = re.compile(r'[ \t]+')
 
 
+def get_local_ip4():
+"""
+Creates a dictionary of local IPv4 interfaces on local machine.
+If no active interfaces available, returns a dict of localhost IPv4 information
+
+:returns: Dict of interfaces
+"""
+# Get the local IPv4 active address(es) that are NOT localhost (lo or '127.0.0.1')
+log.debug('Getting local IPv4 interface(es) information')
+MY_IP4 = {}
+for iface in QNetworkInterface.allInterfaces():
+if not iface.isValid() or not (iface.flags() & (QNetworkInterface.IsUp | QNetworkInterface.IsRunning)):
+continue
+for address in iface.addressEntries():
+ip = address.ip()
+# NOTE: Next line will skip if interface is localhost - keep for now until we decide about it later
+# if (ip.protocol() == QAbstractSocket.IPv4Protocol) and (ip != QHostAddress.LocalHost):
+if (ip.protocol() == QAbstractSocket.IPv4Protocol):
+MY_IP4[iface.name()] = {'ip': ip.toString(),
+'broadcast': address.broadcast().toString(),
+'netmask': address.netmask().toString(),
+'prefix': address.prefixLength(),
+

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-p into lp:openlp

2018-02-11 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/pjlink2-p into lp:openlp has been 
updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-p/+merge/337511
-- 
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-p into lp:openlp

2018-02-11 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-p into lp:openlp.

Commit message:
PJLink2 Update P

Requested reviews:
  Tim Bentley (trb143)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-p/+merge/337511

- manager: Remove unused signal disconnect projectorNetwork.disconnect()
- Change PJLinkUDP.pjlink_udp_commands to dict with link to processing methods
- Add test_projector_pjlink_udp.test_process_ackn_duplicate
- Add test_projector_pjlink_udp.test_process_ackn_multiple
- Add test_projector_pjlink_udp.test_process_ackn_single
- Add test_projector_pjlink_udp.test_process_srch
- Add PJLinkUDP.get_datagram method
- Add PJLinkUDP._trash_udp_buffer method
- Add PJLinkUDP.process_ackn method
- Add PJLinkUDP.process_srch method
- Move projector tests to tests/openlp_core/projectors/
- Update resources.projector.data.TESTx_DATA to add mac_adx
- Added dictionary of IP interfaces/addresses to core.common
- Refactor tab.ApiTab.get_ip_address() to use MY_IP4 dict
- Fix tests for api.tab.ApiTab.get_ip_address()


lp:~alisonken1/openlp/pjlink2-p (revision 2810)
https://ci.openlp.io/job/Branch-01-Pull/2444/  [SUCCESS]
https://ci.openlp.io/job/Branch-02a-Linux-Tests/2345/  [SUCCESS]
https://ci.openlp.io/job/Branch-02b-macOS-Tests/139/   [SUCCESS]
https://ci.openlp.io/job/Branch-03a-Build-Source/61/   [SUCCESS]
https://ci.openlp.io/job/Branch-03b-Build-macOS/59/[SUCCESS]
https://ci.openlp.io/job/Branch-04a-Code-Analysis/1523/[SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test-Coverage/1336/[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/277/ [FAILURE]

-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/api/tab.py'
--- openlp/core/api/tab.py	2017-12-29 09:15:48 +
+++ openlp/core/api/tab.py	2018-02-11 11:56:38 +
@@ -24,6 +24,7 @@
 """
 from PyQt5 import QtCore, QtGui, QtNetwork, QtWidgets
 
+from openlp.core.common import MY_IP4
 from openlp.core.common.i18n import UiStrings, translate
 from openlp.core.common.registry import Registry
 from openlp.core.common.settings import Settings
@@ -219,17 +220,11 @@
 else: return ip_address
 """
 if ip_address == ZERO_URL:
-interfaces = QtNetwork.QNetworkInterface.allInterfaces()
-for interface in interfaces:
-if not interface.isValid():
-continue
-if not (interface.flags() & (QtNetwork.QNetworkInterface.IsUp | QtNetwork.QNetworkInterface.IsRunning)):
-continue
-for address in interface.addressEntries():
-ip = address.ip()
-if ip.protocol() == QtNetwork.QAbstractSocket.IPv4Protocol and \
-   ip != QtNetwork.QHostAddress.LocalHost:
-return ip.toString()
+# In case we have more than one interface
+for key in iter(MY_IP4):
+ip_address = MY_IP4.get(key)['ip']
+# We only want the first interface returned
+break
 return ip_address
 
 def load(self):

=== modified file 'openlp/core/common/__init__.py'
--- openlp/core/common/__init__.py	2017-12-29 09:15:48 +
+++ openlp/core/common/__init__.py	2018-02-11 11:56:38 +
@@ -36,6 +36,7 @@
 
 from PyQt5 import QtGui
 from PyQt5.QtCore import QCryptographicHash as QHash
+from PyQt5.QtNetwork import QAbstractSocket, QHostAddress, QNetworkInterface
 from chardet.universaldetector import UniversalDetector
 
 log = logging.getLogger(__name__ + '.__init__')
@@ -51,6 +52,27 @@
 NEW_LINE_REGEX = re.compile(r' ?(\r\n?|\n) ?')
 WHITESPACE_REGEX = re.compile(r'[ \t]+')
 
+# Get the local IPv4 active address(es) that are NOT localhost (lo or '127.0.0.1')
+log.debug('Getting local IPv4 interface(es) information')
+MY_IP4 = {}
+for iface in QNetworkInterface.allInterfaces():
+if not iface.isValid() or not (iface.flags() & (QNetworkInterface.IsUp | QNetworkInterface.IsRunning)):
+continue
+for address in iface.addressEntries():
+ip = address.ip()
+if (ip.protocol() == QAbstractSocket.IPv4Protocol) and (ip != QHostAddress.LocalHost):
+MY_IP4[iface.name()] = {'ip': ip.toString(),
+'broadcast': address.broadcast().toString(),
+'netmask': address.netmask().toString(),
+'prefix': address.prefixLength(),
+'localnet': QHostAddress(address.netmask().toIPv4Address() &
+ ip.toIPv4Address()).toString()
+}
+log.de

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-p into lp:openlp

2018-02-11 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/pjlink2-p into lp:openlp has been 
updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-p/+merge/337504
-- 
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-p into lp:openlp

2018-02-10 Thread Ken Roberts
>> === modified file 'openlp/.version'
>> --- openlp/.version   2016-12-12 22:16:23 +
>> +++ openlp/.version   2018-02-10 09:09:49 +
>> @@ -1 +1 @@
>> -2.5.0
>> +2.5-bzr2809
>
> why?

huh?
Didn't know that happened. Must have been when I was twiddling with
pip install trying something out.
Reverted

-- 
https://code.launchpad.net/~alisonken1/openlp/pjlink2-p/+merge/337504
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-p into lp:openlp

2018-02-10 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-p into lp:openlp.

Commit message:
PJLink2 Update P

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-p/+merge/337504

- manager: Remove unused signal disconnect projectorNetwork.disconnect()
- Change PJLinkUDP.pjlink_udp_commands to dict with link to processing methods
- Add test_projector_pjlink_udp.test_process_ackn_duplicate
- Add test_projector_pjlink_udp.test_process_ackn_multiple
- Add test_projector_pjlink_udp.test_process_ackn_single
- Add test_projector_pjlink_udp.test_process_srch
- Add PJLinkUDP.get_datagram method
- Add PJLinkUDP._trash_udp_buffer method
- Add PJLinkUDP.process_ackn method
- Add PJLinkUDP.process_srch method
- Move projector tests to tests/openlp_core/projectors/
- Update resources.projector.data.TESTx_DATA to add mac_adx


lp:~alisonken1/openlp/pjlink2-p (revision 2810)
https://ci.openlp.io/job/Branch-01-Pull/2443/  [SUCCESS]
https://ci.openlp.io/job/Branch-02a-Linux-Tests/2344/  [SUCCESS]
https://ci.openlp.io/job/Branch-02b-macOS-Tests/138/   [SUCCESS]
https://ci.openlp.io/job/Branch-03a-Build-Source/60/   [SUCCESS]
https://ci.openlp.io/job/Branch-03b-Build-macOS/58/[SUCCESS]
https://ci.openlp.io/job/Branch-04a-Code-Analysis/1522/[SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test-Coverage/1335/[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/276/ [FAILURE]

-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2-p into lp:openlp.
=== modified file 'openlp/.version'
--- openlp/.version	2016-12-12 22:16:23 +
+++ openlp/.version	2018-02-10 09:09:49 +
@@ -1,1 +1,1 @@
-2.5.0
+2.5-bzr2809
\ No newline at end of file

=== modified file 'openlp/core/projectors/constants.py'
--- openlp/core/projectors/constants.py	2018-01-03 00:35:14 +
+++ openlp/core/projectors/constants.py	2018-02-10 09:09:49 +
@@ -24,6 +24,8 @@
 """
 import logging
 
+from PyQt5.QtNetwork import QAbstractSocket, QHostAddress, QNetworkInterface
+
 from openlp.core.common.i18n import translate
 
 log = logging.getLogger(__name__)
@@ -557,3 +559,24 @@
 label = "{source}{item}".format(source=source, item=item)
 PJLINK_DEFAULT_CODES[label] = "{source} {item}".format(source=PJLINK_DEFAULT_SOURCES[source],
item=PJLINK_DEFAULT_ITEMS[item])
+
+# Get the local IPv4 active address(es) that are NOT localhost (lo or '127.0.0.1')
+log.debug('Getting local IPv4 interface(es) information')
+MY_IP4 = {}
+for iface in QNetworkInterface.allInterfaces():
+if not iface.isValid() or not (iface.flags() & (QNetworkInterface.IsUp | QNetworkInterface.IsRunning)):
+continue
+for address in iface.addressEntries():
+ip = address.ip()
+if (ip.protocol() == QAbstractSocket.IPv4Protocol) and (ip != QHostAddress.LocalHost):
+MY_IP4[iface.name()] = {'ip': ip.toString(),
+'broadcast': address.broadcast().toString(),
+'netmask': address.netmask().toString(),
+'prefix': address.prefixLength(),
+'localnet': QHostAddress(address.netmask().toIPv4Address() &
+ ip.toIPv4Address()).toString()
+}
+log.debug('Adding {iface} to active list'.format(iface=iface.name()))
+
+if not MY_IP4:
+log.warning('No active IPv4 interfaces found')

=== modified file 'openlp/core/projectors/manager.py'
--- openlp/core/projectors/manager.py	2018-01-13 05:41:42 +
+++ openlp/core/projectors/manager.py	2018-02-10 09:09:49 +
@@ -308,7 +308,6 @@
 self.settings_section = 'projector'
 self.projectordb = projectordb
 self.projector_list = []
-self.pjlink_udp = PJLinkUDP(self.projector_list)
 self.source_select_form = None
 
 def bootstrap_initialise(self):
@@ -323,6 +322,7 @@
 else:
 log.debug('Using existing ProjectorDB() instance')
 self.get_settings()
+self.pjlink_udp = PJLinkUDP(self.projector_list)
 
 def bootstrap_post_set_up(self):
 """
@@ -344,6 +344,7 @@
 """
 Retrieve the saved settings
 """
+log.debug('Updating ProjectorManager settings')
 settings = Settings()
 settings.beginGroup(self.settings_section)
 self.autostart = settings.value('connect on start')
@@ -502,10 +503,6 @@
 if ans == msg.Cancel:
 return

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-o into lp:openlp

2018-01-12 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/pjlink2-o into lp:openlp has been 
updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-o/+merge/336065
-- 
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-o into lp:openlp

2018-01-12 Thread Ken Roberts
I don't forsee pjlink going to a split versioning for class
information (it's not like software), but as you say, space is cheap

On Fri, Jan 12, 2018 at 11:07 PM, Raoul Snyman  wrote:
> Review: Needs Fixing
>
> I'm pretty happy with this overall, just the field in the database which I 
> think should be bigger.
>
> Diff comments:
>
>> === modified file 'openlp/core/projectors/db.py'
>> --- openlp/core/projectors/db.py  2017-12-29 09:15:48 +
>> +++ openlp/core/projectors/db.py  2018-01-13 05:52:32 +
>> @@ -152,6 +152,7 @@
>>  location:   Column(String(30))
>>  notes:  Column(String(200))
>>  pjlink_name:Column(String(128))  # From projector
>> +pjlink_classColumn(String(1))# From projector
>
> Just one character? Space is cheap, make it bigger, just in case these 
> classes become something weird like "18.02"
>
>>  manufacturer:   Column(String(128))  # From projector
>>  model:  Column(String(128))  # From projector
>>  other:  Column(String(128))  # From projector
>> @@ -197,6 +199,7 @@
>>  location = Column(String(30))
>>  notes = Column(String(200))
>>  pjlink_name = Column(String(128))
>> +pjlink_class = Column(String(1))
>
> Same here.
>
>>  manufacturer = Column(String(128))
>>  model = Column(String(128))
>>  other = Column(String(128))
>
>
> --
> https://code.launchpad.net/~alisonken1/openlp/pjlink2-o/+merge/336065
> You are the owner of lp:~alisonken1/openlp/pjlink2-o.



-- 
- Ken
Registered Linux user 296561
Slackin' since 1993
Slackware Linux (http://www.slackware.com)
OpenLP - Church Projection Software
Empower Your Church http://openlp.org

https://code.launchpad.net/~alisonken1/openlp/pjlink2-o/+merge/336065
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] [Bug 1594001] Re: Projector port entry allows invalid port numbers

2018-01-12 Thread Ken Roberts
Not sure when but fixed

** Changed in: openlp
   Status: In Progress => Fix Committed

-- 
You received this bug notification because you are a member of OpenLP
Core, which is subscribed to OpenLP.
https://bugs.launchpad.net/bugs/1594001

Title:
  Projector port entry allows invalid port numbers

Status in OpenLP:
  Fix Committed

Bug description:
  New/edit projector wizard does not check port entry for valid ports.
  Empty field will cause an exception.

  Since it's prefilled with the default port, it is normally not an
  issue.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1594001/+subscriptions

___
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] [Bug 1625767] Re: Can't delete/add a projector...

2018-01-12 Thread Ken Roberts
** Changed in: openlp
   Importance: Undecided => Medium

** Changed in: openlp
   Status: Confirmed => Fix Committed

-- 
You received this bug notification because you are a member of OpenLP
Core, which is subscribed to OpenLP.
https://bugs.launchpad.net/bugs/1625767

Title:
  Can't delete/add a projector...

Status in OpenLP:
  Fix Committed

Bug description:
  When trying to add a projector through the projector manager it won't
  connect and when opening OpenLP with the 'connect to projector on
  startup' option enabled it gives an error window.  I also cannot
  delete projector as the same window pops up with an error.  So all in
  all it won't connect.

  PC Specs:
  -Arch Linux (kernel 4.7.4)
  -OpenLP-bzr2496

  Steps to reproduce issue:
  1. Click on add projector
  2. Fill in info to projector
  3. Click on connect...nothing happens
  4. Click on Settins/Configure OpenLP/Projectors and enable
 the 'Connect to projectors on startup' option
  5. Close OpenLP
  6. Open OpenLP and error window pops up.
  7. Delete the projector in Projector Manager the same popup window shows up.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1625767/+subscriptions

___
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] [Bug 1603702] Re: no compatible signature for decorated function in projector test

2018-01-12 Thread Ken Roberts
Not sure which update fixed, but problem resolved and in trunk

** Changed in: openlp
   Importance: Undecided => Medium

** Changed in: openlp
   Status: New => Fix Committed

-- 
You received this bug notification because you are a member of OpenLP
Core, which is subscribed to OpenLP.
https://bugs.launchpad.net/bugs/1603702

Title:
  no compatible signature for decorated function  in projector test

Status in OpenLP:
  Fix Committed

Bug description:
  Trunk on superfly machine

  ==
  ERROR: test_source_select_edit_button 
(tests.interfaces.openlp_core_ui.test_projectorsourceform.ProjectorSourceFormTest)
  --
  Traceback (most recent call last):
File "/usr/lib/python3.5/unittest/mock.py", line 1157, in patched
  return func(*args, **keywargs)
File 
"/home/raoul/Projects/OpenLP/OpenLP/permission-error/tests/interfaces/openlp_core_ui/test_projectorsourceform.py",
 line 132, in test_source_select_edit_button
  select_form.exec(projector=self.projector)
File 
"/home/raoul/Projects/OpenLP/OpenLP/permission-error/openlp/core/ui/projector/sourceselectform.py",
 line 448, in exec
  self.button_box.clicked.connect(self.button_clicked)
  TypeError: decorated slot has no signature compatible with 
clicked(QAbstractButton*)

  ==
  ERROR: test_source_select_noedit_button 
(tests.interfaces.openlp_core_ui.test_projectorsourceform.ProjectorSourceFormTest)
  --
  Traceback (most recent call last):
File "/usr/lib/python3.5/unittest/mock.py", line 1157, in patched
  return func(*args, **keywargs)
File 
"/home/raoul/Projects/OpenLP/OpenLP/permission-error/tests/interfaces/openlp_core_ui/test_projectorsourceform.py",
 line 152, in test_source_select_noedit_button
  select_form.exec(projector=self.projector)
File 
"/home/raoul/Projects/OpenLP/OpenLP/permission-error/openlp/core/ui/projector/sourceselectform.py",
 line 448, in exec
  self.button_box.clicked.connect(self.button_clicked)
  TypeError: decorated slot has no signature compatible with 
clicked(QAbstractButton*)

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1603702/+subscriptions

___
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] [Bug 1742910] Re: first time wizard crashes

2018-01-12 Thread Ken Roberts
** Branch unlinked: lp:~alisonken1/openlp/pjlink2-o-with_thread_hack

-- 
You received this bug notification because you are a member of OpenLP
Core, which is subscribed to OpenLP.
https://bugs.launchpad.net/bugs/1742910

Title:
  first time wizard crashes

Status in OpenLP:
  New

Bug description:
  Traceback (most recent call last):
File 
"/home/sim/dev/openlp/better-threading/openlp/core/ui/firsttimeform.py", line 
307, in on_current_id_changed
  self._download_index()
File 
"/home/sim/dev/openlp/better-threading/openlp/core/ui/firsttimeform.py", line 
260, in _download_index
  run_thread(worker, thread_name)
File "/home/sim/dev/openlp/better-threading/openlp/core/threading.py", line 
54, in run_thread
  if thread_name in main_window.threads:
  AttributeError: 'NoneType' object has no attribute 'threads'


  Using the better-threading branch, with no data or configs for OpenLP
  present in my home running on Archlinux.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1742910/+subscriptions

___
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] [Bug 1742910] Re: first time wizard crashes

2018-01-12 Thread Ken Roberts
** Branch linked: lp:~alisonken1/openlp/pjlink2-o-with_thread_hack

-- 
You received this bug notification because you are a member of OpenLP
Core, which is subscribed to OpenLP.
https://bugs.launchpad.net/bugs/1742910

Title:
  first time wizard crashes

Status in OpenLP:
  New

Bug description:
  Traceback (most recent call last):
File 
"/home/sim/dev/openlp/better-threading/openlp/core/ui/firsttimeform.py", line 
307, in on_current_id_changed
  self._download_index()
File 
"/home/sim/dev/openlp/better-threading/openlp/core/ui/firsttimeform.py", line 
260, in _download_index
  run_thread(worker, thread_name)
File "/home/sim/dev/openlp/better-threading/openlp/core/threading.py", line 
54, in run_thread
  if thread_name in main_window.threads:
  AttributeError: 'NoneType' object has no attribute 'threads'


  Using the better-threading branch, with no data or configs for OpenLP
  present in my home running on Archlinux.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1742910/+subscriptions

___
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] [Bug 1742910] Re: first time wizard crashes

2018-01-12 Thread Ken Roberts
Confirmed on Fedora 25 as well.


** Tags added: threads

** Tags added: ftw

** Attachment added: "openlp.log from fedora 25 after deleting ~/.openlp 
~/.config/OpenLP"
   
https://bugs.launchpad.net/openlp/+bug/1742910/+attachment/5035774/+files/openlp.log

** Changed in: openlp
   Importance: Undecided => Critical

-- 
You received this bug notification because you are a member of OpenLP
Core, which is subscribed to OpenLP.
https://bugs.launchpad.net/bugs/1742910

Title:
  first time wizard crashes

Status in OpenLP:
  New

Bug description:
  Traceback (most recent call last):
File 
"/home/sim/dev/openlp/better-threading/openlp/core/ui/firsttimeform.py", line 
307, in on_current_id_changed
  self._download_index()
File 
"/home/sim/dev/openlp/better-threading/openlp/core/ui/firsttimeform.py", line 
260, in _download_index
  run_thread(worker, thread_name)
File "/home/sim/dev/openlp/better-threading/openlp/core/threading.py", line 
54, in run_thread
  if thread_name in main_window.threads:
  AttributeError: 'NoneType' object has no attribute 'threads'


  Using the better-threading branch, with no data or configs for OpenLP
  present in my home running on Archlinux.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1742910/+subscriptions

___
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-n into lp:openlp

2018-01-02 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/pjlink2-n into lp:openlp has been 
updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-n/+merge/335591
-- 
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-n into lp:openlp

2017-12-25 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/pjlink2-n into lp:openlp has been 
updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-n/+merge/335588
-- 
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-n into lp:openlp

2017-12-25 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/pjlink2-n into lp:openlp has been 
updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-n/+merge/335587
-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2-n into 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-m into lp:openlp

2017-12-09 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-m into lp:openlp.

Commit message:
PJLink2 update M

Requested reviews:
  Tim Bentley (trb143)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-m/+merge/335001

- Added pjlink.process_pjlink
- Split pjlink.check_login() to use process_pjlink()
- Added QAbstractSocket connect enum to constants
- Minor code cleanups for connection and command processing
- Updated packet queueing
- Fix get_object_filtered()
- Fix tests in test_projector_pjlink_base
- Fix tests in test_projector_pjlink_cmd_routing
- Added tests for process_pjlink method
- Updated test_projector_bugfixes_01
- Some OLP style cleanups


lp:~alisonken1/openlp/pjlink2-m (revision 2796)
https://ci.openlp.io/job/Branch-01-Pull/2339/  [SUCCESS]
https://ci.openlp.io/job/Branch-02-Functional-Tests/2240/  [SUCCESS]
https://ci.openlp.io/job/Branch-03-Interface-Tests/2110/   [SUCCESS]
https://ci.openlp.io/job/Branch-04a-Code_Analysis/1436/[SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test_Coverage/1255/[SUCCESS]
https://ci.openlp.io/job/Branch-04c-Code_Analysis2/385/[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/214/ [FAILURE]


-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/projectors/__init__.py'
--- openlp/core/projectors/__init__.py	2017-11-16 23:53:53 +
+++ openlp/core/projectors/__init__.py	2017-12-09 11:19:42 +
@@ -25,8 +25,6 @@
 Initialization for the openlp.core.projectors modules.
 """
 
-from openlp.core.projectors.constants import PJLINK_PORT, ERROR_MSG, ERROR_STRING
-
 
 class DialogSourceStyle(object):
 """

=== modified file 'openlp/core/projectors/constants.py'
--- openlp/core/projectors/constants.py	2017-11-10 11:59:38 +
+++ openlp/core/projectors/constants.py	2017-12-09 11:19:42 +
@@ -144,6 +144,24 @@
  }
 }
 
+# QAbstractSocketState enums converted to string
+S_QSOCKET_STATE = {
+0: 'QSocketState - UnconnectedState',
+1: 'QSocketState - HostLookupState',
+2: 'QSocketState - ConnectingState',
+3: 'QSocketState - ConnectedState',
+4: 'QSocketState - BoundState',
+5: 'QSocketState - ListeningState (internal use only)',
+6: 'QSocketState - ClosingState',
+'UnconnectedState': 0,
+'HostLookupState': 1,
+'ConnectingState': 2,
+'ConnectedState': 3,
+'BoundState': 4,
+'ListeningState': 5,
+'ClosingState': 6
+}
+
 # Error and status codes
 S_OK = E_OK = 0  # E_OK included since I sometimes forget
 # Error codes. Start at 200 so we don't duplicate system error codes.

=== modified file 'openlp/core/projectors/db.py'
--- openlp/core/projectors/db.py	2017-11-10 11:59:38 +
+++ openlp/core/projectors/db.py	2017-12-09 11:19:42 +
@@ -415,7 +415,7 @@
 for key in projector.source_available:
 item = self.get_object_filtered(ProjectorSource,
 and_(ProjectorSource.code == key,
- ProjectorSource.projector_id == projector.dbid))
+ ProjectorSource.projector_id == projector.id))
 if item is None:
 source_dict[key] = PJLINK_DEFAULT_CODES[key]
 else:

=== modified file 'openlp/core/projectors/pjlink.py'
--- openlp/core/projectors/pjlink.py	2017-11-24 19:08:23 +
+++ openlp/core/projectors/pjlink.py	2017-12-09 11:19:42 +
@@ -58,8 +58,7 @@
 E_AUTHENTICATION, E_CONNECTION_REFUSED, E_GENERAL, E_INVALID_DATA, E_NETWORK, E_NOT_CONNECTED, E_OK, \
 E_PARAMETER, E_PROJECTOR, E_SOCKET_TIMEOUT, E_UNAVAILABLE, E_UNDEFINED, PJLINK_ERRORS, PJLINK_ERST_DATA, \
 PJLINK_ERST_STATUS, PJLINK_MAX_PACKET, PJLINK_PORT, PJLINK_POWR_STATUS, PJLINK_VALID_CMD, \
-STATUS_STRING, S_CONNECTED, S_CONNECTING, S_INFO, S_NETWORK_RECEIVED, S_NETWORK_SENDING, \
-S_NOT_CONNECTED, S_OFF, S_OK, S_ON, S_STATUS
+STATUS_STRING, S_CONNECTED, S_CONNECTING, S_INFO, S_NOT_CONNECTED, S_OFF, S_OK, S_ON, S_QSOCKET_STATE, S_STATUS
 
 log = logging.getLogger(__name__)
 log.debug('pjlink loaded')
@@ -111,7 +110,7 @@
 """
 log.debug('PJlinkCommands(args={args} kwargs={kwargs})'.format(args=args, kwargs=kwargs))
 super().__init__()
-# Map command to function
+# Map PJLink command to method
 self.pjlink_functions = {
 'AVMT': self.process_avmt,
 'CLSS': self.process_clss,
@@ -123,7 +122,9 @@
 'INST': self.process_inst,
 'LAMP': self.process_lamp,
 'NAME': self.process_name,
-'PJLINK': self.check_login,
+'PJLINK': self.process_pjlink,
+# TODO: Part of check_login refac

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-m into lp:openlp

2017-12-09 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/pjlink2-m into lp:openlp has been 
updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-m/+merge/334722
-- 
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-m into lp:openlp

2017-12-04 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-m into lp:openlp.

Commit message:
PJLink2 update M

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-m/+merge/334722

- Added pjlink.process_pjlink
- Split pjlink.check_login() to use process_pjlink()
- Added QAbstractSocket connect enum to constants
- Minor code cleanups for connection and command processing
- Updated packet queueing
- Fix get_object_filtered()
- Fix tests in test_projector_pjlink_base
- Fix tests in test_projector_pjlink_cmd_routing
- Added tests for process_pjlink method
- Updated test_projector_bugfixes_01


lp:~alisonken1/openlp/pjlink2-m (revision 2795)
https://ci.openlp.io/job/Branch-01-Pull/2338/  [SUCCESS]
https://ci.openlp.io/job/Branch-02-Functional-Tests/2239/  [SUCCESS]
https://ci.openlp.io/job/Branch-03-Interface-Tests/2109/   [SUCCESS]
https://ci.openlp.io/job/Branch-04a-Code_Analysis/1435/[SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test_Coverage/1254/[SUCCESS]
https://ci.openlp.io/job/Branch-04c-Code_Analysis2/384/[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/213/ [FAILURE]

-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2-m into lp:openlp.
=== modified file 'openlp/core/projectors/__init__.py'
--- openlp/core/projectors/__init__.py	2017-11-16 23:53:53 +
+++ openlp/core/projectors/__init__.py	2017-12-05 00:43:50 +
@@ -25,8 +25,6 @@
 Initialization for the openlp.core.projectors modules.
 """
 
-from openlp.core.projectors.constants import PJLINK_PORT, ERROR_MSG, ERROR_STRING
-
 
 class DialogSourceStyle(object):
 """

=== modified file 'openlp/core/projectors/constants.py'
--- openlp/core/projectors/constants.py	2017-11-10 11:59:38 +
+++ openlp/core/projectors/constants.py	2017-12-05 00:43:50 +
@@ -144,6 +144,24 @@
  }
 }
 
+# QAbstractSocketState enums converted to string
+S_QSOCKET_STATE = {
+0: 'QSocketState - UnconnectedState',
+1: 'QSocketState - HostLookupState',
+2: 'QSocketState - ConnectingState',
+3: 'QSocketState - ConnectedState',
+4: 'QSocketState - BoundState',
+5: 'QSocketState - ListeningState (internal use only)',
+6: 'QSocketState - ClosingState',
+'UnconnectedState': 0,
+'HostLookupState': 1,
+'ConnectingState': 2,
+'ConnectedState': 3,
+'BoundState': 4,
+'ListeningState': 5,
+'ClosingState': 6,
+}
+
 # Error and status codes
 S_OK = E_OK = 0  # E_OK included since I sometimes forget
 # Error codes. Start at 200 so we don't duplicate system error codes.

=== modified file 'openlp/core/projectors/db.py'
--- openlp/core/projectors/db.py	2017-11-10 11:59:38 +
+++ openlp/core/projectors/db.py	2017-12-05 00:43:50 +
@@ -415,7 +415,7 @@
 for key in projector.source_available:
 item = self.get_object_filtered(ProjectorSource,
 and_(ProjectorSource.code == key,
- ProjectorSource.projector_id == projector.dbid))
+ ProjectorSource.projector_id == projector.id))
 if item is None:
 source_dict[key] = PJLINK_DEFAULT_CODES[key]
 else:

=== modified file 'openlp/core/projectors/pjlink.py'
--- openlp/core/projectors/pjlink.py	2017-11-24 19:08:23 +
+++ openlp/core/projectors/pjlink.py	2017-12-05 00:43:50 +
@@ -58,8 +58,7 @@
 E_AUTHENTICATION, E_CONNECTION_REFUSED, E_GENERAL, E_INVALID_DATA, E_NETWORK, E_NOT_CONNECTED, E_OK, \
 E_PARAMETER, E_PROJECTOR, E_SOCKET_TIMEOUT, E_UNAVAILABLE, E_UNDEFINED, PJLINK_ERRORS, PJLINK_ERST_DATA, \
 PJLINK_ERST_STATUS, PJLINK_MAX_PACKET, PJLINK_PORT, PJLINK_POWR_STATUS, PJLINK_VALID_CMD, \
-STATUS_STRING, S_CONNECTED, S_CONNECTING, S_INFO, S_NETWORK_RECEIVED, S_NETWORK_SENDING, \
-S_NOT_CONNECTED, S_OFF, S_OK, S_ON, S_STATUS
+STATUS_STRING, S_CONNECTED, S_CONNECTING, S_INFO, S_NOT_CONNECTED, S_OFF, S_OK, S_ON, S_QSOCKET_STATE, S_STATUS
 
 log = logging.getLogger(__name__)
 log.debug('pjlink loaded')
@@ -123,7 +122,8 @@
 'INST': self.process_inst,
 'LAMP': self.process_lamp,
 'NAME': self.process_name,
-'PJLINK': self.check_login,
+'PJLINK': self.process_pjlink,
+# 'PJLINK': self.check_login,
 'POWR': self.process_powr,
 'SNUM': self.process_snum,
 'SVER': self.process_sver,
@@ -135,7 +135,8 @@
 """
 Initialize instance variables. Also used to reset projector-specific information to default.
 """
-log.debug('({ip}) rese

[Openlp-core] [Bug 1562566] Re: Projector manager exception when connecting

2017-11-28 Thread Ken Roberts
Fix for this was committed and released in version 2.4.1

** Changed in: openlp
   Status: New => Fix Released

-- 
You received this bug notification because you are a member of OpenLP
Core, which is subscribed to OpenLP.
https://bugs.launchpad.net/bugs/1562566

Title:
  Projector manager exception when connecting

Status in OpenLP:
  Fix Released

Bug description:
  Fedora 23 (fresh install with updates)
  OpenLP 2.4 (copr repo)

  - Create projector manager instance for projector
  - Click on projector item to connect

  Traceback (most recent call last):
File 
"/usr/lib/python3.4/site-packages/openlp/core/lib/projector/pjlink1.py", line 
518, in _send_command
  sent = self.write(out)
  TypeError: QIODevice.write(QByteArray): argument 1 has unexpected type 'str'

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
File 
"/usr/lib/python3.4/site-packages/openlp/core/lib/projector/pjlink1.py", line 
355, in check_login
  self.send_command(cmd='CLSS', salt=salt)
File 
"/usr/lib/python3.4/site-packages/openlp/core/lib/projector/pjlink1.py", line 
474, in send_command
  return self._send_command(data=out)
File 
"/usr/lib/python3.4/site-packages/openlp/core/lib/projector/pjlink1.py", line 
524, in _send_command
  except SocketError as e:
  TypeError: catching classes that do not inherit from BaseException is not 
allowed

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1562566/+subscriptions

___
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] [Bug 1562566] Re: Projector manager exception when connecting

2017-11-25 Thread Ken Roberts
To expand - the fix was merged in r2622 in 2016-03-03

-- 
You received this bug notification because you are a member of OpenLP
Core, which is subscribed to OpenLP.
https://bugs.launchpad.net/bugs/1562566

Title:
  Projector manager exception when connecting

Status in OpenLP:
  New

Bug description:
  Fedora 23 (fresh install with updates)
  OpenLP 2.4 (copr repo)

  - Create projector manager instance for projector
  - Click on projector item to connect

  Traceback (most recent call last):
File 
"/usr/lib/python3.4/site-packages/openlp/core/lib/projector/pjlink1.py", line 
518, in _send_command
  sent = self.write(out)
  TypeError: QIODevice.write(QByteArray): argument 1 has unexpected type 'str'

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
File 
"/usr/lib/python3.4/site-packages/openlp/core/lib/projector/pjlink1.py", line 
355, in check_login
  self.send_command(cmd='CLSS', salt=salt)
File 
"/usr/lib/python3.4/site-packages/openlp/core/lib/projector/pjlink1.py", line 
474, in send_command
  return self._send_command(data=out)
File 
"/usr/lib/python3.4/site-packages/openlp/core/lib/projector/pjlink1.py", line 
524, in _send_command
  except SocketError as e:
  TypeError: catching classes that do not inherit from BaseException is not 
allowed

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1562566/+subscriptions

___
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] [Bug 1562566] Re: Projector manager exception when connecting

2017-11-25 Thread Ken Roberts
kellwin - is there a change in 2.4 that I'm not aware of? This problem
was fixed last year.

Also, Fedora 23 is no longer supported - plus the latest version in the
2.4 series is 2.4.6. Unfortunately, the fix may have to be to manually
download the package for a later version of Fedora, find any new
dependencies, then manually install the newer version of OpenLP.

-- 
You received this bug notification because you are a member of OpenLP
Core, which is subscribed to OpenLP.
https://bugs.launchpad.net/bugs/1562566

Title:
  Projector manager exception when connecting

Status in OpenLP:
  New

Bug description:
  Fedora 23 (fresh install with updates)
  OpenLP 2.4 (copr repo)

  - Create projector manager instance for projector
  - Click on projector item to connect

  Traceback (most recent call last):
File 
"/usr/lib/python3.4/site-packages/openlp/core/lib/projector/pjlink1.py", line 
518, in _send_command
  sent = self.write(out)
  TypeError: QIODevice.write(QByteArray): argument 1 has unexpected type 'str'

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
File 
"/usr/lib/python3.4/site-packages/openlp/core/lib/projector/pjlink1.py", line 
355, in check_login
  self.send_command(cmd='CLSS', salt=salt)
File 
"/usr/lib/python3.4/site-packages/openlp/core/lib/projector/pjlink1.py", line 
474, in send_command
  return self._send_command(data=out)
File 
"/usr/lib/python3.4/site-packages/openlp/core/lib/projector/pjlink1.py", line 
524, in _send_command
  except SocketError as e:
  TypeError: catching classes that do not inherit from BaseException is not 
allowed

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1562566/+subscriptions

___
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/bug-1734275 into lp:openlp

2017-11-24 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/bug-1734275 into 
lp:openlp.

Commit message:
Bugfix 1734275 - PJLink non-standard response to LAMP command

Requested reviews:
  Phill (phill-ridout)
  Tim Bentley (trb143)
Related bugs:
  Bug #1734275 in OpenLP: "Non-standard PJLink reply to LAMP command"
  https://bugs.launchpad.net/openlp/+bug/1734275

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/bug-1734275/+merge/334265

- Fix non-standard LAMP response (bug 1734275)
- Moved bugfix tests to separate file
- Added test for non-standard LAMP response
- Refactor mocks
- Cleanups


lp:~alisonken1/openlp/bug-1734275 (revision 2792)
https://ci.openlp.io/job/Branch-01-Pull/2312/  [SUCCESS]
https://ci.openlp.io/job/Branch-02-Functional-Tests/2213/  [SUCCESS]
https://ci.openlp.io/job/Branch-03-Interface-Tests/2089/   [SUCCESS]
https://ci.openlp.io/job/Branch-04a-Code_Analysis/1415/[SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test_Coverage/1237/[SUCCESS]
https://ci.openlp.io/job/Branch-04c-Code_Analysis2/367/[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/198/ [FAILURE]


-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/projectors/manager.py'
--- openlp/core/projectors/manager.py	2017-11-10 11:59:38 +
+++ openlp/core/projectors/manager.py	2017-11-24 19:16:10 +
@@ -672,14 +672,16 @@
data=projector.model_filter)
 count = 1
 for item in projector.link.lamp:
+if item['On'] is None:
+status = translate('OpenLP.ProjectorManager', 'Unavailable')
+elif item['On']:
+status = translate('OpenLP.ProjectorManager', 'ON')
+else:
+status = translate('OpenLP.ProjectorManager', 'OFF')
 message += '{title} {count} {status} '.format(title=translate('OpenLP.ProjectorManager',
  'Lamp'),
  count=count,
- status=translate('OpenLP.ProjectorManager',
-  'ON')
- if item['On']
- else translate('OpenLP.ProjectorManager',
-'OFF'))
+ status=status)
 
 message += '{title}: {hours}'.format(title=translate('OpenLP.ProjectorManager', 'Hours'),
   hours=item['Hours'])

=== modified file 'openlp/core/projectors/pjlink.py'
--- openlp/core/projectors/pjlink.py	2017-11-10 11:59:38 +
+++ openlp/core/projectors/pjlink.py	2017-11-24 19:16:10 +
@@ -402,17 +402,20 @@
 :param data: Lamp(s) status.
 """
 lamps = []
-data_dict = data.split()
-while data_dict:
-try:
-fill = {'Hours': int(data_dict[0]), 'On': False if data_dict[1] == '0' else True}
-except ValueError:
-# In case of invalid entry
-log.warning('({ip}) process_lamp(): Invalid data "{data}"'.format(ip=self.ip, data=data))
-return
-lamps.append(fill)
-data_dict.pop(0)  # Remove lamp hours
-data_dict.pop(0)  # Remove lamp on/off
+lamp_list = data.split()
+if len(lamp_list) < 2:
+lamps.append({'Hours': int(lamp_list[0]), 'On': None})
+else:
+while lamp_list:
+try:
+fill = {'Hours': int(lamp_list[0]), 'On': False if lamp_list[1] == '0' else True}
+except ValueError:
+# In case of invalid entry
+log.warning('({ip}) process_lamp(): Invalid data "{data}"'.format(ip=self.ip, data=data))
+return
+lamps.append(fill)
+lamp_list.pop(0)  # Remove lamp hours
+lamp_list.pop(0)  # Remove lamp on/off
 self.lamp = lamps
 return
 

=== added file 'tests/functional/openlp_core/projectors/test_projector_bugfixes_01.py'
--- tests/functional/openlp_core/projectors/test_projector_bugfixes_01.py	1970-01-01 00:00:00 +
+++ tests/functional/openlp_core/projectors/test_projector_bugfixes_01.py	2017-11-24 19:16:10 +
@

[Openlp-core] [Merge] lp:~alisonken1/openlp/bug-1734275 into lp:openlp

2017-11-24 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/bug-1734275 into lp:openlp has been 
updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/bug-1734275/+merge/334254
-- 
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/bug-1734275 into lp:openlp

2017-11-24 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/bug-1734275 into 
lp:openlp.

Commit message:
Bugfix 1734275 - PJLink non-standard response to LAMP command

Requested reviews:
  Phill (phill-ridout)
Related bugs:
  Bug #1734275 in OpenLP: "Non-standard PJLink reply to LAMP command"
  https://bugs.launchpad.net/openlp/+bug/1734275

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/bug-1734275/+merge/334254

- Fix non-standard LAMP response (bug 1734275)
- Moved bugfix tests to separate file
- Added test for non-standard LAMP response
- Refactor mocks
- Cleanups


lp:~alisonken1/openlp/bug-1734275 (revision 2792)
https://ci.openlp.io/job/Branch-01-Pull/2311/  [SUCCESS]
https://ci.openlp.io/job/Branch-02-Functional-Tests/2212/  [SUCCESS]
https://ci.openlp.io/job/Branch-03-Interface-Tests/2088/   [SUCCESS]
https://ci.openlp.io/job/Branch-04a-Code_Analysis/1414/[SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test_Coverage/1236/[SUCCESS]
https://ci.openlp.io/job/Branch-04c-Code_Analysis2/366/[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/197/ [FAILURE]

-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/projectors/manager.py'
--- openlp/core/projectors/manager.py	2017-11-10 11:59:38 +
+++ openlp/core/projectors/manager.py	2017-11-24 16:39:03 +
@@ -672,14 +672,16 @@
data=projector.model_filter)
 count = 1
 for item in projector.link.lamp:
+if item['On'] is None:
+status = translate('OpenLP.ProjectorManager', 'Unavailable')
+elif item['On']:
+status = translate('OpenLP.ProjectorManager', 'ON')
+else:
+status = translate('OpenLP.ProjectorManager', 'OFF')
 message += '{title} {count} {status} '.format(title=translate('OpenLP.ProjectorManager',
  'Lamp'),
  count=count,
- status=translate('OpenLP.ProjectorManager',
-  'ON')
- if item['On']
- else translate('OpenLP.ProjectorManager',
-'OFF'))
+ status=status)
 
 message += '{title}: {hours}'.format(title=translate('OpenLP.ProjectorManager', 'Hours'),
   hours=item['Hours'])

=== modified file 'openlp/core/projectors/pjlink.py'
--- openlp/core/projectors/pjlink.py	2017-11-10 11:59:38 +
+++ openlp/core/projectors/pjlink.py	2017-11-24 16:39:03 +
@@ -402,17 +402,20 @@
 :param data: Lamp(s) status.
 """
 lamps = []
-data_dict = data.split()
-while data_dict:
-try:
-fill = {'Hours': int(data_dict[0]), 'On': False if data_dict[1] == '0' else True}
-except ValueError:
-# In case of invalid entry
-log.warning('({ip}) process_lamp(): Invalid data "{data}"'.format(ip=self.ip, data=data))
-return
-lamps.append(fill)
-data_dict.pop(0)  # Remove lamp hours
-data_dict.pop(0)  # Remove lamp on/off
+lamp_list = data.split()
+if len(lamp_list) < 2:
+lamps.append({'Hours': int(lamp_list[0]), 'On': None})
+else:
+while lamp_list:
+try:
+fill = {'Hours': int(lamp_list[0]), 'On': False if lamp_list[1] == '0' else True}
+except ValueError:
+# In case of invalid entry
+log.warning('({ip}) process_lamp(): Invalid data "{data}"'.format(ip=self.ip, data=data))
+return
+lamps.append(fill)
+lamp_list.pop(0)  # Remove lamp hours
+lamp_list.pop(0)  # Remove lamp on/off
 self.lamp = lamps
 return
 

=== added file 'tests/functional/openlp_core/projectors/test_projector_bugfixes_01.py'
--- tests/functional/openlp_core/projectors/test_projector_bugfixes_01.py	1970-01-01 00:00:00 +
+++ tests/functional/openlp_core/projectors/test_projector_bugfixes_01.py	2017-11-24 16:39:03 +
@@ -0,0 +1,136 @@
+# -*- c

[Openlp-core] [Merge] lp:~alisonken1/openlp/bug-1734275 into lp:openlp

2017-11-24 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/bug-1734275 into lp:openlp has been 
updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/bug-1734275/+merge/334224
-- 
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/bug-1734275 into lp:openlp

2017-11-24 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/bug-1734275 into 
lp:openlp.

Commit message:
Bugfix 1734275 - PJLink non-standard response to LAMP command

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #1734275 in OpenLP: "Non-standard PJLink reply to LAMP command"
  https://bugs.launchpad.net/openlp/+bug/1734275

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/bug-1734275/+merge/334224

- Fix non-standard LAMP response (bug 1734275)
- Moved bugfix tests to separate file
- Added test for non-standard LAMP response


lp:~alisonken1/openlp/bug-1734275 (revision 2791)
https://ci.openlp.io/job/Branch-01-Pull/2309/  [SUCCESS]
https://ci.openlp.io/job/Branch-02-Functional-Tests/2210/  [SUCCESS]
https://ci.openlp.io/job/Branch-03-Interface-Tests/2086/   [SUCCESS]
https://ci.openlp.io/job/Branch-04a-Code_Analysis/1412/[SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test_Coverage/1235/[SUCCESS]
https://ci.openlp.io/job/Branch-04c-Code_Analysis2/365/[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/196/ [FAILURE]

-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/bug-1734275 into lp:openlp.
=== modified file 'openlp/core/projectors/manager.py'
--- openlp/core/projectors/manager.py	2017-11-10 11:59:38 +
+++ openlp/core/projectors/manager.py	2017-11-24 08:38:36 +
@@ -672,14 +672,16 @@
data=projector.model_filter)
 count = 1
 for item in projector.link.lamp:
+if item['On'] is None:
+onoff = translate('OpenLP.ProjectorManager', 'Unavailable')
+elif item['On']:
+onoff = translate('OpenLP.ProjectorManager', 'ON')
+else:
+onoff = translate('OpenLP.ProjectorManager', 'OFF')
 message += '{title} {count} {status} '.format(title=translate('OpenLP.ProjectorManager',
  'Lamp'),
  count=count,
- status=translate('OpenLP.ProjectorManager',
-  'ON')
- if item['On']
- else translate('OpenLP.ProjectorManager',
-'OFF'))
+ status=onoff)
 
 message += '{title}: {hours}'.format(title=translate('OpenLP.ProjectorManager', 'Hours'),
   hours=item['Hours'])

=== modified file 'openlp/core/projectors/pjlink.py'
--- openlp/core/projectors/pjlink.py	2017-11-10 11:59:38 +
+++ openlp/core/projectors/pjlink.py	2017-11-24 08:38:36 +
@@ -403,16 +403,19 @@
 """
 lamps = []
 data_dict = data.split()
-while data_dict:
-try:
-fill = {'Hours': int(data_dict[0]), 'On': False if data_dict[1] == '0' else True}
-except ValueError:
-# In case of invalid entry
-log.warning('({ip}) process_lamp(): Invalid data "{data}"'.format(ip=self.ip, data=data))
-return
-lamps.append(fill)
-data_dict.pop(0)  # Remove lamp hours
-data_dict.pop(0)  # Remove lamp on/off
+if len(data_dict) < 2:
+lamps.append({'Hours': int(data_dict[0]), 'On': None})
+else:
+while data_dict:
+try:
+fill = {'Hours': int(data_dict[0]), 'On': False if data_dict[1] == '0' else True}
+except ValueError:
+# In case of invalid entry
+log.warning('({ip}) process_lamp(): Invalid data "{data}"'.format(ip=self.ip, data=data))
+return
+lamps.append(fill)
+data_dict.pop(0)  # Remove lamp hours
+data_dict.pop(0)  # Remove lamp on/off
 self.lamp = lamps
 return
 

=== added file 'tests/functional/openlp_core/projectors/test_projector_bugfixes_01.py'
--- tests/functional/openlp_core/projectors/test_projector_bugfixes_01.py	1970-01-01 00:00:00 +
+++ tests/functional/openlp_core/projectors/test_projector_bugfixes_01.py	2017-11-24 08:38:36 +
@@ -0,0 +1,134 @@
+# -*- coding: utf-8 -*-
+# vim: autoindent shiftwidth

[Openlp-core] [Bug 1734275] Re: Non-standard PJLink reply to LAMP command

2017-11-24 Thread Ken Roberts
** Branch linked: lp:~alisonken1/openlp/bug-1734275

-- 
You received this bug notification because you are a member of OpenLP
Core, which is subscribed to OpenLP.
https://bugs.launchpad.net/bugs/1734275

Title:
  Non-standard PJLink reply to LAMP command

Status in OpenLP:
  Confirmed

Bug description:
  PJLink standard: "%1LAMP=H P"
  where: H = lamp hours : P = Lamp power on/off status
  (NOTE: "H P" may be repeated with a space separator for multiple lamps in 
equipment)

  example:
  "%1LAMP=38 0"
  where: 38 = lamp1 hours of use : 0 = lamp currently OFF

  ViewSonic Pro8500:
  "%1LAMP=38"
  where: 38 = lamp1 hours of use : Missing lamp1 power on/off status

  ==
  2017-11-23 16:14:19,840 openlp.core.lib.projector.pjlink1 
  DEBUG
  (192.168.2.2) get_data(): Checking new data "%1LAMP=38"

  2017-11-23 16:14:19,840 openlp.core.lib.projector.pjlink1 
  DEBUG
  (192.168.2.2) Processing command "LAMP"

  2017-11-23 16:14:19,840 openlp.core.OpenLP
  DEBUG
  Entering hook_exception

  2017-11-23 16:14:19,841 root  
  CRITICAL
  Traceback (most recent call last):
File "openlp\core\lib\projector\pjlink1.py", line 436, in get_data
File "openlp\core\lib\projector\pjlink1.py", line 593, in process_command
File "openlp\core\lib\projector\pjlink1.py", line 611, in process_lamp
  IndexError: list index out of range

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1734275/+subscriptions

___
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] [Bug 1734275] [NEW] Non-standard PJLink reply to LAMP command

2017-11-23 Thread Ken Roberts
Public bug reported:

PJLink standard: "%1LAMP=H P"
where: H = lamp hours : P = Lamp power on/off status
(NOTE: "H P" may be repeated with a space separator for multiple lamps in 
equipment)

example:
"%1LAMP=38 0"
where: 38 = lamp1 hours of use : 0 = lamp currently OFF

ViewSonic Pro8500:
"%1LAMP=38"
where: 38 = lamp1 hours of use : Missing lamp1 power on/off status

==
2017-11-23 16:14:19,840 openlp.core.lib.projector.pjlink1   
DEBUG
(192.168.2.2) get_data(): Checking new data "%1LAMP=38"

2017-11-23 16:14:19,840 openlp.core.lib.projector.pjlink1   
DEBUG
(192.168.2.2) Processing command "LAMP"

2017-11-23 16:14:19,840 openlp.core.OpenLP  
DEBUG
Entering hook_exception

2017-11-23 16:14:19,841 root
CRITICAL
Traceback (most recent call last):
  File "openlp\core\lib\projector\pjlink1.py", line 436, in get_data
  File "openlp\core\lib\projector\pjlink1.py", line 593, in process_command
  File "openlp\core\lib\projector\pjlink1.py", line 611, in process_lamp
IndexError: list index out of range

** Affects: openlp
 Importance: High
 Assignee: Ken Roberts (alisonken1)
 Status: Confirmed


** Tags: projector

-- 
You received this bug notification because you are a member of OpenLP
Core, which is subscribed to OpenLP.
https://bugs.launchpad.net/bugs/1734275

Title:
  Non-standard PJLink reply to LAMP command

Status in OpenLP:
  Confirmed

Bug description:
  PJLink standard: "%1LAMP=H P"
  where: H = lamp hours : P = Lamp power on/off status
  (NOTE: "H P" may be repeated with a space separator for multiple lamps in 
equipment)

  example:
  "%1LAMP=38 0"
  where: 38 = lamp1 hours of use : 0 = lamp currently OFF

  ViewSonic Pro8500:
  "%1LAMP=38"
  where: 38 = lamp1 hours of use : Missing lamp1 power on/off status

  ==
  2017-11-23 16:14:19,840 openlp.core.lib.projector.pjlink1 
  DEBUG
  (192.168.2.2) get_data(): Checking new data "%1LAMP=38"

  2017-11-23 16:14:19,840 openlp.core.lib.projector.pjlink1 
  DEBUG
  (192.168.2.2) Processing command "LAMP"

  2017-11-23 16:14:19,840 openlp.core.OpenLP
  DEBUG
  Entering hook_exception

  2017-11-23 16:14:19,841 root  
  CRITICAL
  Traceback (most recent call last):
File "openlp\core\lib\projector\pjlink1.py", line 436, in get_data
File "openlp\core\lib\projector\pjlink1.py", line 593, in process_command
File "openlp\core\lib\projector\pjlink1.py", line 611, in process_lamp
  IndexError: list index out of range

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1734275/+subscriptions

___
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-l into lp:openlp

2017-11-17 Thread Ken Roberts
Yes - some of the files were OS  mv'ed before I remembered the bzr mv.
Sorry about that. It would probably have to wait until monday if you
want me to back out the changes and try to redo them with the proper
bzr move.
Let me know if that is what you want me to try.

On Fri, Nov 17, 2017 at 8:02 AM, Phill  wrote:
> Review: Needs Information
>
> You've got a load of test files that appear to have been removed, and the 
> re-added in another place. e.g.:
>
> === removed file 'tests/functional/openlp_core/lib/test_projector_db.py'
> === added file 'tests/functional/openlp_core/projectors/test_projector_db.py'
>
> Have you moved these through the OS, rather than using bzr mv? It would keep 
> the revision history intact and produce a cleaner diff.
> --
> https://code.launchpad.net/~alisonken1/openlp/pjlink2-l/+merge/333860
> You are the owner of lp:~alisonken1/openlp/pjlink2-l.



-- 
- Ken
Registered Linux user 296561
Slackin' since 1993
Slackware Linux (http://www.slackware.com)
OpenLP - Church Projection Software
Empower Your Church http://openlp.org

https://code.launchpad.net/~alisonken1/openlp/pjlink2-l/+merge/333860
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-l into lp:openlp

2017-11-16 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/pjlink2-l into lp:openlp has been 
updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-l/+merge/333832
-- 
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-l into lp:openlp

2017-11-16 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/pjlink2-l into lp:openlp has been 
updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-l/+merge/333537
-- 
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-l into lp:openlp

2017-11-10 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/pjlink2-l into lp:openlp has been 
updated.

Commit Message changed to:

PJLink2-L updates and refactoring

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-l/+merge/333537
-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2-l into 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-l into lp:openlp

2017-11-10 Thread Ken Roberts
This merge was originally branched from trunk as of 0100 2017-11-10.
-- 
https://code.launchpad.net/~alisonken1/openlp/pjlink2-l/+merge/333537
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2-l into 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-k into lp:openlp

2017-09-22 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-k into lp:openlp.

Commit message:
PJLink2 update K

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-k/+merge/331191

PJlink2 update K

- Update notes in PJLink-Notes.odt/update PDF
- Add PJLink.get_socket() (process socket data)
- Add PJLink.get_buffer() (process non-socket data)
- Update PJLink.get_data() to work with get_socket/get_buffer
- Cleanup ProjectorManager code
- Fix incorrect note reference to song db in test_projector_db
- Fix projector tests for change to PJLink() creation
- Start PJLinkUDP class
- Remove unused pjlink2.py module
- Code oops cleanups

[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/2199/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/2102/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1989/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Code_Analysis/1359/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Test_Coverage/1192/
[SUCCESS] https://ci.openlp.io/job/Branch-04c-Code_Analysis2/322/
[FAILURE] https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/162/

-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2-k into lp:openlp.
=== modified file 'documentation/PJLink_Notes.odt'
Binary files documentation/PJLink_Notes.odt	2017-09-09 06:57:21 + and documentation/PJLink_Notes.odt	2017-09-22 12:12:22 + differ
=== modified file 'documentation/PJLink_Notes.pdf'
Binary files documentation/PJLink_Notes.pdf	2017-09-09 06:57:21 + and documentation/PJLink_Notes.pdf	2017-09-22 12:12:22 + differ
=== modified file 'openlp/core/lib/projector/db.py'
--- openlp/core/lib/projector/db.py	2017-06-25 02:21:07 +
+++ openlp/core/lib/projector/db.py	2017-09-22 12:12:22 +
@@ -341,9 +341,9 @@
 """
 old_projector = self.get_object_filtered(Projector, Projector.ip == projector.ip)
 if old_projector is not None:
-log.warning('add_new() skipping entry ip="{ip}" (Already saved)'.format(ip=old_projector.ip))
+log.warning('add_projector() skipping entry ip="{ip}" (Already saved)'.format(ip=old_projector.ip))
 return False
-log.debug('add_new() saving new entry')
+log.debug('add_projector() saving new entry')
 log.debug('ip="{ip}", name="{name}", location="{location}"'.format(ip=projector.ip,
name=projector.name,
location=projector.location))

=== modified file 'openlp/core/lib/projector/pjlink.py'
--- openlp/core/lib/projector/pjlink.py	2017-08-23 19:46:30 +
+++ openlp/core/lib/projector/pjlink.py	2017-09-22 12:12:22 +
@@ -72,6 +72,28 @@
 PJLINK_SUFFIX = CR
 
 
+class PJLinkUDP(QtNetwork.QUdpSocket):
+"""
+Socket service for PJLink UDP socket.
+"""
+# New commands available in PJLink Class 2
+pjlink_udp_commands = [
+'ACKN',  # Class 2  (cmd is SRCH)
+'ERST',  # Class 1/2
+'INPT',  # Class 1/2
+'LKUP',  # Class 2  (reply only - no cmd)
+'POWR',  # Class 1/2
+'SRCH'   # Class 2  (reply is ACKN)
+]
+
+def __init__(self, port=PJLINK_PORT):
+"""
+Initialize socket
+"""
+
+self.port = port
+
+
 class PJLinkCommands(object):
 """
 Process replies from PJLink projector.
@@ -488,7 +510,7 @@
 
 class PJLink(PJLinkCommands, QtNetwork.QTcpSocket):
 """
-Socket service for connecting to a PJLink-capable projector.
+Socket service for PJLink TCP socket.
 """
 # Signals sent by this module
 changeStatus = QtCore.pyqtSignal(str, int, str)
@@ -499,43 +521,29 @@
 projectorReceivedData = QtCore.pyqtSignal()  # Notify when received data finished processing
 projectorUpdateIcons = QtCore.pyqtSignal()  # Update the status icons on toolbar
 
-# New commands available in PJLink Class 2
-pjlink_udp_commands = [
-'ACKN',  # Class 2
-'ERST',  # Class 1 or 2
-'INPT',  # Class 1 or 2
-'LKUP',  # Class 2
-'POWR',  # Class 1 or 2
-'SRCH'   # Class 2
-]
-
-def __init__(self, port=PJLINK_PORT, *args, **kwargs):
+def __init__(self, projector, *args, **kwargs):
 """
 Setup for instance.
 Options should be in kwargs except for port which does have a default.
 
-:param name: Display name
-:param ip: IP address to connect to
-:param port: Port to use. Default to PJLINK_PORT
-:param pin: Access pin (if needed)
+:param projector: Database record of projector
 
 Optional parameters
-:param dbid: Datab

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-j into lp:openlp

2017-09-09 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-j into lp:openlp.

Commit message:
Add PJLink notes - updated bzrignore for eric IDE

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-j/+merge/330472

No code changes.

- Added PJLink programming notes as openlp/documentation/PJlink_Notes.odt and 
PJlink_Notes.pdf
- Update .bzrignore for eric IDE multiple versions


lp:~alisonken1/openlp/pjlink2-j (revision 2765)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/2186/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/2089/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1976/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Code_Analysis/1346/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Test_Coverage/1182/
[SUCCESS] https://ci.openlp.io/job/Branch-04c-Code_Analysis2/312/
[FAILURE] https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/154/

-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2-j into lp:openlp.
=== modified file '.bzrignore'
--- .bzrignore	2016-08-13 14:29:12 +
+++ .bzrignore	2017-09-09 07:08:46 +
@@ -1,11 +1,9 @@
 *.pyc
 *.*~
 \#*\#
-*.eric4project
-*.eric5project
+*eric[1-9]project
 *.ropeproject
 *.e4*
-.eric4project
 .komodotools
 *.komodoproject
 list
@@ -17,7 +15,6 @@
 OpenLP.egg-info
 build
 resources/innosetup/Output
-_eric4project
 .pylint.d
 *.qm
 openlp/core/resources.py.old

=== added file 'documentation/PJLink_Notes.odt'
Binary files documentation/PJLink_Notes.odt	1970-01-01 00:00:00 + and documentation/PJLink_Notes.odt	2017-09-09 07:08:46 + differ
=== added file 'documentation/PJLink_Notes.pdf'
Binary files documentation/PJLink_Notes.pdf	1970-01-01 00:00:00 + and documentation/PJLink_Notes.pdf	2017-09-09 07:08:46 + differ
___
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-i into lp:openlp

2017-08-12 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-i into lp:openlp.

Commit message:
PJLink2 update I

Requested reviews:
  Tim Bentley (trb143)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-i/+merge/328951

More minor code cleanups

- Renamed get_shutter_status to get_av_mute_status (checks shutter and audio)
- Renamed shutter/audio mute test
- Update socket read to get 1K bytes in buffer
- Updated get_status for valid input
- Updated process_sver check valid length
- Update change_status to not use NETWORK_SENDING as a connection status check
- Added read check for packet length > allowed max
- Added test for process_inf1
- Added test for process_inf2
- Added test for process_info
- Added test for process_inst
- Added test for process_lamp with invalid data
- Update tests for process_powr
- Added test for process_powr_invalid
- Added tests for process_sver
- Added tests for change_status
- Added test for get_av_mute_status
- Added test for get_available_inputs
- Added test for get_error_status
- Added test for get_input_source
- Added test for get_lamp_status
- Added test for get_manufacturer
- Added test for get_model
- Added test for get_name
- Added test for get_other_info
- Added test for get_power_status
- Added tests for get_status
- Added test for process_inf1
- Added test for get_process_inf2
- Added test for get_process_info
- Added test for reset_information
- Fix deprecated log calls


lp:~alisonken1/openlp/pjlink2-i (revision 2760)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/2162/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/2067/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1955/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Code_Analysis/1328/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Test_Coverage/1166/
[SUCCESS] https://ci.openlp.io/job/Branch-04c-Code_Analysis2/296/
[FAILURE] https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/141/

-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/projector/pjlink.py'
--- openlp/core/lib/projector/pjlink.py	2017-08-11 11:04:33 +
+++ openlp/core/lib/projector/pjlink.py	2017-08-12 21:17:39 +
@@ -57,7 +57,7 @@
 E_AUTHENTICATION, E_CONNECTION_REFUSED, E_GENERAL, E_INVALID_DATA, E_NETWORK, E_NOT_CONNECTED, E_OK, \
 E_PARAMETER, E_PROJECTOR, E_SOCKET_TIMEOUT, E_UNAVAILABLE, E_UNDEFINED, PJLINK_ERRORS, PJLINK_ERST_DATA, \
 PJLINK_ERST_STATUS, PJLINK_MAX_PACKET, PJLINK_PORT, PJLINK_POWR_STATUS, PJLINK_VALID_CMD, \
-STATUS_STRING, S_CONNECTED, S_CONNECTING, S_NETWORK_RECEIVED, S_NETWORK_SENDING, \
+STATUS_STRING, S_CONNECTED, S_CONNECTING, S_INFO, S_NETWORK_RECEIVED, S_NETWORK_SENDING, \
 S_NOT_CONNECTED, S_OFF, S_OK, S_ON, S_STATUS
 
 # Shortcuts
@@ -159,7 +159,7 @@
 # A command returned successfully, no further processing needed
 return
 elif _cmd not in self.pjlink_functions:
-log.warn("({ip}) Unable to process command='{cmd}' (Future option)".format(ip=self.ip, cmd=cmd))
+log.warning("({ip}) Unable to process command='{cmd}' (Future option)".format(ip=self.ip, cmd=cmd))
 return
 elif _data in PJLINK_ERRORS:
 # Oops - projector error
@@ -231,7 +231,7 @@
 #: Received: '%1CLSS=Class 1'  (Optoma)
 #: Received: '%1CLSS=Version1'  (BenQ)
 if len(data) > 1:
-log.warn("({ip}) Non-standard CLSS reply: '{data}'".format(ip=self.ip, data=data))
+log.warning("({ip}) Non-standard CLSS reply: '{data}'".format(ip=self.ip, data=data))
 # Due to stupid projectors not following standards (Optoma, BenQ comes to mind),
 # AND the different responses that can be received, the semi-permanent way to
 # fix the class reply is to just remove all non-digit characters.
@@ -261,15 +261,15 @@
 """
 if len(data) != PJLINK_ERST_DATA['DATA_LENGTH']:
 count = PJLINK_ERST_DATA['DATA_LENGTH']
-log.warn("{ip}) Invalid error status response '{data}': length != {count}".format(ip=self.ip,
-  data=data,
-  count=count))
+log.warning("{ip}) Invalid error status response '{data}': length != {count}".format(ip=self.ip,
+ data=data,
+ count=count))
 return
 try:
 datacheck = int(data)
 except ValueError:
 # Bad data - ignore
-log.

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-i into lp:openlp

2017-08-12 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/pjlink2-i into lp:openlp has been 
updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-i/+merge/328949
-- 
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-i into lp:openlp

2017-08-12 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-i into lp:openlp.

Commit message:
PJLink2 update I

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-i/+merge/328949

More minor code cleanups

- Renamed get_shutter_status to get_av_mute_status (checks shutter and audio)
- Renamed shutter/audio mute test
- Update socket read to get 1K bytes in buffer
- Updated get_status for valid input
- Updated process_sver check valid length
- Update change_status to not use NETWORK_SENDING as a connection status check
- Added read check for packet length > allowed max
- Added test for process_inf1
- Added test for process_inf2
- Added test for process_info
- Added test for process_inst
- Added test for process_lamp with invalid data
- Update tests for process_powr
- Added test for process_powr_invalid
- Added tests for process_sver
- Added tests for change_status
- Added test for get_av_mute_status
- Added test for get_available_inputs
- Added test for get_error_status
- Added test for get_input_source
- Added test for get_lamp_status
- Added test for get_manufacturer
- Added test for get_model
- Added test for get_name
- Added test for get_other_info
- Added test for get_power_status
- Added tests for get_status
- Added test for process_inf1
- Added test for get_process_inf2
- Added test for get_process_info
- Added test for reset_information


lp:~alisonken1/openlp/pjlink2-i (revision 2759)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/2138/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/2045/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1949/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Code_Analysis/1326/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Test_Coverage/1164/
[SUCCESS] https://ci.openlp.io/job/Branch-04c-Code_Analysis2/294/
[FAILURE] https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/139/

-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2-i into lp:openlp.
=== modified file 'openlp/core/lib/projector/pjlink.py'
--- openlp/core/lib/projector/pjlink.py	2017-08-11 11:04:33 +
+++ openlp/core/lib/projector/pjlink.py	2017-08-12 10:38:14 +
@@ -57,7 +57,7 @@
 E_AUTHENTICATION, E_CONNECTION_REFUSED, E_GENERAL, E_INVALID_DATA, E_NETWORK, E_NOT_CONNECTED, E_OK, \
 E_PARAMETER, E_PROJECTOR, E_SOCKET_TIMEOUT, E_UNAVAILABLE, E_UNDEFINED, PJLINK_ERRORS, PJLINK_ERST_DATA, \
 PJLINK_ERST_STATUS, PJLINK_MAX_PACKET, PJLINK_PORT, PJLINK_POWR_STATUS, PJLINK_VALID_CMD, \
-STATUS_STRING, S_CONNECTED, S_CONNECTING, S_NETWORK_RECEIVED, S_NETWORK_SENDING, \
+STATUS_STRING, S_CONNECTED, S_CONNECTING, S_INFO, S_NETWORK_RECEIVED, S_NETWORK_SENDING, \
 S_NOT_CONNECTED, S_OFF, S_OK, S_ON, S_STATUS
 
 # Shortcuts
@@ -467,7 +467,11 @@
 """
 Software version of projector
 """
-if self.sw_version is None:
+if len(data) > 32:
+# Defined in specs max version is 32 characters
+log.warn("Invalid software version - too long")
+return
+elif self.sw_version is None:
 log.debug("({ip}) Setting projector software version to '{data}'".format(ip=self.ip, data=data))
 self.sw_version = data
 self.db_update = True
@@ -477,7 +481,7 @@
 log.warn("({ip}) Projector software version does not match saved software version".format(ip=self.ip))
 log.warn("({ip}) Saved:'{old}'".format(ip=self.ip, old=self.sw_version))
 log.warn("({ip}) Received: '{new}'".format(ip=self.ip, new=data))
-log.warn("({ip}) NOT saving serial number".format(ip=self.ip))
+log.warn("({ip}) Saving new serial number as sw_version_received".format(ip=self.ip))
 self.sw_version_received = data
 
 
@@ -649,7 +653,9 @@
 :param status: Status/Error code
 :returns: (Status/Error code, String)
 """
-if status in ERROR_STRING:
+if not isinstance(status, int):
+return -1, 'Invalid status code'
+elif status in ERROR_STRING:
 return ERROR_STRING[status], ERROR_MSG[status]
 elif status in STATUS_STRING:
 return STATUS_STRING[status], ERROR_MSG[status]
@@ -674,7 +680,7 @@
 elif status >= S_NOT_CONNECTED and status < S_STATUS:
 self.status_connect = status
 self.projector_status = S_NOT_CONNECTED
-elif status < S_NETWORK_SENDING:
+elif status <= S_INFO:
 self.status_connect = S_CONNECTED
 self.projector_status = status
 (status_code, status_message) = self._get_status(self.status_connect)
@@ -803,7 +809,8 @@
 log.debug('({ip}) get_data():

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-h into lp:openlp

2017-08-11 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-h into lp:openlp.

Commit message:
PJLink 2 update H

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-h/+merge/328907

- Restructured AVMT to shortcut return on invalid input
- Added AVMT bad data test
- Fix AVMT tests
- Added extra logging information for CLSS errors
- Added CLSS failure tests
- Restructure ERST to not use hard-coded error breakout
- Added several ERST tests
- Fix ERST tests
- Added tests for pjlink.process_command



lp:~alisonken1/openlp/pjlink2-h (revision 2757)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/2130/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/2037/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1941/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Code_Analysis/1318/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Test_Coverage/1158/
[SUCCESS] https://ci.openlp.io/job/Branch-04c-Code_Analysis2/288/
[FAILURE] https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/133/

-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2-h into lp:openlp.
=== modified file 'openlp/core/lib/projector/constants.py'
--- openlp/core/lib/projector/constants.py	2017-08-06 07:23:26 +
+++ openlp/core/lib/projector/constants.py	2017-08-11 11:14:30 +
@@ -46,7 +46,7 @@
'S_NOT_CONNECTED', 'S_CONNECTING', 'S_CONNECTED',
'S_STATUS', 'S_OFF', 'S_INITIALIZE', 'S_STANDBY', 'S_WARMUP', 'S_ON', 'S_COOLDOWN',
'S_INFO', 'S_NETWORK_SENDING', 'S_NETWORK_RECEIVED',
-   'ERROR_STRING', 'CR', 'LF', 'PJLINK_ERST_STATUS', 'PJLINK_POWR_STATUS',
+   'ERROR_STRING', 'CR', 'LF', 'PJLINK_ERST_DATA', 'PJLINK_ERST_STATUS', 'PJLINK_POWR_STATUS',
'PJLINK_PORT', 'PJLINK_MAX_PACKET', 'TIMEOUT', 'ERROR_MSG', 'PJLINK_ERRORS',
'STATUS_STRING', 'PJLINK_VALID_CMD', 'CONNECTION_ERRORS',
'PJLINK_DEFAULT_SOURCES', 'PJLINK_DEFAULT_CODES', 'PJLINK_DEFAULT_ITEMS']
@@ -393,11 +393,32 @@
 S_NETWORK_RECEIVED: translate('OpenLP.ProjectorConstants', 'Received data')
 }
 
+# Map ERST return code positions to equipment
+PJLINK_ERST_DATA = {
+'DATA_LENGTH': 6,
+0: 'FAN',
+1: 'LAMP',
+2: 'TEMP',
+3: 'COVER',
+4: 'FILTER',
+5: 'OTHER',
+'FAN': 0,
+'LAMP': 1,
+'TEMP': 2,
+'COVER': 3,
+'FILTER': 4,
+'OTHER': 5
+}
+
 # Map for ERST return codes to string
 PJLINK_ERST_STATUS = {
-'0': ERROR_STRING[E_OK],
+'0': 'OK',
 '1': ERROR_STRING[E_WARN],
-'2': ERROR_STRING[E_ERROR]
+'2': ERROR_STRING[E_ERROR],
+'OK': '0',
+E_OK: '0',
+E_WARN: '1',
+E_ERROR: '2'
 }
 
 # Map for POWR return codes to status code

=== modified file 'openlp/core/lib/projector/pjlink.py'
--- openlp/core/lib/projector/pjlink.py	2017-08-06 23:33:53 +
+++ openlp/core/lib/projector/pjlink.py	2017-08-11 11:14:30 +
@@ -54,8 +54,8 @@
 
 from openlp.core.common import translate, qmd5_hash
 from openlp.core.lib.projector.constants import CONNECTION_ERRORS, CR, ERROR_MSG, ERROR_STRING, \
-E_AUTHENTICATION, E_CONNECTION_REFUSED, E_GENERAL, E_INVALID_DATA, E_NETWORK, E_NOT_CONNECTED, \
-E_PARAMETER, E_PROJECTOR, E_SOCKET_TIMEOUT, E_UNAVAILABLE, E_UNDEFINED, PJLINK_ERRORS, \
+E_AUTHENTICATION, E_CONNECTION_REFUSED, E_GENERAL, E_INVALID_DATA, E_NETWORK, E_NOT_CONNECTED, E_OK, \
+E_PARAMETER, E_PROJECTOR, E_SOCKET_TIMEOUT, E_UNAVAILABLE, E_UNDEFINED, PJLINK_ERRORS, PJLINK_ERST_DATA, \
 PJLINK_ERST_STATUS, PJLINK_MAX_PACKET, PJLINK_PORT, PJLINK_POWR_STATUS, PJLINK_VALID_CMD, \
 STATUS_STRING, S_CONNECTED, S_CONNECTING, S_NETWORK_RECEIVED, S_NETWORK_SENDING, \
 S_NOT_CONNECTED, S_OFF, S_OK, S_ON, S_STATUS
@@ -154,39 +154,37 @@
 if _cmd not in PJLINK_VALID_CMD:
 log.error("({ip}) Ignoring command='{cmd}' (Invalid/Unknown)".format(ip=self.ip, cmd=cmd))
 return
+elif _data == 'OK':
+log.debug('({ip}) Command "{cmd}" returned OK'.format(ip=self.ip, cmd=cmd))
+# A command returned successfully, no further processing needed
+return
 elif _cmd not in self.pjlink_functions:
 log.warn("({ip}) Unable to process command='{cmd}' (Future option)".format(ip=self.ip, cmd=cmd))
 return
 elif _data in PJLINK_ERRORS:
 # Oops - projector error
 log.error('({ip}) Projector returned error "{data}"'.format(ip=self.ip, data=data))
-if _data == 'ERRA':
+if _data == PJLINK_ERRORS[E_AUTHENTICATION]:
 # Authentication error
 self.disconnect_from_host()
 self.change_status(E_AUTHENTICATION)
 log.debug('({ip}) emitting projectorAuthentication() signal'.format(ip=self.ip))
 sel

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2g into lp:openlp

2017-08-06 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2g into lp:openlp.

Commit message:
PJLink2 update  G

Requested reviews:
  Tim Bentley (trb143)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2g/+merge/328640

- Break PJLink class into base class and process commands class
- Restructure class methods
- Break projector PJLink tests into pjlink_base and pjlink_commands
- Restructure test methods
- Remove unused test imports
- Rename several tests
- Remove extraneous test (test_projector_return_ok)
- Added tests for process_erst reply

So much for no code changes this update :).
- Convert AVMT check to use dict instead of if..elif
- Fix AVMT test


lp:~alisonken1/openlp/pjlink2g (revision 2758)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/2119/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/2029/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1936/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Code_Analysis/1313/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Test_Coverage/1156/
[SUCCESS] https://ci.openlp.io/job/Branch-04c-Code_Analysis2/286/
[SUCCESS] https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/131/

-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/__init__.py'
--- openlp/core/lib/__init__.py	2017-05-20 05:51:58 +
+++ openlp/core/lib/__init__.py	2017-08-07 00:18:34 +
@@ -621,5 +621,5 @@
 from .renderer import Renderer
 from .mediamanageritem import MediaManagerItem
 from .projector.db import ProjectorDB, Projector
-from .projector.pjlink1 import PJLink
+from .projector.pjlink import PJLink
 from .projector.constants import PJLINK_PORT, ERROR_MSG, ERROR_STRING

=== modified file 'openlp/core/lib/projector/constants.py'
--- openlp/core/lib/projector/constants.py	2017-06-09 12:12:39 +
+++ openlp/core/lib/projector/constants.py	2017-08-07 00:18:34 +
@@ -154,7 +154,7 @@
  },
 'SRCH': {'version': ['2', ],
  'description': translate('OpenLP.PJLinkConstants',
-  'UDP broadcast search request for available projectors.')
+  'UDP broadcast search request for available projectors. Reply is ACKN.')
  },
 'SVER': {'version': ['2', ],
  'description': translate('OpenLP.PJLinkConstants',

=== renamed file 'openlp/core/lib/projector/pjlink1.py' => 'openlp/core/lib/projector/pjlink.py'
--- openlp/core/lib/projector/pjlink1.py	2017-07-20 15:31:50 +
+++ openlp/core/lib/projector/pjlink.py	2017-08-07 00:18:34 +
@@ -20,14 +20,17 @@
 # Temple Place, Suite 330, Boston, MA 02111-1307 USA  #
 ###
 """
-:mod:`openlp.core.lib.projector.pjlink1` module
+:mod:`openlp.core.lib.projector.pjlink` module
 Provides the necessary functions for connecting to a PJLink-capable projector.
 
-See PJLink Class 1 Specifications for details.
-http://pjlink.jbmia.or.jp/english/dl.html
-
-Section 5-1 PJLink Specifications
-
+PJLink Class 1 Specifications.
+http://pjlink.jbmia.or.jp/english/dl_class1.html
+Section 5-1 PJLink Specifications
+Section 5-5 Guidelines for Input Terminals
+
+PJLink Class 2 Specifications.
+http://pjlink.jbmia.or.jp/english/dl_class2.html
+Section 5-1 PJLink Specifications
 Section 5-5 Guidelines for Input Terminals
 
 NOTE:
@@ -40,7 +43,7 @@
 import logging
 log = logging.getLogger(__name__)
 
-log.debug('pjlink1 loaded')
+log.debug('pjlink loaded')
 
 __all__ = ['PJLink']
 
@@ -69,7 +72,403 @@
 PJLINK_SUFFIX = CR
 
 
-class PJLink(QtNetwork.QTcpSocket):
+class PJLinkCommands(object):
+"""
+Process replies from PJLink projector.
+"""
+
+def __init__(self, *args, **kwargs):
+"""
+Setup for the process commands
+"""
+log.debug('PJlinkCommands(args={args} kwargs={kwargs})'.format(args=args, kwargs=kwargs))
+super().__init__()
+# Map command to function
+self.pjlink_functions = {
+'AVMT': self.process_avmt,
+'CLSS': self.process_clss,
+'ERST': self.process_erst,
+'INFO': self.process_info,
+'INF1': self.process_inf1,
+'INF2': self.process_inf2,
+'INPT': self.process_inpt,
+'INST': self.process_inst,
+'LAMP': self.process_lamp,
+'NAME': self.process_name,
+'PJLINK': self.check_login,
+'POWR': self.process_powr,
+'SNUM': self.process_snum,
+'SVER': self.process_sver,
+'RFIL': self.process_rfil,
+'RLMP': self.process_rlmp
+}
+
+def reset_information(self):
+"""
+  

Re: [Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2g into lp:openlp

2017-08-06 Thread Ken Roberts
Other than tests - there should be no new code here, only restructured code.
-- 
https://code.launchpad.net/~alisonken1/openlp/pjlink2g/+merge/328634
Your team OpenLP Core is requested to review the proposed merge of 
lp:~alisonken1/openlp/pjlink2g into 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-f into lp:openlp

2017-07-20 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-f into lp:openlp.

Commit message:
PJLink class 2 update F

Requested reviews:
  Tomas Groth (tomasgroth)
  Raoul Snyman (raoul-snyman)
  Tim Bentley (trb143)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-f/+merge/327801

-- Renamed test_projector_clss to clss_one
-- Added test_projector_clss_two
-- Updated  PJLink non-standard class check
-- Added process_snum
-- Added tests for process_snum
-- Renamed tests/functional/openlp_core_lib/test_projectordb.py to 
test_projector_db.py
-- Added filter model command (rfil) -- Added lamp model command (rlmp)
-- Added tests for filter/model commands
-- Fix typo in projector status window
-- Cleanups from commit notes
-- Added invalid data buffer cleanups
-- Added calls to new functions


lp:~alisonken1/openlp/pjlink2-f (revision 2758)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/2106/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/2016/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1927/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Code_Analysis/1304/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Test_Coverage/1149/
[SUCCESS] https://ci.openlp.io/job/Branch-04c-Code_Analysis2/278/
[SUCCESS] https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/123/

-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/projector/db.py'
--- openlp/core/lib/projector/db.py	2017-06-01 22:35:57 +
+++ openlp/core/lib/projector/db.py	2017-07-20 15:40:24 +
@@ -303,7 +303,7 @@
 :param ip: Host IP/Name
 :returns: Projector() instance
 """
-log.debug('get_projector_by_ip(ip="%s")' % ip)
+log.debug('get_projector_by_ip(ip="{ip}")'.format(ip=ip))
 projector = self.get_object_filtered(Projector, Projector.ip == ip)
 if projector is None:
 # Not found

=== modified file 'openlp/core/lib/projector/pjlink1.py'
--- openlp/core/lib/projector/pjlink1.py	2017-06-17 00:25:06 +
+++ openlp/core/lib/projector/pjlink1.py	2017-07-20 15:40:24 +
@@ -44,6 +44,7 @@
 
 __all__ = ['PJLink']
 
+import re
 from codecs import decode
 
 from PyQt5 import QtCore, QtNetwork
@@ -53,7 +54,7 @@
 E_AUTHENTICATION, E_CONNECTION_REFUSED, E_GENERAL, E_INVALID_DATA, E_NETWORK, E_NOT_CONNECTED, \
 E_PARAMETER, E_PROJECTOR, E_SOCKET_TIMEOUT, E_UNAVAILABLE, E_UNDEFINED, PJLINK_ERRORS, \
 PJLINK_ERST_STATUS, PJLINK_MAX_PACKET, PJLINK_PORT, PJLINK_POWR_STATUS, PJLINK_VALID_CMD, \
-PJLINK_DEFAULT_CODES, STATUS_STRING, S_CONNECTED, S_CONNECTING, S_NETWORK_RECEIVED, S_NETWORK_SENDING, \
+STATUS_STRING, S_CONNECTED, S_CONNECTING, S_NETWORK_RECEIVED, S_NETWORK_SENDING, \
 S_NOT_CONNECTED, S_OFF, S_OK, S_ON, S_STATUS
 
 # Shortcuts
@@ -113,8 +114,13 @@
 self.port = port
 self.pin = pin
 super().__init__()
+self.model_lamp = None
+self.model_filter = None
 self.mac_adx = kwargs.get('mac_adx')
+self.serial_no = None
+self.serial_no_received = None  # Used only if saved serial number is different than received serial number
 self.dbid = None
+self.db_update = False  # Use to check if db needs to be updated prior to exiting
 self.location = None
 self.notes = None
 self.dbid = kwargs.get('dbid')
@@ -158,7 +164,11 @@
 'LAMP': self.process_lamp,
 'NAME': self.process_name,
 'PJLINK': self.check_login,
-'POWR': self.process_powr
+'POWR': self.process_powr,
+'SNUM': self.process_snum,
+'SVER': self.process_sver,
+'RFIL': self.process_rfil,
+'RLMP': self.process_rlmp
 }
 
 def reset_information(self):
@@ -166,12 +176,16 @@
 Reset projector-specific information to default
 """
 log.debug('({ip}) reset_information() connect status is {state}'.format(ip=self.ip, state=self.state()))
+self.send_queue = []
 self.power = S_OFF
 self.pjlink_name = None
 self.manufacturer = None
 self.model = None
 self.serial_no = None
+self.serial_no_received = None
 self.sw_version = None
+self.sw_version_received = None
+self.mac_adx = None
 self.shutter = None
 self.mute = None
 self.lamp = None
@@ -188,7 +202,6 @@
 if hasattr(self, 'socket_timer'):
 log.debug('({ip}): Calling socket_timer.stop()'.format(ip=self.ip))
 self.socket_timer.stop()
-self.send_queue = []
 self.send_busy = False
 
 def thread_started(self):
@@ -240,6 +253,7 @@
 Normally called by timer().
 """
 if self.state() != self.ConnectedState:
+log.warn("({ip}) poll_loop(): Not connected - retur

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-f into lp:openlp

2017-07-20 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/pjlink2-f into lp:openlp has been 
updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-f/+merge/327290
-- 
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-f into lp:openlp

2017-07-17 Thread Ken Roberts
The functions defined are laying the groundwork. The functions will be
called from the "self.pjlink_functions" defined at line 155.


at this point, I'm working on the changes incrementally - plus, trying
to do some refactoring at the same time. Since the update to PJLink
Class 2 is rather large, I'm trying to keep the actual merges somewhat
manageable by keeping them limited per merge.

On Mon, Jul 17, 2017 at 1:35 PM, Tim Bentley  wrote:
> Review: Needs Fixing
>
> See inline comments.
> Please fix the commit comments to reflect the changes as they refer to #noqa 
> which has been removed.  (There may be more).
>
> Diff comments:
>
>>
>> === modified file 'openlp/core/lib/projector/pjlink1.py'
>> --- openlp/core/lib/projector/pjlink1.py  2017-06-17 00:25:06 +
>> +++ openlp/core/lib/projector/pjlink1.py  2017-07-12 13:16:20 +
>> @@ -262,6 +277,38 @@
>>  self.send_command('INF2', queue=True)
>>  if self.pjlink_name is None:
>>  self.send_command('NAME', queue=True)
>> +if self.pjlink_class == '2':
>> +# Class 2 specific checks
>> +if self.serial_no is None:
>> +self.send_command('SNUM', queue=True)
>> +if self.sw_version is None:
>> +self.send_command('SVER', queue=True)
>> +if self.model_filter is None:
>> +self.send_command('RFIL', queue=True)
>> +if self.model_lamp is None:
>> +self.send_command('RLMP', queue=True)
>> +
>> +def process_rfil(self, data):
>
> Where is this called from?
>
>> +"""
>> +Process replacement filter type
>> +"""
>> +if self.model_filter is None:
>> +self.model_filter = data
>> +else:
>> +log.warn("({ip}) Filter model already set".format(ip=self.ip))
>> +log.warn("({ip}) Saved model: '{old}'".format(ip=self.ip, 
>> old=self.model_filter))
>> +log.warn("({ip}) New model: '{new}'".format(ip=self.ip, 
>> new=data))
>> +
>> +def process_rlmp(self, data):
>
> Where is this called from?
>
>> +"""
>> +Process replacement lamp type
>> +"""
>> +if self.model_lamp is None:
>> +self.model_lamp = data
>> +else:
>> +log.warn("({ip}) Lamp model already set".format(ip=self.ip))
>> +log.warn("({ip}) Saved lamp: '{old}'".format(ip=self.ip, 
>> old=self.model_lamp))
>> +log.warn("({ip}) New lamp: '{new}'".format(ip=self.ip, 
>> new=data))
>>
>>  def _get_status(self, status):
>>  """
>
>
> --
> https://code.launchpad.net/~alisonken1/openlp/pjlink2-f/+merge/327290
> You are the owner of lp:~alisonken1/openlp/pjlink2-f.



-- 
- Ken
Registered Linux user 296561
Slackin' since 1993
Slackware Linux (http://www.slackware.com)
OpenLP - Church Projection Software
Empower Your Church http://openlp.org

https://code.launchpad.net/~alisonken1/openlp/pjlink2-f/+merge/327290
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-f into lp:openlp

2017-07-12 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-f into lp:openlp.

Commit message:
PJLink class 2 update F

Requested reviews:
  Tim Bentley (trb143)
  Raoul Snyman (raoul-snyman)
  Tomas Groth (tomasgroth)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-f/+merge/327290

-- Added '# noqa' for flake8 to ignore specific line errors
-- Renamed test_projector_clssto clss_one
-- Added test_projector_clss_two
-- Updated  PJLink non-standard class check
-- Added process_snum
-- Added tests for process_snum
-- Renamed tests/functional/openlp_core_lib/test_projectordb.py to 
test_projector_db.py
-- Added filter model command-- Added lamp model command
-- Added lamp model command
-- Added tests for filter/model commands
-- Fix typo in projector status window
-- Cleanups from commit notes
-- Added invalid data buffer cleanups


lp:~alisonken1/openlp/pjlink2-f (revision 2756)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/2104/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/2014/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1925/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Code_Analysis/1302/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Test_Coverage/1147/
[SUCCESS] https://ci.openlp.io/job/Branch-04c-Code_Analysis2/276/
[SUCCESS] https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/121/

-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/projector/db.py'
--- openlp/core/lib/projector/db.py	2017-06-01 22:35:57 +
+++ openlp/core/lib/projector/db.py	2017-07-12 13:16:20 +
@@ -303,7 +303,7 @@
 :param ip: Host IP/Name
 :returns: Projector() instance
 """
-log.debug('get_projector_by_ip(ip="%s")' % ip)
+log.debug('get_projector_by_ip(ip="{ip}")'.format(ip=ip))
 projector = self.get_object_filtered(Projector, Projector.ip == ip)
 if projector is None:
 # Not found

=== modified file 'openlp/core/lib/projector/pjlink1.py'
--- openlp/core/lib/projector/pjlink1.py	2017-06-17 00:25:06 +
+++ openlp/core/lib/projector/pjlink1.py	2017-07-12 13:16:20 +
@@ -44,6 +44,7 @@
 
 __all__ = ['PJLink']
 
+import re
 from codecs import decode
 
 from PyQt5 import QtCore, QtNetwork
@@ -53,7 +54,7 @@
 E_AUTHENTICATION, E_CONNECTION_REFUSED, E_GENERAL, E_INVALID_DATA, E_NETWORK, E_NOT_CONNECTED, \
 E_PARAMETER, E_PROJECTOR, E_SOCKET_TIMEOUT, E_UNAVAILABLE, E_UNDEFINED, PJLINK_ERRORS, \
 PJLINK_ERST_STATUS, PJLINK_MAX_PACKET, PJLINK_PORT, PJLINK_POWR_STATUS, PJLINK_VALID_CMD, \
-PJLINK_DEFAULT_CODES, STATUS_STRING, S_CONNECTED, S_CONNECTING, S_NETWORK_RECEIVED, S_NETWORK_SENDING, \
+STATUS_STRING, S_CONNECTED, S_CONNECTING, S_NETWORK_RECEIVED, S_NETWORK_SENDING, \
 S_NOT_CONNECTED, S_OFF, S_OK, S_ON, S_STATUS
 
 # Shortcuts
@@ -113,8 +114,13 @@
 self.port = port
 self.pin = pin
 super().__init__()
+self.model_lamp = None
+self.model_filter = None
 self.mac_adx = kwargs.get('mac_adx')
+self.serial_no = None
+self.serial_no_received = None  # Used only if saved serial number is different than received serial number
 self.dbid = None
+self.db_update = False  # Use to check if db needs to be updated prior to exiting
 self.location = None
 self.notes = None
 self.dbid = kwargs.get('dbid')
@@ -158,7 +164,9 @@
 'LAMP': self.process_lamp,
 'NAME': self.process_name,
 'PJLINK': self.check_login,
-'POWR': self.process_powr
+'POWR': self.process_powr,
+'SNUM': self.process_snum,
+'SVER': self.process_sver
 }
 
 def reset_information(self):
@@ -166,12 +174,16 @@
 Reset projector-specific information to default
 """
 log.debug('({ip}) reset_information() connect status is {state}'.format(ip=self.ip, state=self.state()))
+self.send_queue = []
 self.power = S_OFF
 self.pjlink_name = None
 self.manufacturer = None
 self.model = None
 self.serial_no = None
+self.serial_no_received = None
 self.sw_version = None
+self.sw_version_received = None
+self.mac_adx = None
 self.shutter = None
 self.mute = None
 self.lamp = None
@@ -188,7 +200,6 @@
 if hasattr(self, 'socket_timer'):
 log.debug('({ip}): Calling socket_timer.stop()'.format(ip=self.ip))
 self.socket_timer.stop()
-self.send_queue = []
 self.send_busy = False
 
 def thread_started(self):
@@ -240,6 +251,7 @@
 Normally called by timer().
 """
 if self.state() != self.ConnectedState:
+log.warn("({ip}) poll_loop(): Not connected - returning".format(ip=self.ip))

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-f into lp:openlp

2017-07-12 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/pjlink2-f into lp:openlp has been 
updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-f/+merge/327052
-- 
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-f into lp:openlp

2017-07-12 Thread Ken Roberts
oops - thought I removed those two lines.
I also remember running jenkins, but guess I forgot to delete the
previous run from the request.

On Wed, Jul 12, 2017 at 12:30 AM, Tomas Groth  wrote:
> Review: Needs Fixing
>
> You left some commented code in, see the inline comment. Also please post the 
> jenkins test result for the latest revision.
> Otherwise it looks good to me.
>
> Diff comments:
>
>>
>> === modified file 'openlp/core/lib/projector/pjlink1.py'
>> --- openlp/core/lib/projector/pjlink1.py  2017-06-17 00:25:06 +
>> +++ openlp/core/lib/projector/pjlink1.py  2017-07-07 23:49:26 +
>> @@ -331,7 +378,8 @@
>>  self.change_status(E_SOCKET_TIMEOUT)
>>  return
>>  read = self.readLine(self.max_size)
>> -dontcare = self.readLine(self.max_size)  # Clean out the 
>> trailing \r\n
>> +# _ = self.readLine(self.max_size)  # Clean out the trailing 
>> \r\n
>
> This should be removed.
>
>> +self.readLine(self.max_size)  # Clean out the trailing \r\n
>>  if read is None:
>>  log.warning('({ip}) read is None - socket 
>> error?'.format(ip=self.ip))
>>  return
>> @@ -341,7 +389,8 @@
>>  data = decode(read, 'utf-8')
>>  # Possibility of extraneous data on input when reading.
>>  # Clean out extraneous characters in buffer.
>> -dontcare = self.readLine(self.max_size)
>> +# _ = self.readLine(self.max_size)
>
> Also this one.
>
>> +self.readLine(self.max_size)
>>  log.debug('({ip}) check_login() read 
>> "{data}"'.format(ip=self.ip, data=data.strip()))
>>  # At this point, we should only have the initial login prompt with
>>  # possible authentication
>
>
> --
> https://code.launchpad.net/~alisonken1/openlp/pjlink2-f/+merge/327052
> You are the owner of lp:~alisonken1/openlp/pjlink2-f.



-- 
- Ken
Registered Linux user 296561
Slackin' since 1993
Slackware Linux (http://www.slackware.com)
OpenLP - Church Projection Software
Empower Your Church http://openlp.org

https://code.launchpad.net/~alisonken1/openlp/pjlink2-f/+merge/327052
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-f into lp:openlp

2017-07-07 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-f into lp:openlp.

Commit message:
PJLink class 2 update F

Requested reviews:
  Tim Bentley (trb143)
  Tomas Groth (tomasgroth)
  Raoul Snyman (raoul-snyman)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-f/+merge/327052

-- Added '# noqa' for flake8 to ignore specific line errors
-- Renamed test_projector_clssto clss_one
-- Added test_projector_clss_two
-- Updated  PJLink non-standard class check
-- Added process_snum
-- Added tests for process_snum
-- Renamed tests/functional/openlp_core_lib/test_projectordb.py to 
test_projector_db.py
-- Added filter model command-- Added lamp model command
-- Added lamp model command
-- Added tests for filter/model commands
-- Fix typo in projector status window
-- Cleanups from commit notes
-- Added invalid data buffer cleanups


lp:~alisonken1/openlp/pjlink2-f (revision 2754)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/2102/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/2012/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1924/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Code_Analysis/1301/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Test_Coverage/1146/
[SUCCESS] https://ci.openlp.io/job/Branch-04c-Code_Analysis2/275/
[SUCCESS] https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/120/

-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/projector/db.py'
--- openlp/core/lib/projector/db.py	2017-06-01 22:35:57 +
+++ openlp/core/lib/projector/db.py	2017-07-07 23:49:26 +
@@ -303,7 +303,7 @@
 :param ip: Host IP/Name
 :returns: Projector() instance
 """
-log.debug('get_projector_by_ip(ip="%s")' % ip)
+log.debug('get_projector_by_ip(ip="{ip}")'.format(ip=ip))
 projector = self.get_object_filtered(Projector, Projector.ip == ip)
 if projector is None:
 # Not found

=== modified file 'openlp/core/lib/projector/pjlink1.py'
--- openlp/core/lib/projector/pjlink1.py	2017-06-17 00:25:06 +
+++ openlp/core/lib/projector/pjlink1.py	2017-07-07 23:49:26 +
@@ -44,6 +44,7 @@
 
 __all__ = ['PJLink']
 
+import re
 from codecs import decode
 
 from PyQt5 import QtCore, QtNetwork
@@ -53,7 +54,7 @@
 E_AUTHENTICATION, E_CONNECTION_REFUSED, E_GENERAL, E_INVALID_DATA, E_NETWORK, E_NOT_CONNECTED, \
 E_PARAMETER, E_PROJECTOR, E_SOCKET_TIMEOUT, E_UNAVAILABLE, E_UNDEFINED, PJLINK_ERRORS, \
 PJLINK_ERST_STATUS, PJLINK_MAX_PACKET, PJLINK_PORT, PJLINK_POWR_STATUS, PJLINK_VALID_CMD, \
-PJLINK_DEFAULT_CODES, STATUS_STRING, S_CONNECTED, S_CONNECTING, S_NETWORK_RECEIVED, S_NETWORK_SENDING, \
+STATUS_STRING, S_CONNECTED, S_CONNECTING, S_NETWORK_RECEIVED, S_NETWORK_SENDING, \
 S_NOT_CONNECTED, S_OFF, S_OK, S_ON, S_STATUS
 
 # Shortcuts
@@ -113,8 +114,13 @@
 self.port = port
 self.pin = pin
 super().__init__()
+self.model_lamp = None
+self.model_filter = None
 self.mac_adx = kwargs.get('mac_adx')
+self.serial_no = None
+self.serial_no_received = None  # Used only if saved serial number is different than received serial number
 self.dbid = None
+self.db_update = False  # Use to check if db needs to be updated prior to exiting
 self.location = None
 self.notes = None
 self.dbid = kwargs.get('dbid')
@@ -158,7 +164,9 @@
 'LAMP': self.process_lamp,
 'NAME': self.process_name,
 'PJLINK': self.check_login,
-'POWR': self.process_powr
+'POWR': self.process_powr,
+'SNUM': self.process_snum,
+'SVER': self.process_sver
 }
 
 def reset_information(self):
@@ -166,12 +174,16 @@
 Reset projector-specific information to default
 """
 log.debug('({ip}) reset_information() connect status is {state}'.format(ip=self.ip, state=self.state()))
+self.send_queue = []
 self.power = S_OFF
 self.pjlink_name = None
 self.manufacturer = None
 self.model = None
 self.serial_no = None
+self.serial_no_received = None
 self.sw_version = None
+self.sw_version_received = None
+self.mac_adx = None
 self.shutter = None
 self.mute = None
 self.lamp = None
@@ -188,7 +200,6 @@
 if hasattr(self, 'socket_timer'):
 log.debug('({ip}): Calling socket_timer.stop()'.format(ip=self.ip))
 self.socket_timer.stop()
-self.send_queue = []
 self.send_busy = False
 
 def thread_started(self):
@@ -240,6 +251,7 @@
 Normally called by timer().
 """
 if self.state() != self.ConnectedState:
+log.warn("({ip}) poll_loop(): Not connected - returning".format(ip=self.ip))

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-f into lp:openlp

2017-07-07 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/pjlink2-f into lp:openlp has been 
updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-f/+merge/326493
-- 
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-f into lp:openlp

2017-06-28 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-f into lp:openlp.

Commit message:
PJLink class 2 update F

Requested reviews:
  Tim Bentley (trb143)
  Tomas Groth (tomasgroth)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-f/+merge/326493

-- Renamed test_projector_clssto clss_one
-- Added test_projector_clss_two
-- Updated  PJLink non-standard class check
-- Added process_snum
-- Added tests for process_snum
-- Renamed tests/functional/openlp_core_lib/test_projectordb.py to 
test_projector_db.py
-- Added filter model command
-- Added lamp model command
-- Added tests for filter/model commands
--Cleanups


lp:~alisonken1/openlp/pjlink2-f (revision 2754)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/2101/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/2011/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1923/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Code_Analysis/1300/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Test_Coverage/1145/
[SUCCESS] https://ci.openlp.io/job/Branch-04c-Code_Analysis2/274/
[SUCCESS] https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/119/

-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/projector/db.py'
--- openlp/core/lib/projector/db.py	2017-06-01 22:35:57 +
+++ openlp/core/lib/projector/db.py	2017-06-29 03:25:32 +
@@ -303,7 +303,7 @@
 :param ip: Host IP/Name
 :returns: Projector() instance
 """
-log.debug('get_projector_by_ip(ip="%s")' % ip)
+log.debug('get_projector_by_ip(ip="{ip}")'.format(ip=ip))
 projector = self.get_object_filtered(Projector, Projector.ip == ip)
 if projector is None:
 # Not found

=== modified file 'openlp/core/lib/projector/pjlink1.py'
--- openlp/core/lib/projector/pjlink1.py	2017-06-17 00:25:06 +
+++ openlp/core/lib/projector/pjlink1.py	2017-06-29 03:25:32 +
@@ -44,6 +44,8 @@
 
 __all__ = ['PJLink']
 
+import re
+
 from codecs import decode
 
 from PyQt5 import QtCore, QtNetwork
@@ -53,7 +55,7 @@
 E_AUTHENTICATION, E_CONNECTION_REFUSED, E_GENERAL, E_INVALID_DATA, E_NETWORK, E_NOT_CONNECTED, \
 E_PARAMETER, E_PROJECTOR, E_SOCKET_TIMEOUT, E_UNAVAILABLE, E_UNDEFINED, PJLINK_ERRORS, \
 PJLINK_ERST_STATUS, PJLINK_MAX_PACKET, PJLINK_PORT, PJLINK_POWR_STATUS, PJLINK_VALID_CMD, \
-PJLINK_DEFAULT_CODES, STATUS_STRING, S_CONNECTED, S_CONNECTING, S_NETWORK_RECEIVED, S_NETWORK_SENDING, \
+STATUS_STRING, S_CONNECTED, S_CONNECTING, S_NETWORK_RECEIVED, S_NETWORK_SENDING, \
 S_NOT_CONNECTED, S_OFF, S_OK, S_ON, S_STATUS
 
 # Shortcuts
@@ -113,8 +115,13 @@
 self.port = port
 self.pin = pin
 super().__init__()
+self.model_lamp = None
+self.model_filter = None
 self.mac_adx = kwargs.get('mac_adx')
+self.serial_no = None
+self.serial_no_received = None  # Used only if saved serial number is different than received serial number
 self.dbid = None
+self.db_update = False  # Use to check if db needs to be updated prior to exiting
 self.location = None
 self.notes = None
 self.dbid = kwargs.get('dbid')
@@ -158,7 +165,9 @@
 'LAMP': self.process_lamp,
 'NAME': self.process_name,
 'PJLINK': self.check_login,
-'POWR': self.process_powr
+'POWR': self.process_powr,
+'SNUM': self.process_snum,
+'SVER': self.process_sver
 }
 
 def reset_information(self):
@@ -166,12 +175,16 @@
 Reset projector-specific information to default
 """
 log.debug('({ip}) reset_information() connect status is {state}'.format(ip=self.ip, state=self.state()))
+self.send_queue = []
 self.power = S_OFF
 self.pjlink_name = None
 self.manufacturer = None
 self.model = None
 self.serial_no = None
+self.serial_no_received = None
 self.sw_version = None
+self.sw_version_received = None
+self.mac_adx = None
 self.shutter = None
 self.mute = None
 self.lamp = None
@@ -188,7 +201,6 @@
 if hasattr(self, 'socket_timer'):
 log.debug('({ip}): Calling socket_timer.stop()'.format(ip=self.ip))
 self.socket_timer.stop()
-self.send_queue = []
 self.send_busy = False
 
 def thread_started(self):
@@ -249,7 +261,10 @@
 # Restart timer
 self.timer.start()
 # These commands may change during connetion
-for command in ['POWR', 'ERST', 'LAMP', 'AVMT', 'INPT']:
+check_list = ['POWR', 'ERST', 'LAMP', 'AVMT', 'INPT']
+if self.pjlink_class == '2':
+check_list.extend(['FILT', 'FREZ'])
+for command in check_list:
 self.send_command(command, queue=True)
 # The followi

[Openlp-core] [Merge] lp:~alisonken1/openlp/pjlink2-f into lp:openlp

2017-06-28 Thread Ken Roberts
The proposal to merge lp:~alisonken1/openlp/pjlink2-f into lp:openlp has been 
updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-f/+merge/326492
-- 
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-f into lp:openlp

2017-06-28 Thread Ken Roberts
Ken Roberts has proposed merging lp:~alisonken1/openlp/pjlink2-f into lp:openlp.

Commit message:
PJLink class 2 update F

Requested reviews:
  Tomas Groth (tomasgroth)
  Tim Bentley (trb143)

For more details, see:
https://code.launchpad.net/~alisonken1/openlp/pjlink2-f/+merge/326492

-- Renamed test_projector_clssto clss_one
-- Added test_projector_clss_two
-- Updated  PJLink non-standard class check
-- Added process_snum
-- Added tests for process_snum
-- Renamed tests/functional/openlp_core_lib/test_projectordb.py to 
test_projector_db.py
-- Added filter model command
-- Added lamp model command
-- Added tests for filter/model commands
--Cleanups


lp:~alisonken1/openlp/pjlink2-f (revision 2753)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/2100/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/2010/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1922/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Code_Analysis/1299/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Test_Coverage/1144/
[SUCCESS] https://ci.openlp.io/job/Branch-04c-Code_Analysis2/273/
[FAILURE] https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/118/

-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/projector/db.py'
--- openlp/core/lib/projector/db.py	2017-06-01 22:35:57 +
+++ openlp/core/lib/projector/db.py	2017-06-29 03:14:46 +
@@ -303,7 +303,7 @@
 :param ip: Host IP/Name
 :returns: Projector() instance
 """
-log.debug('get_projector_by_ip(ip="%s")' % ip)
+log.debug('get_projector_by_ip(ip="{ip}")'.format(ip=ip))
 projector = self.get_object_filtered(Projector, Projector.ip == ip)
 if projector is None:
 # Not found

=== modified file 'openlp/core/lib/projector/pjlink1.py'
--- openlp/core/lib/projector/pjlink1.py	2017-06-17 00:25:06 +
+++ openlp/core/lib/projector/pjlink1.py	2017-06-29 03:14:46 +
@@ -44,6 +44,8 @@
 
 __all__ = ['PJLink']
 
+import re
+
 from codecs import decode
 
 from PyQt5 import QtCore, QtNetwork
@@ -53,9 +55,12 @@
 E_AUTHENTICATION, E_CONNECTION_REFUSED, E_GENERAL, E_INVALID_DATA, E_NETWORK, E_NOT_CONNECTED, \
 E_PARAMETER, E_PROJECTOR, E_SOCKET_TIMEOUT, E_UNAVAILABLE, E_UNDEFINED, PJLINK_ERRORS, \
 PJLINK_ERST_STATUS, PJLINK_MAX_PACKET, PJLINK_PORT, PJLINK_POWR_STATUS, PJLINK_VALID_CMD, \
-PJLINK_DEFAULT_CODES, STATUS_STRING, S_CONNECTED, S_CONNECTING, S_NETWORK_RECEIVED, S_NETWORK_SENDING, \
+STATUS_STRING, S_CONNECTED, S_CONNECTING, S_NETWORK_RECEIVED, S_NETWORK_SENDING, \
 S_NOT_CONNECTED, S_OFF, S_OK, S_ON, S_STATUS
 
+# Possible future imports
+# from openlp.core.lib.projector.constants import PJLINK_DEFAULT_CODES
+
 # Shortcuts
 SocketError = QtNetwork.QAbstractSocket.SocketError
 SocketSTate = QtNetwork.QAbstractSocket.SocketState
@@ -113,8 +118,13 @@
 self.port = port
 self.pin = pin
 super().__init__()
+self.model_lamp = None
+self.model_filter = None
 self.mac_adx = kwargs.get('mac_adx')
+self.serial_no = None
+self.serial_no_received = None  # Used only if saved serial number is different than received serial number
 self.dbid = None
+self.db_update = False  # Use to check if db needs to be updated prior to exiting
 self.location = None
 self.notes = None
 self.dbid = kwargs.get('dbid')
@@ -158,7 +168,9 @@
 'LAMP': self.process_lamp,
 'NAME': self.process_name,
 'PJLINK': self.check_login,
-'POWR': self.process_powr
+'POWR': self.process_powr,
+'SNUM': self.process_snum,
+'SVER': self.process_sver
 }
 
 def reset_information(self):
@@ -166,12 +178,16 @@
 Reset projector-specific information to default
 """
 log.debug('({ip}) reset_information() connect status is {state}'.format(ip=self.ip, state=self.state()))
+self.send_queue = []
 self.power = S_OFF
 self.pjlink_name = None
 self.manufacturer = None
 self.model = None
 self.serial_no = None
+self.serial_no_received = None
 self.sw_version = None
+self.sw_version_received = None
+self.mac_adx = None
 self.shutter = None
 self.mute = None
 self.lamp = None
@@ -188,7 +204,6 @@
 if hasattr(self, 'socket_timer'):
 log.debug('({ip}): Calling socket_timer.stop()'.format(ip=self.ip))
 self.socket_timer.stop()
-self.send_queue = []
 self.send_busy = False
 
 def thread_started(self):
@@ -249,7 +264,10 @@
 # Restart timer
 self.timer.start()
 # These commands may change during connetion
-for command in ['POWR', 'ERST', 'LAMP', 'AVMT', 'INPT']:
+check_list = ['POWR', 'ERST', 'LAMP', '

  1   2   3   4   5   >