Re: [Openlp-core] [Merge] lp:~phill-ridout/openlp/fixes-mkIV into lp:openlp

2017-12-04 Thread Raoul Snyman
Review: Approve



Diff comments:

> 
> === added file 'tests/functional/openlp_core/lib/test_exceptions.py'
> --- tests/functional/openlp_core/lib/test_exceptions.py   1970-01-01 
> 00:00:00 +
> +++ tests/functional/openlp_core/lib/test_exceptions.py   2017-12-04 
> 21:51:22 +
> @@ -0,0 +1,45 @@
> +# -*- 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 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 
>  #
> +###
> +"""
> +Package to test the openlp.core.lib.exceptions package.
> +"""
> +from unittest import TestCase
> +
> +from openlp.core.lib.exceptions import ValidationError
> +
> +
> +class TestValidationError(TestCase):
> +"""
> +Test the ValidationError Class
> +"""
> +def test_validation_error(self):
> +"""
> +Test the creation of a ValidationError
> +"""
> +# GIVEN: The ValidationError class
> +
> +# WHEN: Creating an instance of ValidationError
> +error = ValidationError('Test ValidationError')
> +
> +# THEN: Then calling str on the error should return the correct text 
> and it should be an instance of `Exception`
> +assert str(error) == 'Test ValidationError'
> +assert isinstance(error, Exception)

I've recently come to prefer the plain assert. It makes the tests execute a lot 
faster, and if you use a more intelligent test runner than nose/nose2, you get 
even better output than with nose/nose2. (also, assert doesn't violate Python's 
own coding standards like unittest does)



-- 
https://code.launchpad.net/~phill-ridout/openlp/fixes-mkIV/+merge/334708
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}) reset_information() connect status is {state}'.format(ip=self.ip, stat

[Openlp-core] [Bug 1736274] [NEW] SWORD importer - Information text not wrapped

2017-12-04 Thread Phill
Public bug reported:

Ubuntu 17.10 trunk revision 2793

The information text is cut short rather than wrapping. See the attached
image.

** Affects: openlp
 Importance: Low
 Status: New

** Attachment added: "Screenshot from 2017-12-04 22-34-33.png"
   
https://bugs.launchpad.net/bugs/1736274/+attachment/5018508/+files/Screenshot%20from%202017-12-04%2022-34-33.png

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

Title:
  SWORD importer - Information text not wrapped

Status in OpenLP:
  New

Bug description:
  Ubuntu 17.10 trunk revision 2793

  The information text is cut short rather than wrapping. See the
  attached image.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1736274/+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:~phill-ridout/openlp/fixes-mkIV into lp:openlp

2017-12-04 Thread Tim Bentley
Review: Needs Fixing

see inline

Diff comments:

> 
> === added file 'tests/functional/openlp_core/lib/test_exceptions.py'
> --- tests/functional/openlp_core/lib/test_exceptions.py   1970-01-01 
> 00:00:00 +
> +++ tests/functional/openlp_core/lib/test_exceptions.py   2017-12-04 
> 21:51:22 +
> @@ -0,0 +1,45 @@
> +# -*- 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 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 
>  #
> +###
> +"""
> +Package to test the openlp.core.lib.exceptions package.
> +"""
> +from unittest import TestCase
> +
> +from openlp.core.lib.exceptions import ValidationError
> +
> +
> +class TestValidationError(TestCase):
> +"""
> +Test the ValidationError Class
> +"""
> +def test_validation_error(self):
> +"""
> +Test the creation of a ValidationError
> +"""
> +# GIVEN: The ValidationError class
> +
> +# WHEN: Creating an instance of ValidationError
> +error = ValidationError('Test ValidationError')
> +
> +# THEN: Then calling str on the error should return the correct text 
> and it should be an instance of `Exception`
> +assert str(error) == 'Test ValidationError'
> +assert isinstance(error, Exception)

self.assert not assert is the standard



-- 
https://code.launchpad.net/~phill-ridout/openlp/fixes-mkIV/+merge/334708
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:~phill-ridout/openlp/fixes-mkIV into lp:openlp

2017-12-04 Thread Phill
Phill has proposed merging lp:~phill-ridout/openlp/fixes-mkIV into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #1514545 in OpenLP: "DVD audio/subtitle track selection is broken"
  https://bugs.launchpad.net/openlp/+bug/1514545
  Bug #1735765 in OpenLP: "Launching OpenLP in portable mode results in a 
traceback"
  https://bugs.launchpad.net/openlp/+bug/1735765

For more details, see:
https://code.launchpad.net/~phill-ridout/openlp/fixes-mkIV/+merge/334708

A few various fixes, including some affecting the creation / saving of services.

Add this to your merge proposal:

lp:~phill-ridout/openlp/fixes-mkIV (revision 2798)
https://ci.openlp.io/job/Branch-01-Pull/2337/  [WAITING]
[RUNNING]
[SUCCESS]
https://ci.openlp.io/job/Branch-02-Functional-Tests/2238/  [WAITING]
[RUNNING]
[SUCCESS]
https://ci.openlp.io/job/Branch-03-Interface-Tests/2108/   [WAITING]
[RUNNING]
[SUCCESS]
https://ci.openlp.io/job/Branch-04a-Code_Analysis/1434/[WAITING]
[RUNNING]
[SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test_Coverage/1253/[WAITING]
[RUNNING]
[SUCCESS]
https://ci.openlp.io/job/Branch-04c-Code_Analysis2/383/[WAITING]
[RUNNING]
[SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/212/ [WAITING]
[RUNNING]
[FAILURE]
Stopping after failure

Failed builds:
 - Branch-05-AppVeyor-Tests #212: 
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/212/console
-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~phill-ridout/openlp/fixes-mkIV into lp:openlp.
=== modified file 'openlp/core/api/deploy.py'
--- openlp/core/api/deploy.py	2017-11-18 11:23:15 +
+++ openlp/core/api/deploy.py	2017-12-04 21:51:22 +
@@ -52,6 +52,8 @@
 web_config = get_web_page('https://get.openlp.org/webclient/download.cfg', headers={'User-Agent': user_agent})
 except ConnectionError:
 return False
+if not web_config:
+return None
 file_bits = web_config.split()
 return file_bits[0], file_bits[2]
 

=== modified file 'openlp/core/api/http/server.py'
--- openlp/core/api/http/server.py	2017-12-02 09:11:22 +
+++ openlp/core/api/http/server.py	2017-12-04 21:51:22 +
@@ -67,7 +67,10 @@
 address = Settings().value('api/ip address')
 port = Settings().value('api/port')
 Registry().execute('get_website_version')
-serve(application, host=address, port=port)
+try:
+serve(application, host=address, port=port)
+except OSError:
+log.exception('An error occurred when serving the application.')
 
 def stop(self):
 pass

=== modified file 'openlp/core/app.py'
--- openlp/core/app.py	2017-10-23 22:09:57 +
+++ openlp/core/app.py	2017-12-04 21:51:22 +
@@ -403,8 +403,8 @@
  .format(back_up_path=back_up_path))
 QtWidgets.QMessageBox.information(
 None, translate('OpenLP', 'Settings Upgrade'),
-translate('OpenLP', 'Your settings are about to upgraded. A backup will be created at {back_up_path}')
- .format(back_up_path=back_up_path))
+translate('OpenLP', 'Your settings are about to be upgraded. A backup will be created at '
+'{back_up_path}').format(back_up_path=back_up_path))
 settings.export(back_up_path)
 settings.upgrade_settings()
 # First time checks in settings

=== modified file 'openlp/core/common/settings.py'
--- openlp/core/common/settings.py	2017-11-16 00:19:26 +
+++ openlp/core/common/settings.py	2017-12-04 21:51:22 +
@@ -236,7 +236,7 @@
 ('bibles/last search type', '', []),
 ('custom/last search type', 'custom/last used search type', []),
 # The following changes are being made for the conversion to using Path objects made in 2.6 development
-('advanced/data path', 'advanced/data path', [(str_to_path, None)]),
+('advanced/data path', 'advanced/data path', [(lambda p: Path(p) if p is not None else None, None)]),
 ('crashreport/last directory', 'crashreport/last directory', [(str_to_path, None)]),
 ('servicemanager/last directory', 'servicemanager/last directory', [(str_to_path, None)]),
 ('servicemanager/last file', 'servicemanager/last file', [(str_to_path, None)]),

=== modified file 'openlp/core/ui/media/mediacontroller.py'
--- openlp/core/ui/media/mediacontroller.py	2017-10-23 22:09:57 +
+++ openlp/core/ui/media/mediacontroller.py	2017-12-04 21:51:22 +
@@ -498,8 +498,6 @@
 :param controller: The media controller.
 :return: True if setup succeeded else False.
 """
-if controller is None:
-controller = self.display_controllers[DisplayControllerType.Plugin]
 # stop running videos
 sel

[Openlp-core] [Bug 1734432] Re: Progress bar does not show whilst loading a service

2017-12-04 Thread Phill
** Changed in: openlp
 Assignee: (unassigned) => Phill (phill-ridout)

** Changed in: openlp
   Status: New => In Progress

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

Title:
  Progress bar does not show whilst loading a service

Status in OpenLP:
  In Progress

Bug description:
  The progress bar only shows after the service has finished loading.
  When the service has lots of or large files packed, there is no
  indication of loading progress, which can take a considerable time,
  giving the impression that OpenLP has locked up!

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1734432/+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