[Openlp-core] [Bug 1823575] [NEW] PluginManager still has plugin list

2019-04-07 Thread Simon Hanna
Public bug reported:

It appears as if the PluginManager was refactored to not keep state
about the plugins. Instead State was introduced.

But during initialization of the PluginManager the list of plugins is
still initialized to the empty list. This needs to be removed.

There is no other code using the list atm. But there are tests using it.
The tests don't break, because they only compare the lists to themselves, which 
of course works when the lists are empty.

** Affects: openlp
 Importance: Undecided
 Status: New

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

Title:
  PluginManager still has plugin list

Status in OpenLP:
  New

Bug description:
  It appears as if the PluginManager was refactored to not keep state
  about the plugins. Instead State was introduced.

  But during initialization of the PluginManager the list of plugins is
  still initialized to the empty list. This needs to be removed.

  There is no other code using the list atm. But there are tests using it.
  The tests don't break, because they only compare the lists to themselves, 
which of course works when the lists are empty.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1823575/+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 1786601] Re: Error while upgrading settings

2019-03-19 Thread Simon Hanna
I'm not sure if I can replicate it and I don't have any complete
settings. I shared what my settings looked like...

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

Title:
  Error while upgrading settings

Status in OpenLP:
  Incomplete

Bug description:
  I'm running into this error when upgrading the settings.

  › ./openlp.py
  Traceback (most recent call last):
File "./openlp.py", line 60, in 
  main()
File "/home/sim/dev/openlp/trunk/openlp/core/app.py", line 402, in main
  settings.upgrade_settings()
File "/home/sim/dev/openlp/trunk/openlp/core/common/settings.py", line 511, 
in upgrade_settings
  new_value = new_rule(*old_values)
File "/home/sim/dev/openlp/trunk/openlp/core/common/path.py", line 209, in 
str_to_path
  raise TypeError('parameter \'string\' must be of type str, found {} 
instead'.format(type(string)))
  TypeError: parameter 'string' must be of type str, found  
instead

  
  The problem is the following settings
  ['core/recent files']
  [None]
  ['core/logo file']
  [None]

  
  I was upgrading from a release of OpenLP to trunk.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1786601/+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:~bastian-germann/openlp/setup into lp:openlp

2018-10-05 Thread Simon Hanna
I always wondered why there is a setup.py that is not really functional...
Making sure it can install openlp would be a good idea. It would greatly 
simplify packaging OpenLP (at least for archlinux)
I don't see a downside to doing that. We only need to set it up once and then 
we only need to touch it when we modify dependencies or publish new versions.

About removing the VLC code. IMO this is something we should really consider. I 
don't see why we should keep it in the repository. It's maintained somewhere 
else and we don't need to modify it.

-- 
https://code.launchpad.net/~bastian-germann/openlp/setup/+merge/356147
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 1791533] [NEW] Enabling VLC doesn't enable CD/DVD playback

2018-09-09 Thread Simon Hanna
Public bug reported:

The Load CD/DVD button is grayed out when VLC is not enabled.

I enabled VLC in the Settings expecting it to allow me to load a CD/DVD,
but the button was still grayed out. After a restart of OpenLP, the
button was active.


The behavior should ideally change, so that no restart is required. If that 
isn't possible, a message should be displayed in the Media Settings instructing 
the user to restart OpenLP to make sure all settings are applied

** Affects: openlp
 Importance: Undecided
 Status: New

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

Title:
  Enabling VLC doesn't enable CD/DVD playback

Status in OpenLP:
  New

Bug description:
  The Load CD/DVD button is grayed out when VLC is not enabled.

  I enabled VLC in the Settings expecting it to allow me to load a
  CD/DVD, but the button was still grayed out. After a restart of
  OpenLP, the button was active.

  
  The behavior should ideally change, so that no restart is required. If that 
isn't possible, a message should be displayed in the Media Settings instructing 
the user to restart OpenLP to make sure all settings are applied

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1791533/+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 1791532] [NEW] Media items cause issues throughout OpenLP

2018-09-09 Thread Simon Hanna
Public bug reported:

This is all happening in trunk...

When sending a media item to either of the controllers, a traceback is
shown:


Traceback (most recent call last):
  File "/home/sim/dev/openlp/trunk/openlp/core/lib/mediamanageritem.py", line 
493, in on_preview_click
self.preview_controller.add_service_item(service_item)
  File "/home/sim/dev/openlp/trunk/openlp/core/ui/slidecontroller.py", line 
807, in add_service_item
self._process_item(item, slide_no)
  File "/home/sim/dev/openlp/trunk/openlp/core/ui/slidecontroller.py", line 
920, in _process_item
self.preview_widget.replace_service_item(self.service_item, width, slide_no)
  File "/home/sim/dev/openlp/trunk/openlp/core/widgets/views.py", line 197, in 
replace_service_item
pixmap = QtGui.QPixmap(frame['image'])
TypeError: QPixmap(): argument 1 has unexpected type 'QIcon'


I applied a one-line fix by adding the HasThumbnails capability to the media 
items, but that only produced another error. My fix might be wrong, or more 
changes need to be made...

** Affects: openlp
 Importance: Undecided
 Status: New

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

Title:
  Media items cause issues throughout OpenLP

Status in OpenLP:
  New

Bug description:
  This is all happening in trunk...

  When sending a media item to either of the controllers, a traceback is
  shown:

  
  Traceback (most recent call last):
File "/home/sim/dev/openlp/trunk/openlp/core/lib/mediamanageritem.py", line 
493, in on_preview_click
  self.preview_controller.add_service_item(service_item)
File "/home/sim/dev/openlp/trunk/openlp/core/ui/slidecontroller.py", line 
807, in add_service_item
  self._process_item(item, slide_no)
File "/home/sim/dev/openlp/trunk/openlp/core/ui/slidecontroller.py", line 
920, in _process_item
  self.preview_widget.replace_service_item(self.service_item, width, 
slide_no)
File "/home/sim/dev/openlp/trunk/openlp/core/widgets/views.py", line 197, 
in replace_service_item
  pixmap = QtGui.QPixmap(frame['image'])
  TypeError: QPixmap(): argument 1 has unexpected type 'QIcon'

  
  I applied a one-line fix by adding the HasThumbnails capability to the media 
items, but that only produced another error. My fix might be wrong, or more 
changes need to be made...

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1791532/+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:~openlp-dev/openlp/apifixes into lp:openlp

2018-09-04 Thread Simon Hanna
Sure thing about the logging.

I'm not so sure about those "magic" numbers. My goal with the remote was to 
keep things as simple as possible without many function calls or so. Flask 
itself uses the numbers directly and doesn't offer names for them.

I personally think that the numbers are probably better, since you either know 
what the code is for, or you need to read it up anyway. Slapping a name on it 
just makes you search longer for the number...

And it would also just be more code that needs to be tested and covered...

(replied to the inline-comments at the respective places)

Diff comments:

> 
> === modified file 'openlp/core/api/http/server.py'
> --- openlp/core/api/http/server.py2018-01-07 04:36:45 +
> +++ openlp/core/api/http/server.py2018-09-03 21:33:52 +
> @@ -46,6 +40,9 @@
>  from openlp.core.common.settings import Settings
>  from openlp.core.threading import ThreadWorker, run_thread
>  
> +

Yeah, I didn't run a linter over it yet

> +from openlp.core.api.ng import app as application
> +
>  log = logging.getLogger(__name__)
>  
>  
> 
> === added directory 'openlp/core/api/ng'
> === added file 'openlp/core/api/ng/__init__.py'
> --- openlp/core/api/ng/__init__.py1970-01-01 00:00:00 +
> +++ openlp/core/api/ng/__init__.py2018-09-03 21:33:52 +
> @@ -0,0 +1,16 @@
> +from flask import Flask, jsonify
> +from waitress import serve
> +
> +from openlp.core.api.ng.endpoints.old import old_register_blueprints
> +from openlp.core.api.ng.endpoints.v1 import v1_register_blueprints
> +from openlp.core.api.ng.main import main_views
> +from openlp.core.common.applocation import AppLocation
> +
> +app = Flask(__name__)
> +
> +app.register_blueprint(main_views)
> +old_register_blueprints(app)
> +v1_register_blueprints(app)

I'd much rather start fresh. Especially since the previous "versions" weren't 
actually versioned. But it's only in the code, so I don't care too much about 
that

> +
> +def register_blueprint(blueprint, url_prefix=None):
> +app.register_blueprint(blueprint, url_prefix)
> 
> === added file 'openlp/core/api/ng/lib.py'
> --- openlp/core/api/ng/lib.py 1970-01-01 00:00:00 +
> +++ openlp/core/api/ng/lib.py 2018-09-03 21:33:52 +
> @@ -0,0 +1,29 @@
> +import json
> +from flask import jsonify
> +from functools import wraps
> +
> +def requires_login(f):
> +@wraps(f)
> +def decorated(*args, **kwargs):
> +return f(*args, **kwargs)
> +return decorated
> +
> +
> +def login_required(f):
> +@wraps(f)
> +def decorated(*args, **kwargs):
> +return f(*args, **kwargs)

Yes it is. And I remembered, that I need to support two different login 
mechanisms, since the old api should still use the old auth mechanism. All new 
calls will use the login_required decorator. The old calls with probably just 
be the old decorator...

> +return decorated
> +
> +
> +def old_success_response():
> +return jsonify({'results': {'sucess': True}})
> +
> +
> +def extract_request(json_string, name):
> +try:
> +if json_string:
> +return json.loads(json_string)['request'][name]
> +except KeyError:
> +pass
> +return None
> \ No newline at end of file
> 
> === added file 'openlp/core/ui/media/remote.py'
> --- openlp/core/ui/media/remote.py1970-01-01 00:00:00 +
> +++ openlp/core/ui/media/remote.py2018-09-03 21:33:52 +
> @@ -0,0 +1,98 @@
> +# -*- 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:~thelinuxguy/openlp/fix-regex into lp:openlp

2018-08-27 Thread Simon Hanna
Simon Hanna has proposed merging lp:~thelinuxguy/openlp/fix-regex into 
lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/fix-regex/+merge/353793

Fix the following warning which was displayed when running OpenLP in the cli

/home/sim/dev/openlp/trunk/openlp/core/common/i18n.py:274: FutureWarning: 
Possible nested set at position 1
  if re.match(r'[[].*[]]', language):

-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~thelinuxguy/openlp/fix-regex into lp:openlp.
=== modified file 'openlp/core/common/i18n.py'
--- openlp/core/common/i18n.py	2018-04-12 19:15:56 +
+++ openlp/core/common/i18n.py	2018-08-27 14:18:33 +
@@ -271,9 +271,10 @@
 language = Settings().value('core/language')
 language = str(language)
 log.info("Language file: '{language}' Loaded from conf file".format(language=language))
-if re.match(r'[[].*[]]', language):
+m = re.match(r'\[(.*)\]', language)
+if m:
 LanguageManager.auto_language = True
-language = re.sub(r'[\[\]]', '', language)
+language = m.group(1)
 return language
 
 @staticmethod

=== modified file 'tests/functional/openlp_core/common/test_i18n.py'
--- tests/functional/openlp_core/common/test_i18n.py	2017-12-29 09:15:48 +
+++ tests/functional/openlp_core/common/test_i18n.py	2018-08-27 14:18:33 +
@@ -27,7 +27,8 @@
 
 from openlp.core.common import is_macosx
 from openlp.core.common.i18n import LANGUAGES, Language, UiStrings, get_language, get_locale_key, get_natural_key, \
-translate
+translate, LanguageManager
+from openlp.core.common.settings import Settings
 
 
 def test_languages_type():
@@ -158,6 +159,14 @@
 assert first_instance is second_instance, 'Two UiStrings objects should be the same instance'
 
 
+def test_get_language_from_settings():
+assert LanguageManager.get_language() == 'en'
+
+def test_get_language_from_settings_returns_unchanged_if_unknown_format():
+Settings().setValue('core/language', '(foobar)')
+assert LanguageManager.get_language() == '(foobar)'
+
+
 def test_translate():
 """
 Test the translate() function

___
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:~thelinuxguy/openlp/rework-imports into lp:openlp

2018-08-26 Thread Simon Hanna
Simon Hanna has proposed merging lp:~thelinuxguy/openlp/rework-imports into 
lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/rework-imports/+merge/353751

Whoops, seems like I had a typo there... Really need to get the segfault fixed 
on my system...
-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~thelinuxguy/openlp/rework-imports into lp:openlp.
=== modified file 'openlp/plugins/images/imageplugin.py'
--- openlp/plugins/images/imageplugin.py	2018-08-25 14:08:19 +
+++ openlp/plugins/images/imageplugin.py	2018-08-26 07:29:42 +
@@ -28,7 +28,7 @@
 from openlp.core.common.i18n import translate
 from openlp.core.ui.icons import UiIcons
 from openlp.core.common.settings import Settings
-from openlp.core.lib import mageSource, build_icon
+from openlp.core.lib import ImageSource, build_icon
 from openlp.core.lib.plugin import Plugin, StringContent
 from openlp.core.lib.db import Manager
 from openlp.plugins.images.endpoint import api_images_endpoint, images_endpoint

___
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/ftw-json into lp:openlp

2018-08-25 Thread Simon Hanna
Looks like this is targeting the wrong branch :-)
-- 
https://code.launchpad.net/~phill-ridout/openlp/ftw-json/+merge/348037
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:~thelinuxguy/openlp/rework-imports into lp:openlp

2018-08-25 Thread Simon Hanna
Simon Hanna has proposed merging lp:~thelinuxguy/openlp/rework-imports into 
lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/rework-imports/+merge/353747

Rework a couple of imports. Now a subset of tests can be run again, which 
previously failed due to circular imports (at least that's what I guess)
-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~thelinuxguy/openlp/rework-imports into lp:openlp.
=== modified file 'openlp/core/api/endpoint/controller.py'
--- openlp/core/api/endpoint/controller.py	2018-02-23 12:16:13 +
+++ openlp/core/api/endpoint/controller.py	2018-08-25 14:41:33 +
@@ -31,7 +31,8 @@
 from openlp.core.common.path import Path
 from openlp.core.common.registry import Registry
 from openlp.core.common.settings import Settings
-from openlp.core.lib import ItemCapabilities, create_thumb
+from openlp.core.lib import create_thumb
+from openlp.core.lib.serviceitem import ItemCapabilities
 
 log = logging.getLogger(__name__)
 

=== modified file 'openlp/core/api/endpoint/core.py'
--- openlp/core/api/endpoint/core.py	2017-12-29 09:15:48 +
+++ openlp/core/api/endpoint/core.py	2018-08-25 14:41:33 +
@@ -29,7 +29,9 @@
 from openlp.core.api.http.endpoint import Endpoint
 from openlp.core.common.i18n import UiStrings, translate
 from openlp.core.common.registry import Registry
-from openlp.core.lib import PluginStatus, StringContent, image_to_byte
+from openlp.core.lib import image_to_byte
+from openlp.core.lib.plugin import StringContent
+from openlp.core.lib.plugin import PluginStatus
 
 template_dir = 'templates'
 static_dir = 'static'

=== modified file 'openlp/core/api/endpoint/pluginhelpers.py'
--- openlp/core/api/endpoint/pluginhelpers.py	2018-07-02 20:38:47 +
+++ openlp/core/api/endpoint/pluginhelpers.py	2018-08-25 14:41:33 +
@@ -28,7 +28,8 @@
 from openlp.core.api.http.errors import NotFound
 from openlp.core.common.applocation import AppLocation
 from openlp.core.common.registry import Registry
-from openlp.core.lib import PluginStatus, image_to_byte
+from openlp.core.lib import image_to_byte
+from openlp.core.lib.plugin import PluginStatus
 
 
 def search(request, plugin_name, log):

=== modified file 'openlp/core/api/tab.py'
--- openlp/core/api/tab.py	2018-08-04 20:58:13 +
+++ openlp/core/api/tab.py	2018-08-25 14:41:33 +
@@ -28,7 +28,7 @@
 from openlp.core.common.i18n import UiStrings, translate
 from openlp.core.common.registry import Registry
 from openlp.core.common.settings import Settings
-from openlp.core.lib import SettingsTab
+from openlp.core.lib.settingstab import SettingsTab
 from openlp.core.ui.icons import UiIcons
 
 ZERO_URL = '0.0.0.0'

=== modified file 'openlp/core/app.py'
--- openlp/core/app.py	2018-04-07 16:16:42 +
+++ openlp/core/app.py	2018-08-25 14:41:33 +
@@ -43,7 +43,7 @@
 from openlp.core.common.settings import Settings
 from openlp.core.display.screens import ScreenList
 from openlp.core.resources import qInitResources
-from openlp.core.ui import SplashScreen
+from openlp.core.ui.splashscreen import SplashScreen
 from openlp.core.ui.exceptionform import ExceptionForm
 from openlp.core.ui.firsttimeform import FirstTimeForm
 from openlp.core.ui.firsttimelanguageform import FirstTimeLanguageForm

=== modified file 'openlp/core/display/renderer.py'
--- openlp/core/display/renderer.py	2017-12-29 09:15:48 +
+++ openlp/core/display/renderer.py	2018-08-25 14:41:33 +
@@ -31,8 +31,11 @@
 from openlp.core.common.registry import Registry, RegistryBase
 from openlp.core.common.settings import Settings
 from openlp.core.display.screens import ScreenList
-from openlp.core.lib import FormattingTags, ImageSource, ItemCapabilities, ServiceItem, expand_tags, build_chords_css, \
-build_lyrics_format_css, build_lyrics_outline_css
+from openlp.core.lib import ImageSource, expand_tags
+from openlp.core.lib.htmlbuilder import build_chords_css, build_lyrics_format_css, \
+build_lyrics_outline_css
+from openlp.core.lib.formattingtags import FormattingTags
+from openlp.core.lib.serviceitem import ServiceItem, ItemCapabilities
 from openlp.core.ui.maindisplay import MainDisplay
 
 VERSE = 'The Lord said to {r}Noah{/r}: \n' \

=== modified file 'openlp/core/lib/__init__.py'
--- openlp/core/lib/__init__.py	2018-08-04 20:58:13 +
+++ openlp/core/lib/__init__.py	2018-08-25 14:41:33 +
@@ -32,6 +32,7 @@
 
 from openlp.core.common.i18n import translate
 from openlp.core.common.path import Path
+from openlp.core.lib.formattingtags import FormattingTags
 
 log = logging.getLogger(__name__ + '.__init__')
 
@@ -608,15 +609,4 @@
last=string_list[-1])
 else:
 list_to_string = ''
-return list_to_string
-
-
-from .exceptions import ValidationError
-from .formattingtags import FormattingTags
-from .plugin import PluginStatus, StringContent

[Openlp-core] [Merge] lp:~thelinuxguy/openlp/editable-remote-port into lp:openlp

2018-08-22 Thread Simon Hanna
Simon Hanna has proposed merging lp:~thelinuxguy/openlp/editable-remote-port 
into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/editable-remote-port/+merge/353586

Somehow the port was changed to be static, this reintroduces customizable ports
-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~thelinuxguy/openlp/editable-remote-port into lp:openlp.
=== modified file 'openlp/core/api/tab.py'
--- openlp/core/api/tab.py	2018-08-04 20:58:13 +
+++ openlp/core/api/tab.py	2018-08-22 16:43:25 +
@@ -71,7 +71,9 @@
 self.http_setting_layout.setObjectName('http_setting_layout')
 self.port_label = QtWidgets.QLabel(self.http_settings_group_box)
 self.port_label.setObjectName('port_label')
-self.port_spin_box = QtWidgets.QLabel(self.http_settings_group_box)
+self.port_spin_box = QtWidgets.QSpinBox(self.http_settings_group_box)
+self.port_spin_box.setMinimum(1024)
+self.port_spin_box.setMaximum(65535)
 self.port_spin_box.setObjectName('port_spin_box')
 self.http_setting_layout.addRow(self.port_label, self.port_spin_box)
 self.remote_url_label = QtWidgets.QLabel(self.http_settings_group_box)
@@ -213,7 +215,7 @@
 """
 Load the configuration and update the server configuration if necessary
 """
-self.port_spin_box.setText(str(Settings().value(self.settings_section + '/port')))
+self.port_spin_box.setValue(Settings().value(self.settings_section + '/port'))
 self.address_edit.setText(Settings().value(self.settings_section + '/ip address'))
 self.twelve_hour = Settings().value(self.settings_section + '/twelve hour')
 self.twelve_hour_check_box.setChecked(self.twelve_hour)
@@ -232,8 +234,10 @@
 """
 Save the configuration and update the server configuration if necessary
 """
-if Settings().value(self.settings_section + '/ip address') != self.address_edit.text():
+if Settings().value(self.settings_section + '/ip address') != self.address_edit.text() or \
+   Settings().value(self.settings_section + '/port') != self.port_spin_box.value():
 self.settings_form.register_post_process('remotes_config_updated')
+Settings().setValue(self.settings_section + '/port', self.port_spin_box.value())
 Settings().setValue(self.settings_section + '/ip address', self.address_edit.text())
 Settings().setValue(self.settings_section + '/twelve hour', self.twelve_hour)
 Settings().setValue(self.settings_section + '/thumbnails', self.thumbnails)

=== modified file 'tests/functional/openlp_core/api/test_tab.py'
--- tests/functional/openlp_core/api/test_tab.py	2018-08-04 20:58:13 +
+++ tests/functional/openlp_core/api/test_tab.py	2018-08-22 16:43:25 +
@@ -119,3 +119,27 @@
 assert self.form.live_url.text() == \
 "http://192.168.1.1:4316/main\;>http://192.168.1.1:4316/main", \
 'The return value should be a fully formed main link'
+
+def test_port_spin_box_is_available(self):
+"""
+Test that the port can be set using a SpinBox
+"""
+# GIVEN: The Remote Settings tab
+# THEN: The port input is a spin box
+assert isinstance(self.form.port_spin_box, QtWidgets.QSpinBox)
+
+def test_port_spin_box_maximum_value(self):
+"""
+Test that the maximum allowed value is 65535
+"""
+# GIVEN: The Remote Settings tab
+# THEN: The maximum allowed value is 65535
+assert self.form.port_spin_box.maximum() == 65535
+
+def test_port_spin_box_minimum_value(self):
+"""
+Test that the minimum allowed value is 1024
+"""
+# GIVEN: The Remote Settings tab
+# THEN: The minimum allowed value is 1024
+assert self.form.port_spin_box.minimum() == 1024

___
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:~thelinuxguy/openlp/flake-fixes into lp:openlp

2018-08-22 Thread Simon Hanna
I'm not sure if that makes a difference here, but when viewing it in the tests 
using the original definition shows what is actually being used. If you import 
it from somewhere else you could think that it's something different...
-- 
https://code.launchpad.net/~thelinuxguy/openlp/flake-fixes/+merge/353535
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:~thelinuxguy/openlp/flake-fixes into lp:openlp

2018-08-21 Thread Simon Hanna
Simon Hanna has proposed merging lp:~thelinuxguy/openlp/flake-fixes into 
lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/flake-fixes/+merge/353535

A couple of code fixes that I uncovered using linters
-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~thelinuxguy/openlp/flake-fixes into lp:openlp.
=== modified file 'openlp/core/app.py'
--- openlp/core/app.py	2018-04-07 16:16:42 +
+++ openlp/core/app.py	2018-08-21 22:59:09 +
@@ -357,7 +357,7 @@
 portable_settings_path = data_path / 'OpenLP.ini'
 # Make this our settings file
 log.info('INI file: {name}'.format(name=portable_settings_path))
-Settings.set_filename(str(portable_settings_path))
+Settings.set_filename(portable_settings_path)
 portable_settings = Settings()
 # Set our data path
 log.info('Data path: {name}'.format(name=data_path))

=== modified file 'openlp/core/lib/serviceitem.py'
--- openlp/core/lib/serviceitem.py	2018-04-22 06:59:35 +
+++ openlp/core/lib/serviceitem.py	2018-08-21 22:59:09 +
@@ -39,7 +39,7 @@
 from openlp.core.common.mixins import RegistryProperties
 from openlp.core.common.path import Path
 from openlp.core.common.settings import Settings
-from openlp.core.lib import ImageSource, build_icon, clean_tags, expand_tags, expand_chords
+from openlp.core.lib import ImageSource, clean_tags, expand_tags, expand_chords
 
 log = logging.getLogger(__name__)
 

=== modified file 'openlp/core/projectors/editform.py'
--- openlp/core/projectors/editform.py	2018-04-21 19:57:51 +
+++ openlp/core/projectors/editform.py	2018-08-21 22:59:09 +
@@ -185,7 +185,6 @@
   translate('OpenLP.ProjectorEdit',
 'You must enter a name for this entry.'
 'Please enter a new name for this entry.'))
-valid = False
 return
 name = self.name_text.text().strip()
 record = self.projectordb.get_projector_by_name(name)
@@ -197,7 +196,6 @@
 'the database as ID "{record}". '
 'Please enter a different name.'.format(name=name,
 record=record.id)))
-valid = False
 return
 if self.new_projector:
 # Only validate a new entry - otherwise it's been previously verified
@@ -223,7 +221,6 @@
   translate('OpenLP.ProjectorWizard',
 'IP address "{ip}"is not a valid IP address.'
 'Please enter a valid IP address.'.format(ip=adx)))
-valid = False
 return
 port = int(self.port_text.text())
 if port < 1000 or port > 32767:

=== modified file 'openlp/core/ui/advancedtab.py'
--- openlp/core/ui/advancedtab.py	2018-08-04 20:58:13 +
+++ openlp/core/ui/advancedtab.py	2018-08-21 22:59:09 +
@@ -31,7 +31,7 @@
 from openlp.core.common.applocation import AppLocation
 from openlp.core.common.i18n import UiStrings, format_time, translate
 from openlp.core.common.settings import Settings
-from openlp.core.lib import SettingsTab, build_icon
+from openlp.core.lib import SettingsTab
 from openlp.core.ui.style import HAS_DARK_STYLE
 from openlp.core.ui.icons import UiIcons
 from openlp.core.widgets.edits import PathEdit

=== modified file 'openlp/core/ui/exceptiondialog.py'
--- openlp/core/ui/exceptiondialog.py	2018-06-10 19:29:00 +
+++ openlp/core/ui/exceptiondialog.py	2018-08-21 22:59:09 +
@@ -23,7 +23,7 @@
 The GUI widgets of the exception dialog.
 """
 
-from PyQt5 import QtGui, QtWidgets
+from PyQt5 import QtWidgets
 
 from openlp.core.common.i18n import translate
 from openlp.core.ui.icons import UiIcons

=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py	2018-08-04 20:58:13 +
+++ openlp/core/ui/slidecontroller.py	2018-08-21 22:59:09 +
@@ -36,7 +36,7 @@
 from openlp.core.common.registry import Registry, RegistryBase
 from openlp.core.common.settings import Settings
 from openlp.core.display.screens import ScreenList
-from openlp.core.lib import ItemCapabilities, ServiceItem, ImageSource, ServiceItemAction, build_icon, build_html
+from openlp.core.lib import ItemCapabilities, ServiceItem, ImageSource, ServiceItemAction, build_html
 from openlp.core.lib.ui import create_action
 from openlp.core.ui import HideMode, MainDisplay, Display, DisplayControllerType
 from openlp.core.ui.icons import UiIcons

=== modified file 'openlp/core/version.py'
--- openlp/core/version.py	2018-06-28 20:40:54

[Openlp-core] [Bug 1788289] [NEW] CLLI import seems to ignore the verse numbers

2018-08-21 Thread Simon Hanna
Public bug reported:

At least the verse_number variable in CCLIFileImport.do_import_txt_file
isn't being used

** Affects: openlp
 Importance: Undecided
 Status: New

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

Title:
  CLLI import seems to ignore the verse numbers

Status in OpenLP:
  New

Bug description:
  At least the verse_number variable in
  CCLIFileImport.do_import_txt_file isn't being used

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1788289/+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 1788285] [NEW] Wrong documentation/implementation

2018-08-21 Thread Simon Hanna
Public bug reported:

openlp.plugins.presentations.lib.mediaitem.PresentationMediaItem.load_list
is messed up

The documentation of the method says it expects a list of Path objects,
but the code treats the parameter as a list of strings.

It's called in the initialize method using a list of strings.

The parent class defines a load_list method but doesn't specify the type of the 
parameter.
The SongMediaItem for instance doesn't overwrite the method, while others do 
and use a list of strings.

I didn't look that much into it, but if the load_list method is called
on MediaItems regardless of their actual class, then this could be a
source of errors. Ideally all methods should have the same parameter
type.

** Affects: openlp
 Importance: Undecided
 Status: New

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

Title:
  Wrong documentation/implementation

Status in OpenLP:
  New

Bug description:
  openlp.plugins.presentations.lib.mediaitem.PresentationMediaItem.load_list
  is messed up

  The documentation of the method says it expects a list of Path
  objects, but the code treats the parameter as a list of strings.

  It's called in the initialize method using a list of strings.

  The parent class defines a load_list method but doesn't specify the type of 
the parameter.
  The SongMediaItem for instance doesn't overwrite the method, while others do 
and use a list of strings.

  I didn't look that much into it, but if the load_list method is called
  on MediaItems regardless of their actual class, then this could be a
  source of errors. Ideally all methods should have the same parameter
  type.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1788285/+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:~thelinuxguy/openlp/improve-logging into lp:openlp

2018-08-14 Thread Simon Hanna
If raising an error results in a crash then I don't agree with you. I got a 
crash because this method was used during loading/migrating settings. These can 
be theoretically modified by the users outside of OpenLP. Crashing when this 
happens doesn't sound right!

You might be able to argue that in that case the error should be caught, which 
may be a good idea. I think that returning None which is a valid thing to 
return according to the docs, is way safer than raising an exception.

Also the docs of the function don't mention the thrown TypeError and I highly 
doubt every call catches it or makes sure the parameter is actually a string. 

A compromise might be to check for "not None" first before checking for the 
string type.

-- 
https://code.launchpad.net/~thelinuxguy/openlp/improve-logging/+merge/352939
Your team OpenLP Core is requested to review the proposed merge of 
lp:~thelinuxguy/openlp/improve-logging 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:~thelinuxguy/openlp/improve-logging into lp:openlp

2018-08-12 Thread Simon Hanna
Simon Hanna has proposed merging lp:~thelinuxguy/openlp/improve-logging into 
lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/improve-logging/+merge/352939

Instead of raising an error when converting paths, return None and log an error.

The method is allowed to return None, so calling functions should handle that. 
Raising an error is very rude behavior and the output just said that the input 
was invalid with no real clue as to what is wrong.

Now None is returned without causing too much hassle, and a proper error is 
logged mentioning what exactly caused the error.

The test case was updated.

This is sort of related to https://bugs.launchpad.net/openlp/+bug/1786601 in 
that this would have been nice to actually know what went wrong and failback to 
None.
-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~thelinuxguy/openlp/improve-logging into lp:openlp.
=== modified file 'openlp/core/common/path.py'
--- openlp/core/common/path.py	2018-01-13 04:57:16 +
+++ openlp/core/common/path.py	2018-08-12 11:29:05 +
@@ -206,7 +206,8 @@
 :rtype: openlp.core.common.path.Path | None
 """
 if not isinstance(string, str):
-raise TypeError('parameter \'string\' must be of type str')
+log.error('parameter \'string\' must be of type str, got {} which is a {} instead'.format(string, type(string)))
+return None
 if string == '':
 return None
 return Path(string)

=== modified file 'tests/functional/openlp_core/common/test_path.py'
--- tests/functional/openlp_core/common/test_path.py	2018-01-13 04:57:16 +
+++ tests/functional/openlp_core/common/test_path.py	2018-08-12 11:29:05 +
@@ -271,13 +271,12 @@
 
 def test_str_to_path_type_error(self):
 """
-Test that `str_to_path` raises a type error when called with an invalid type
+Test that `str_to_path` returns None if called with invalid information
 """
 # GIVEN: The `str_to_path` function
 # WHEN: Calling `str_to_path` with an invalid Type
-# THEN: A TypeError should have been raised
-with self.assertRaises(TypeError):
-str_to_path(Path())
+# THEN: None is returned
+assert str_to_path(Path()) is None
 
 def test_str_to_path_empty_str(self):
 """

___
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 1786601] Re: Error while upgrading settings

2018-08-11 Thread Simon Hanna
The relevant part in the settings looks like this

recent%20files=@Invalid()


the logo file is missing

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

Title:
  Error while upgrading settings

Status in OpenLP:
  New

Bug description:
  I'm running into this error when upgrading the settings.

  › ./openlp.py
  Traceback (most recent call last):
File "./openlp.py", line 60, in 
  main()
File "/home/sim/dev/openlp/trunk/openlp/core/app.py", line 402, in main
  settings.upgrade_settings()
File "/home/sim/dev/openlp/trunk/openlp/core/common/settings.py", line 511, 
in upgrade_settings
  new_value = new_rule(*old_values)
File "/home/sim/dev/openlp/trunk/openlp/core/common/path.py", line 209, in 
str_to_path
  raise TypeError('parameter \'string\' must be of type str, found {} 
instead'.format(type(string)))
  TypeError: parameter 'string' must be of type str, found  
instead

  
  The problem is the following settings
  ['core/recent files']
  [None]
  ['core/logo file']
  [None]

  
  I was upgrading from a release of OpenLP to trunk.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1786601/+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 1786601] [NEW] Error while upgrading settings

2018-08-11 Thread Simon Hanna
Public bug reported:

I'm running into this error when upgrading the settings.

› ./openlp.py
Traceback (most recent call last):
  File "./openlp.py", line 60, in 
main()
  File "/home/sim/dev/openlp/trunk/openlp/core/app.py", line 402, in main
settings.upgrade_settings()
  File "/home/sim/dev/openlp/trunk/openlp/core/common/settings.py", line 511, 
in upgrade_settings
new_value = new_rule(*old_values)
  File "/home/sim/dev/openlp/trunk/openlp/core/common/path.py", line 209, in 
str_to_path
raise TypeError('parameter \'string\' must be of type str, found {} 
instead'.format(type(string)))
TypeError: parameter 'string' must be of type str, found  
instead


The problem is the following settings
['core/recent files']
[None]
['core/logo file']
[None]


I was upgrading from a release of OpenLP to trunk.

** Affects: openlp
 Importance: Undecided
 Status: New

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

Title:
  Error while upgrading settings

Status in OpenLP:
  New

Bug description:
  I'm running into this error when upgrading the settings.

  › ./openlp.py
  Traceback (most recent call last):
File "./openlp.py", line 60, in 
  main()
File "/home/sim/dev/openlp/trunk/openlp/core/app.py", line 402, in main
  settings.upgrade_settings()
File "/home/sim/dev/openlp/trunk/openlp/core/common/settings.py", line 511, 
in upgrade_settings
  new_value = new_rule(*old_values)
File "/home/sim/dev/openlp/trunk/openlp/core/common/path.py", line 209, in 
str_to_path
  raise TypeError('parameter \'string\' must be of type str, found {} 
instead'.format(type(string)))
  TypeError: parameter 'string' must be of type str, found  
instead

  
  The problem is the following settings
  ['core/recent files']
  [None]
  ['core/logo file']
  [None]

  
  I was upgrading from a release of OpenLP to trunk.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1786601/+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:~thelinuxguy/openlp/fix-newline-bug into lp:openlp

2018-04-17 Thread Simon Hanna
Simon Hanna has proposed merging lp:~thelinuxguy/openlp/fix-newline-bug into 
lp:openlp.

Requested reviews:
  Phill (phill-ridout)
  Tim Bentley (trb143)
Related bugs:
  Bug #1727517 in OpenLP: "Unicode control chars causes song importer to crash"
  https://bugs.launchpad.net/openlp/+bug/1727517

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/fix-newline-bug/+merge/343465

Fix the fix for 1727517
-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/common/__init__.py'
--- openlp/core/common/__init__.py	2018-02-24 16:10:02 +
+++ openlp/core/common/__init__.py	2018-04-17 19:37:10 +
@@ -44,7 +44,7 @@
 
 FIRST_CAMEL_REGEX = re.compile('(.)([A-Z][a-z]+)')
 SECOND_CAMEL_REGEX = re.compile('([a-z0-9])([A-Z])')
-CONTROL_CHARS = re.compile(r'[\x00-\x1F\x7F-\x9F]')
+CONTROL_CHARS = re.compile(r'[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x9F]')
 INVALID_FILE_CHARS = re.compile(r'[\\/:\*\?"<>\|\+\[\]%]')
 IMAGES_FILTER = None
 REPLACMENT_CHARS_MAP = str.maketrans({'\u2018': '\'', '\u2019': '\'', '\u201c': '"', '\u201d': '"', '\u2026': '...',
@@ -471,15 +471,15 @@
 log.exception('Error detecting file encoding')
 
 
-def normalize_str(irreg_str):
+def normalize_str(irregular_string):
 """
 Normalize the supplied string. Remove unicode control chars and tidy up white space.
 
-:param str irreg_str: The string to normalize.
+:param str irregular_string: The string to normalize.
 :return: The normalized string
 :rtype: str
 """
-irreg_str = irreg_str.translate(REPLACMENT_CHARS_MAP)
-irreg_str = CONTROL_CHARS.sub('', irreg_str)
-irreg_str = NEW_LINE_REGEX.sub('\n', irreg_str)
-return WHITESPACE_REGEX.sub(' ', irreg_str)
+irregular_string = irregular_string.translate(REPLACMENT_CHARS_MAP)
+irregular_string = CONTROL_CHARS.sub('', irregular_string)
+irregular_string = NEW_LINE_REGEX.sub('\n', irregular_string)
+return WHITESPACE_REGEX.sub(' ', irregular_string)

=== modified file 'tests/functional/openlp_core/common/test_common.py'
--- tests/functional/openlp_core/common/test_common.py	2017-12-29 09:15:48 +
+++ tests/functional/openlp_core/common/test_common.py	2018-04-17 19:37:10 +
@@ -25,8 +25,8 @@
 from unittest import TestCase
 from unittest.mock import MagicMock, call, patch
 
-from openlp.core.common import clean_button_text, de_hump, extension_loader, is_macosx, is_linux, is_win, \
-path_to_module, trace_error_handler
+from openlp.core.common import clean_button_text, de_hump, extension_loader, is_macosx, is_linux, \
+is_win, normalize_str, path_to_module, trace_error_handler
 from openlp.core.common.path import Path
 
 
@@ -211,6 +211,30 @@
 assert is_win() is False, 'is_win() should return False'
 assert is_macosx() is False, 'is_macosx() should return False'
 
+def test_normalize_str_leaves_newlines(self):
+# GIVEN: a string containing newlines
+string = 'something\nelse'
+# WHEN: normalize is called
+normalized_string = normalize_str(string)
+# THEN: string is unchanged
+assert normalized_string == string
+
+def test_normalize_str_removes_null_byte(self):
+# GIVEN: a string containing a null byte
+string = 'somet\x00hing'
+# WHEN: normalize is called
+normalized_string = normalize_str(string)
+# THEN: nullbyte is removed
+assert normalized_string == 'something'
+
+def test_normalize_str_replaces_crlf_with_lf(self):
+# GIVEN: a string containing crlf
+string = 'something\r\nelse'
+# WHEN: normalize is called
+normalized_string = normalize_str(string)
+# THEN: crlf is replaced with lf
+assert normalized_string == 'something\nelse'
+
 def test_clean_button_text(self):
 """
 Test the clean_button_text() function.

___
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:~thelinuxguy/openlp/fix-newline-bug into lp:openlp

2018-04-17 Thread Simon Hanna
The proposal to merge lp:~thelinuxguy/openlp/fix-newline-bug into lp:openlp has 
been updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/fix-newline-bug/+merge/343422
-- 
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:~thelinuxguy/openlp/fix-newline-bug into lp:openlp

2018-04-17 Thread Simon Hanna
Simon Hanna has proposed merging lp:~thelinuxguy/openlp/fix-newline-bug into 
lp:openlp.

Requested reviews:
  Phill (phill-ridout)
  Tim Bentley (trb143)
Related bugs:
  Bug #1727517 in OpenLP: "Unicode control chars causes song importer to crash"
  https://bugs.launchpad.net/openlp/+bug/1727517

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/fix-newline-bug/+merge/343422

Fix the fix for 1727517
-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/common/__init__.py'
--- openlp/core/common/__init__.py	2018-02-24 16:10:02 +
+++ openlp/core/common/__init__.py	2018-04-17 10:28:19 +
@@ -44,7 +44,7 @@
 
 FIRST_CAMEL_REGEX = re.compile('(.)([A-Z][a-z]+)')
 SECOND_CAMEL_REGEX = re.compile('([a-z0-9])([A-Z])')
-CONTROL_CHARS = re.compile(r'[\x00-\x1F\x7F-\x9F]')
+CONTROL_CHARS = re.compile(r'[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x9F]')
 INVALID_FILE_CHARS = re.compile(r'[\\/:\*\?"<>\|\+\[\]%]')
 IMAGES_FILTER = None
 REPLACMENT_CHARS_MAP = str.maketrans({'\u2018': '\'', '\u2019': '\'', '\u201c': '"', '\u201d': '"', '\u2026': '...',
@@ -471,15 +471,15 @@
 log.exception('Error detecting file encoding')
 
 
-def normalize_str(irreg_str):
+def normalize_str(string):
 """
 Normalize the supplied string. Remove unicode control chars and tidy up white space.
 
-:param str irreg_str: The string to normalize.
+:param str string: The string to normalize.
 :return: The normalized string
 :rtype: str
 """
-irreg_str = irreg_str.translate(REPLACMENT_CHARS_MAP)
-irreg_str = CONTROL_CHARS.sub('', irreg_str)
-irreg_str = NEW_LINE_REGEX.sub('\n', irreg_str)
-return WHITESPACE_REGEX.sub(' ', irreg_str)
+string = string.translate(REPLACMENT_CHARS_MAP)
+string = CONTROL_CHARS.sub('', string)
+string = NEW_LINE_REGEX.sub('\n', string)
+return WHITESPACE_REGEX.sub(' ', string)

=== modified file 'tests/functional/openlp_core/common/test_common.py'
--- tests/functional/openlp_core/common/test_common.py	2017-12-29 09:15:48 +
+++ tests/functional/openlp_core/common/test_common.py	2018-04-17 10:28:19 +
@@ -25,8 +25,8 @@
 from unittest import TestCase
 from unittest.mock import MagicMock, call, patch
 
-from openlp.core.common import clean_button_text, de_hump, extension_loader, is_macosx, is_linux, is_win, \
-path_to_module, trace_error_handler
+from openlp.core.common import clean_button_text, de_hump, extension_loader, is_macosx, is_linux, \
+is_win, normalize_str, path_to_module, trace_error_handler
 from openlp.core.common.path import Path
 
 
@@ -211,6 +211,30 @@
 assert is_win() is False, 'is_win() should return False'
 assert is_macosx() is False, 'is_macosx() should return False'
 
+def test_normalize_str_leaves_newlines(self):
+# GIVEN: a string containing newlines
+string = 'something\nelse'
+# WHEN: normalize is called
+normalized_string = normalize_str(string)
+# THEN: string is unchanged
+assert normalized_string == string
+
+def test_normalize_str_removes_null_byte(self):
+# GIVEN: a string containing a null byte
+string = 'somet\x00hing'
+# WHEN: normalize is called
+normalized_string = normalize_str(string)
+# THEN: nullbyte is removed
+assert normalized_string == 'something'
+
+def test_normalize_str_replaces_crlf_with_lf(self):
+# GIVEN: a string containing crlf
+string = 'something\r\nelse'
+# WHEN: normalize is called
+normalized_string = normalize_str(string)
+# THEN: crlf is replaced with lf
+assert normalized_string == 'something\nelse'
+
 def test_clean_button_text(self):
 """
 Test the clean_button_text() function.

___
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:~thelinuxguy/openlp/fix-newline-bug into lp:openlp

2018-04-17 Thread Simon Hanna
The proposal to merge lp:~thelinuxguy/openlp/fix-newline-bug into lp:openlp has 
been updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/fix-newline-bug/+merge/343306
-- 
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:~thelinuxguy/openlp/fix-newline-bug into lp:openlp

2018-04-16 Thread Simon Hanna
The proposal to merge lp:~thelinuxguy/openlp/fix-newline-bug into lp:openlp has 
been updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/fix-newline-bug/+merge/343277
-- 
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:~thelinuxguy/openlp/fix-newline-bug into lp:openlp

2018-04-16 Thread Simon Hanna
I wonder what the reason behind replacing vertial tabs with new lines is...

Looking at where the regex is being used I'm inclined to say the whole thing 
needs to be reworked.

It's also used in the filename cleaning where linefeeds are strange, but then 
again I don't know what the input always is.

I'm changing it to what you request, but you should really take a serious look 
at it. From what I see, you are the last one that touched the invalid file 
regex, I highly doubt this is what you actually want to happen. If it is, it is 
a mystery to me...
-- 
https://code.launchpad.net/~thelinuxguy/openlp/fix-newline-bug/+merge/343277
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:~thelinuxguy/openlp/fix-newline-bug into lp:openlp

2018-04-15 Thread Simon Hanna
Simon Hanna has proposed merging lp:~thelinuxguy/openlp/fix-newline-bug into 
lp:openlp.

Requested reviews:
  Phill (phill-ridout)
  Tim Bentley (trb143)
Related bugs:
  Bug #1727517 in OpenLP: "Unicode control chars causes song importer to crash"
  https://bugs.launchpad.net/openlp/+bug/1727517

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/fix-newline-bug/+merge/343277

Fix the fix for 1727517
-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/common/__init__.py'
--- openlp/core/common/__init__.py	2018-02-24 16:10:02 +
+++ openlp/core/common/__init__.py	2018-04-15 14:10:22 +
@@ -44,7 +44,7 @@
 
 FIRST_CAMEL_REGEX = re.compile('(.)([A-Z][a-z]+)')
 SECOND_CAMEL_REGEX = re.compile('([a-z0-9])([A-Z])')
-CONTROL_CHARS = re.compile(r'[\x00-\x1F\x7F-\x9F]')
+CONTROL_CHARS = re.compile(r'[\x00-\08\x0E-\x1F\x7F-\x9F]')
 INVALID_FILE_CHARS = re.compile(r'[\\/:\*\?"<>\|\+\[\]%]')
 IMAGES_FILTER = None
 REPLACMENT_CHARS_MAP = str.maketrans({'\u2018': '\'', '\u2019': '\'', '\u201c': '"', '\u201d': '"', '\u2026': '...',
@@ -471,15 +471,15 @@
 log.exception('Error detecting file encoding')
 
 
-def normalize_str(irreg_str):
+def normalize_str(string):
 """
 Normalize the supplied string. Remove unicode control chars and tidy up white space.
 
-:param str irreg_str: The string to normalize.
+:param str string: The string to normalize.
 :return: The normalized string
 :rtype: str
 """
-irreg_str = irreg_str.translate(REPLACMENT_CHARS_MAP)
-irreg_str = CONTROL_CHARS.sub('', irreg_str)
-irreg_str = NEW_LINE_REGEX.sub('\n', irreg_str)
-return WHITESPACE_REGEX.sub(' ', irreg_str)
+string = string.translate(REPLACMENT_CHARS_MAP)
+string = CONTROL_CHARS.sub('', string)
+string = NEW_LINE_REGEX.sub('\n', string)
+return WHITESPACE_REGEX.sub(' ', string)

=== modified file 'tests/functional/openlp_core/common/test_common.py'
--- tests/functional/openlp_core/common/test_common.py	2017-12-29 09:15:48 +
+++ tests/functional/openlp_core/common/test_common.py	2018-04-15 14:10:22 +
@@ -25,8 +25,8 @@
 from unittest import TestCase
 from unittest.mock import MagicMock, call, patch
 
-from openlp.core.common import clean_button_text, de_hump, extension_loader, is_macosx, is_linux, is_win, \
-path_to_module, trace_error_handler
+from openlp.core.common import clean_button_text, de_hump, extension_loader, is_macosx, is_linux, \
+is_win, normalize_str, path_to_module, trace_error_handler
 from openlp.core.common.path import Path
 
 
@@ -211,6 +211,30 @@
 assert is_win() is False, 'is_win() should return False'
 assert is_macosx() is False, 'is_macosx() should return False'
 
+def test_normalize_str_leaves_newlines(self):
+# GIVEN: a string containing newlines
+string = 'something\nelse'
+# WHEN: normalize is called
+normalized_string = normalize_str(string)
+# THEN: string is unchanged
+assert normalized_string == string
+
+def test_normalize_str_removes_null_byte(self):
+# GIVEN: a string containing newlines
+string = 'somet\x00hing'
+# WHEN: normalize is called
+normalized_string = normalize_str(string)
+# THEN: string is unchanged
+assert normalized_string == 'something'
+
+def test_normalize_str_replaces_crlf_with_lf(self):
+# GIVEN: a string containing crlf
+string = 'something\r\nelse'
+# WHEN: normalize is called
+normalized_string = normalize_str(string)
+# THEN: crlf is replaced with lf
+assert normalized_string == 'something\nelse'
+
 def test_clean_button_text(self):
 """
 Test the clean_button_text() function.

___
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:~thelinuxguy/openlp/fix-newline-bug into lp:openlp

2018-04-15 Thread Simon Hanna
The proposal to merge lp:~thelinuxguy/openlp/fix-newline-bug into lp:openlp has 
been updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/fix-newline-bug/+merge/343256
-- 
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:~thelinuxguy/openlp/fix-newline-bug into lp:openlp

2018-04-15 Thread Simon Hanna
will update shortly

Diff comments:

> === modified file 'openlp/core/common/__init__.py'
> --- openlp/core/common/__init__.py2018-02-24 16:10:02 +
> +++ openlp/core/common/__init__.py2018-04-14 20:05:07 +
> @@ -44,7 +44,7 @@
>  
>  FIRST_CAMEL_REGEX = re.compile('(.)([A-Z][a-z]+)')
>  SECOND_CAMEL_REGEX = re.compile('([a-z0-9])([A-Z])')
> -CONTROL_CHARS = re.compile(r'[\x00-\x1F\x7F-\x9F]')
> +CONTROL_CHARS = re.compile(r'[\x00-\08\x0E-\x1F\x7F-\x9F]')

I said, I don't know what all these replacement are actually about. I just 
excluded things that sound somewhat sane to me.
Note that you are performing these replacements for all songs for all input 
formats. I have no idea how different formats are specified and what is 
used/allowed and what not. Just blindly replacing stuff doesn't sound right.
For instance replacing tabs with nothing doesn't sound like the correct thing 
to do. Which is why I excluded the whole block of these.

I'd probably also argue, that these replacements should actually be carried out 
in the single importers, where you have knowledge about what you are getting.

>  INVALID_FILE_CHARS = re.compile(r'[\\/:\*\?"<>\|\+\[\]%]')
>  IMAGES_FILTER = None
>  REPLACMENT_CHARS_MAP = str.maketrans({'\u2018': '\'', '\u2019': '\'', 
> '\u201c': '"', '\u201d': '"', '\u2026': '...',
> @@ -471,15 +471,15 @@
>  log.exception('Error detecting file encoding')
>  
>  
> -def normalize_str(irreg_str):
> +def normalize_str(string):

it's not string but rather str that is the type, so string is perfectly fine

>  """
>  Normalize the supplied string. Remove unicode control chars and tidy up 
> white space.
>  
> -:param str irreg_str: The string to normalize.
> +:param str string: The string to normalize.
>  :return: The normalized string
>  :rtype: str
>  """
> -irreg_str = irreg_str.translate(REPLACMENT_CHARS_MAP)
> -irreg_str = CONTROL_CHARS.sub('', irreg_str)
> -irreg_str = NEW_LINE_REGEX.sub('\n', irreg_str)
> -return WHITESPACE_REGEX.sub(' ', irreg_str)
> +string = string.translate(REPLACMENT_CHARS_MAP)
> +string = CONTROL_CHARS.sub('', string)
> +string = NEW_LINE_REGEX.sub('\n', string)
> +return WHITESPACE_REGEX.sub(' ', string)
> 
> === modified file 'tests/functional/openlp_core/common/test_common.py'
> --- tests/functional/openlp_core/common/test_common.py2017-12-29 
> 09:15:48 +
> +++ tests/functional/openlp_core/common/test_common.py2018-04-14 
> 20:05:07 +
> @@ -25,8 +25,8 @@
>  from unittest import TestCase
>  from unittest.mock import MagicMock, call, patch
>  
> -from openlp.core.common import clean_button_text, de_hump, extension_loader, 
> is_macosx, is_linux, is_win, \
> -path_to_module, trace_error_handler
> +from openlp.core.common import (clean_button_text, de_hump, 
> extension_loader, is_macosx, is_linux,
> +is_win, normalize_str, path_to_module, 
> trace_error_handler)

I think that using backslashes in imports is a little weird, but I'll change it

>  from openlp.core.common.path import Path
>  
>  
> @@ -211,6 +211,30 @@
>  assert is_win() is False, 'is_win() should return False'
>  assert is_macosx() is False, 'is_macosx() should return False'
>  
> +def test_normalize_str_leaves_newlines(self):
> +# GIVEN: a string containing newlines
> +str = 'something\nelse'

yeah, it's just tests but I'll change them :-) (especially since I mentioned 
that it was a type in one comment :D)

> +# WHEN: normalize is called
> +normalized_string = normalize_str(str)
> +# THEN: string is unchanged
> +assert normalized_string == str
> +
> +def test_normalize_str_removes_null_byte(self):
> +# GIVEN: a string containing newlines
> +str = 'somet\x00hing'
> +# WHEN: normalize is called
> +normalized_string = normalize_str(str)
> +# THEN: string is unchanged
> +assert normalized_string == 'something'
> +
> +def test_normalize_str_replaces_crlf_with_lf(self):
> +# GIVEN: a string containing crlf
> +str = 'something\r\nelse'
> +# WHEN: normalize is called
> +normalized_string = normalize_str(str)
> +# THEN: crlf is replaced with lf
> +assert normalized_string == 'something\nelse'
> +
>  def test_clean_button_text(self):
>  """
>  Test the clean_button_text() function.


-- 
https://code.launchpad.net/~thelinuxguy/openlp/fix-newline-bug/+merge/343256
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:~thelinuxguy/openlp/fix-newline-bug into lp:openlp

2018-04-14 Thread Simon Hanna
Simon Hanna has proposed merging lp:~thelinuxguy/openlp/fix-newline-bug into 
lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #1727517 in OpenLP: "Unicode control chars causes song importer to crash"
  https://bugs.launchpad.net/openlp/+bug/1727517

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/fix-newline-bug/+merge/343256

Fix the fix for 1727517
-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~thelinuxguy/openlp/fix-newline-bug into lp:openlp.
=== modified file 'openlp/core/common/__init__.py'
--- openlp/core/common/__init__.py	2018-02-24 16:10:02 +
+++ openlp/core/common/__init__.py	2018-04-14 20:05:07 +
@@ -44,7 +44,7 @@
 
 FIRST_CAMEL_REGEX = re.compile('(.)([A-Z][a-z]+)')
 SECOND_CAMEL_REGEX = re.compile('([a-z0-9])([A-Z])')
-CONTROL_CHARS = re.compile(r'[\x00-\x1F\x7F-\x9F]')
+CONTROL_CHARS = re.compile(r'[\x00-\08\x0E-\x1F\x7F-\x9F]')
 INVALID_FILE_CHARS = re.compile(r'[\\/:\*\?"<>\|\+\[\]%]')
 IMAGES_FILTER = None
 REPLACMENT_CHARS_MAP = str.maketrans({'\u2018': '\'', '\u2019': '\'', '\u201c': '"', '\u201d': '"', '\u2026': '...',
@@ -471,15 +471,15 @@
 log.exception('Error detecting file encoding')
 
 
-def normalize_str(irreg_str):
+def normalize_str(string):
 """
 Normalize the supplied string. Remove unicode control chars and tidy up white space.
 
-:param str irreg_str: The string to normalize.
+:param str string: The string to normalize.
 :return: The normalized string
 :rtype: str
 """
-irreg_str = irreg_str.translate(REPLACMENT_CHARS_MAP)
-irreg_str = CONTROL_CHARS.sub('', irreg_str)
-irreg_str = NEW_LINE_REGEX.sub('\n', irreg_str)
-return WHITESPACE_REGEX.sub(' ', irreg_str)
+string = string.translate(REPLACMENT_CHARS_MAP)
+string = CONTROL_CHARS.sub('', string)
+string = NEW_LINE_REGEX.sub('\n', string)
+return WHITESPACE_REGEX.sub(' ', string)

=== modified file 'tests/functional/openlp_core/common/test_common.py'
--- tests/functional/openlp_core/common/test_common.py	2017-12-29 09:15:48 +
+++ tests/functional/openlp_core/common/test_common.py	2018-04-14 20:05:07 +
@@ -25,8 +25,8 @@
 from unittest import TestCase
 from unittest.mock import MagicMock, call, patch
 
-from openlp.core.common import clean_button_text, de_hump, extension_loader, is_macosx, is_linux, is_win, \
-path_to_module, trace_error_handler
+from openlp.core.common import (clean_button_text, de_hump, extension_loader, is_macosx, is_linux,
+is_win, normalize_str, path_to_module, trace_error_handler)
 from openlp.core.common.path import Path
 
 
@@ -211,6 +211,30 @@
 assert is_win() is False, 'is_win() should return False'
 assert is_macosx() is False, 'is_macosx() should return False'
 
+def test_normalize_str_leaves_newlines(self):
+# GIVEN: a string containing newlines
+str = 'something\nelse'
+# WHEN: normalize is called
+normalized_string = normalize_str(str)
+# THEN: string is unchanged
+assert normalized_string == str
+
+def test_normalize_str_removes_null_byte(self):
+# GIVEN: a string containing newlines
+str = 'somet\x00hing'
+# WHEN: normalize is called
+normalized_string = normalize_str(str)
+# THEN: string is unchanged
+assert normalized_string == 'something'
+
+def test_normalize_str_replaces_crlf_with_lf(self):
+# GIVEN: a string containing crlf
+str = 'something\r\nelse'
+# WHEN: normalize is called
+normalized_string = normalize_str(str)
+# THEN: crlf is replaced with lf
+assert normalized_string == 'something\nelse'
+
 def test_clean_button_text(self):
 """
 Test the clean_button_text() function.

___
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 1727517] Re: Unicode control chars causes song importer to crash

2018-04-14 Thread Simon Hanna
** Branch linked: lp:~thelinuxguy/openlp/fix-newline-bug

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

Title:
  Unicode control chars causes song importer to crash

Status in OpenLP:
  Fix Committed

Bug description:
  https://support.openlp.org/scp/tickets.php?id=4330

  Traceback (most recent call last):

  File "openlp\core\ui\wizard.py", line 216, in on_current_id_changed

  File "openlp\plugins\songs\forms\songimportform.py", line 351, in
  perform_wizard

  File "openlp\plugins\songs\lib\importers\songshowplus.py", line 183,
  in do_import

  File "openlp\plugins\songs\lib\importers\songimport.py", line 356, in
  finish

  File "openlp\plugins\songs\lib\openlyricsxml.py", line 102, in
  add_verse_to_lyrics

  File "lxml.etree.pyx", line 2972, in lxml.etree.CDATA.__cinit__
  (src\lxml\lxml.etree.c:69195)

  File "apihelpers.pxi", line 1393, in lxml.etree._utf8
  (src\lxml\lxml.etree.c:27125)

  ValueError: All strings must be XML compatible: Unicode or ASCII, no
  NULL bytes or control characters

  
  Reproducible on ubuntu 17.10 trunk r2780

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1727517/+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:~thelinuxguy/openlp/remove-version-check into lp:openlp

2018-03-25 Thread Simon Hanna
So after searching for about 30 minutes to find something to write a test for 
and finding something that I can test for (openlp.core.api.http.check_auth) I 
tried finding out what the function parameter actually is which I couldn't I 
gave up.

I fixed code, updated the tests. I currently don't have time to invest anymore 
in this...
-- 
https://code.launchpad.net/~thelinuxguy/openlp/remove-version-check/+merge/342063
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:~thelinuxguy/openlp/remove-version-check into lp:openlp

2018-03-25 Thread Simon Hanna
That really shouldn't be necessary. launchpad appears to support webhooks. If 
that isn't possible with launchpad, I'd seriously recommend moving away from it.
-- 
https://code.launchpad.net/~thelinuxguy/openlp/remove-version-check/+merge/342063
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:~thelinuxguy/openlp/remove-version-check into lp:openlp

2018-03-25 Thread Simon Hanna
Simon Hanna has proposed merging lp:~thelinuxguy/openlp/remove-version-check 
into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #1751626 in OpenLP: "-d flag is used in a very confusing way"
  https://bugs.launchpad.net/openlp/+bug/1751626

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/remove-version-check/+merge/342063

Remove the -d flag from cli arguments and don't show bzr revision in about page
-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~thelinuxguy/openlp/remove-version-check into lp:openlp.
=== modified file '.bzrignore'
--- .bzrignore	2017-12-29 10:40:07 +
+++ .bzrignore	2018-03-25 15:06:59 +
@@ -46,3 +46,4 @@
 htmlcov
 openlp-test-projectordb.sqlite
 .cache
+.pytest_cache

=== modified file 'openlp/core/app.py'
--- openlp/core/app.py	2018-02-03 12:03:37 +
+++ openlp/core/app.py	2018-03-25 15:06:59 +
@@ -303,8 +303,6 @@
 parser.add_argument('-p', '--portable', dest='portable', action='store_true',
 help='Specify if this should be run as a portable app, '
  'off a USB flash drive (not implemented).')
-parser.add_argument('-d', '--dev-version', dest='dev_version', action='store_true',
-help='Ignore the version file and pull the version directly from Bazaar')
 parser.add_argument('-w', '--no-web-server', dest='no_web_server', action='store_true',
 help='Turn off the Web and Socket Server ')
 parser.add_argument('rargs', nargs='?', default=[])

=== modified file 'openlp/core/version.py'
--- openlp/core/version.py	2018-01-04 06:10:20 +
+++ openlp/core/version.py	2018-03-25 15:06:59 +
@@ -136,42 +136,7 @@
 global APPLICATION_VERSION
 if APPLICATION_VERSION:
 return APPLICATION_VERSION
-if '--dev-version' in sys.argv or '-d' in sys.argv:
-# NOTE: The following code is a duplicate of the code in setup.py. Any fix applied here should also be applied
-# there.
-
-# Get the revision of this tree.
-bzr = Popen(('bzr', 'revno'), stdout=PIPE)
-tree_revision, error = bzr.communicate()
-tree_revision = tree_revision.decode()
-code = bzr.wait()
-if code != 0:
-raise Exception('Error running bzr log')
-
-# Get all tags.
-bzr = Popen(('bzr', 'tags'), stdout=PIPE)
-output, error = bzr.communicate()
-code = bzr.wait()
-if code != 0:
-raise Exception('Error running bzr tags')
-tags = list(map(bytes.decode, output.splitlines()))
-if not tags:
-tag_version = '0.0.0'
-tag_revision = '0'
-else:
-# Remove any tag that has "?" as revision number. A "?" as revision number indicates, that this tag is from
-# another series.
-tags = [tag for tag in tags if tag.split()[-1].strip() != '?']
-# Get the last tag and split it in a revision and tag name.
-tag_version, tag_revision = tags[-1].split()
-# If they are equal, then this tree is tarball with the source for the release. We do not want the revision
-# number in the full version.
-if tree_revision == tag_revision:
-full_version = tag_version.strip()
-else:
-full_version = '{tag}-bzr{tree}'.format(tag=tag_version.strip(), tree=tree_revision.strip())
 else:
-# We're not running the development version, let's use the file.
 file_path = AppLocation.get_directory(AppLocation.VersionDir) / '.version'
 try:
 full_version = file_path.read_text().rstrip()

=== modified file 'tests/functional/openlp_core/test_app.py'
--- tests/functional/openlp_core/test_app.py	2018-01-07 05:24:55 +
+++ tests/functional/openlp_core/test_app.py	2018-03-25 15:06:59 +
@@ -41,7 +41,6 @@
 args = parse_options()
 
 # THEN: the following fields will have been extracted.
-assert args.dev_version is False, 'The dev_version flag should be False'
 assert args.loglevel == 'warning', 'The log level should be set to warning'
 assert args.no_error_form is False, 'The no_error_form should be set to False'
 assert args.portable is False, 'The portable flag should be set to false'
@@ -59,7 +58,6 @@
 args = parse_options()
 
 # THEN: the following fields will have been extracted.
-assert args.dev_version is False, 'The dev_version flag should be False'
 assert args.loglevel == ' debug', 'The log level should be set to debug'
 assert args.no_error_form is False, 'The no_error_form should be set to False'
 assert args.portable is False, 'The portable flag should be set to false'
@@ -77,7 +75,6 @@
 args = parse_options()
 
 # THEN: the following fields will have been extracted.
-assert args.dev_version is False, 'The dev_version flag should be False'
 as

[Openlp-core] [Bug 1751626] Re: -d flag is used in a very confusing way

2018-03-19 Thread Simon Hanna
If you are ok with it, I would create a merge request that removes it.

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

Title:
  -d flag is used in a very confusing way

Status in OpenLP:
  Won't Fix

Bug description:
  in the startup code the parameters accepted include --dev-version
  (-d).

  What's irritating is that it's not actually used there. The values are
  also not actually passed along somewhere else.

  However the about dialog still correctly displays the bzr revision if
  started with -d.

  So a little searching showed the following. The argument is defined in
  openlp.core.app.parse_options but only used in
  openlp.core.version.get_version

  Since the dev_version is not stored somewhere or passed to some place,
  get_version actually checks sys.argv searching for "-d" or "--dev-
  version"

  This is not very nice to people reading the code. It very much looks
  like the argument definition is not actually used.

  My request:
  * either completely remove the functionality
  * or properly use the parsed value, so it's clear it actually does something.

  also having the bzr check code in openlp.core.version.get_version is
  probably not the best idea. Especially since the code includes a
  comment that it's a duplicate of code in setup.py

  Further rants:
  in setup.py the code is not actually exactly the same, there are 
modifications and there is a comment that it is a duplicate of the no longer 
existing openlp.core.common.checkversions.py 

  This illustrates that comments are bad for the reason that they are
  often not updated when the code changes. This can lead to comments
  confusing more than helping.

  
  In short:
  Remove the flag, remove the code from get_version and only have it in setup.py
  The flag is only useful for people running from bzr so devs, which should 
know what they are running and even if they don't they should know how to get 
that information without reverting to the about tab.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1751626/+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 1751626] Re: -d flag is used in a very confusing way

2018-03-10 Thread Simon Hanna
I know that it works as intended. Where are the tests for automated
upgrades and how do they use this functionality?

This is mainly a code style and code quality issue. And is a maintenance
nightmare.

If you want to keep it, make the code exist only once and actually use
the parsed argument.

The comments you made don't address my real issue with this. So I think
closing it like this is not the correct answer.

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

Title:
  -d flag is used in a very confusing way

Status in OpenLP:
  Won't Fix

Bug description:
  in the startup code the parameters accepted include --dev-version
  (-d).

  What's irritating is that it's not actually used there. The values are
  also not actually passed along somewhere else.

  However the about dialog still correctly displays the bzr revision if
  started with -d.

  So a little searching showed the following. The argument is defined in
  openlp.core.app.parse_options but only used in
  openlp.core.version.get_version

  Since the dev_version is not stored somewhere or passed to some place,
  get_version actually checks sys.argv searching for "-d" or "--dev-
  version"

  This is not very nice to people reading the code. It very much looks
  like the argument definition is not actually used.

  My request:
  * either completely remove the functionality
  * or properly use the parsed value, so it's clear it actually does something.

  also having the bzr check code in openlp.core.version.get_version is
  probably not the best idea. Especially since the code includes a
  comment that it's a duplicate of code in setup.py

  Further rants:
  in setup.py the code is not actually exactly the same, there are 
modifications and there is a comment that it is a duplicate of the no longer 
existing openlp.core.common.checkversions.py 

  This illustrates that comments are bad for the reason that they are
  often not updated when the code changes. This can lead to comments
  confusing more than helping.

  
  In short:
  Remove the flag, remove the code from get_version and only have it in setup.py
  The flag is only useful for people running from bzr so devs, which should 
know what they are running and even if they don't they should know how to get 
that information without reverting to the about tab.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1751626/+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 1751628] [NEW] portabe flag is marked as not implemented

2018-02-25 Thread Simon Hanna
Public bug reported:

OpenLP has a portable flag that runs OpenLP with a data/config directory
relative to the path where it's stored. I think it is built in a windows
specific way (where the stuff is then stored) but it seems to work
flawlessly on my linux machine.

However the output of -h says that it's not implemented. I am pretty
sure that the documentation is wrong, but someone else might know more
about that.

** Affects: openlp
 Importance: Undecided
 Status: New

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

Title:
  portabe flag is marked as not implemented

Status in OpenLP:
  New

Bug description:
  OpenLP has a portable flag that runs OpenLP with a data/config
  directory relative to the path where it's stored. I think it is built
  in a windows specific way (where the stuff is then stored) but it
  seems to work flawlessly on my linux machine.

  However the output of -h says that it's not implemented. I am pretty
  sure that the documentation is wrong, but someone else might know more
  about that.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1751628/+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 1751626] [NEW] -d flag is used in a very confusing way

2018-02-25 Thread Simon Hanna
Public bug reported:

in the startup code the parameters accepted include --dev-version (-d).

What's irritating is that it's not actually used there. The values are
also not actually passed along somewhere else.

However the about dialog still correctly displays the bzr revision if
started with -d.

So a little searching showed the following. The argument is defined in
openlp.core.app.parse_options but only used in
openlp.core.version.get_version

Since the dev_version is not stored somewhere or passed to some place,
get_version actually checks sys.argv searching for "-d" or "--dev-
version"

This is not very nice to people reading the code. It very much looks
like the argument definition is not actually used.

My request:
* either completely remove the functionality
* or properly use the parsed value, so it's clear it actually does something.

also having the bzr check code in openlp.core.version.get_version is
probably not the best idea. Especially since the code includes a comment
that it's a duplicate of code in setup.py

Further rants:
in setup.py the code is not actually exactly the same, there are modifications 
and there is a comment that it is a duplicate of the no longer existing 
openlp.core.common.checkversions.py 

This illustrates that comments are bad for the reason that they are
often not updated when the code changes. This can lead to comments
confusing more than helping.


In short:
Remove the flag, remove the code from get_version and only have it in setup.py
The flag is only useful for people running from bzr so devs, which should know 
what they are running and even if they don't they should know how to get that 
information without reverting to the about tab.

** Affects: openlp
 Importance: Undecided
 Status: New

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

Title:
  -d flag is used in a very confusing way

Status in OpenLP:
  New

Bug description:
  in the startup code the parameters accepted include --dev-version
  (-d).

  What's irritating is that it's not actually used there. The values are
  also not actually passed along somewhere else.

  However the about dialog still correctly displays the bzr revision if
  started with -d.

  So a little searching showed the following. The argument is defined in
  openlp.core.app.parse_options but only used in
  openlp.core.version.get_version

  Since the dev_version is not stored somewhere or passed to some place,
  get_version actually checks sys.argv searching for "-d" or "--dev-
  version"

  This is not very nice to people reading the code. It very much looks
  like the argument definition is not actually used.

  My request:
  * either completely remove the functionality
  * or properly use the parsed value, so it's clear it actually does something.

  also having the bzr check code in openlp.core.version.get_version is
  probably not the best idea. Especially since the code includes a
  comment that it's a duplicate of code in setup.py

  Further rants:
  in setup.py the code is not actually exactly the same, there are 
modifications and there is a comment that it is a duplicate of the no longer 
existing openlp.core.common.checkversions.py 

  This illustrates that comments are bad for the reason that they are
  often not updated when the code changes. This can lead to comments
  confusing more than helping.

  
  In short:
  Remove the flag, remove the code from get_version and only have it in setup.py
  The flag is only useful for people running from bzr so devs, which should 
know what they are running and even if they don't they should know how to get 
that information without reverting to the about tab.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1751626/+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 1533401] Re: Remote plugin stays active until a restart

2018-02-25 Thread Simon Hanna
So once downloaded it's always there, always running? In that case I'd
open a new bug to enable/disable the API. My remarks would pretty much
remain unchanged...

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

Title:
  Remote plugin stays active until a restart

Status in OpenLP:
  Won't Fix

Bug description:
  Deactivating the remote plugin has no effect until OpenLP is restarted

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1533401/+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 1533401] Re: Remote plugin stays active until a restart

2018-02-25 Thread Simon Hanna
TBH I'm not particularly happy about closing this as Won't Fix.
It's unexpected behavior and potentially a "security" issue. If you want to 
have it disabled at a given time, you have to restart, which is probably not 
the time that you want to restart.

It shouldn't be too complicated. My branch is probably outdated by now,
but tbh you didn't followup one the issues you had with it. If we are
able to shutdown the remote properly on OpenLP shutdown (which we
should!!), then we have to be able to do that without a OpenLP shutdown.
Otherwise something is wrong about the architecture. Also note that
other plugins can be disabled/enabled that way.

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

Title:
  Remote plugin stays active until a restart

Status in OpenLP:
  Won't Fix

Bug description:
  Deactivating the remote plugin has no effect until OpenLP is restarted

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1533401/+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 1744553] Re: replace live background with image causes crash

2018-02-25 Thread Simon Hanna
And we close it before that is added (double checked)?

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

Title:
  replace live background with image causes crash

Status in OpenLP:
  Won't Fix

Bug description:
  Here is the trace

  
  Traceback (most recent call last):
File "/home/sim/dev/openlp/trunk/openlp/core/ui/media/mediacontroller.py", 
line 219, in media_state_live
  self.media_play(self.display_controllers[DisplayControllerType.Live], 
True)
File "/home/sim/dev/openlp/trunk/openlp/core/ui/media/mediacontroller.py", 
line 639, in media_play
  if not 
self.current_media_players[controller.controller_type].play(display):
  KeyError: 0

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1744553/+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 1750447] Re: Can't import webbible

2018-02-20 Thread Simon Hanna
English bibles also result in an exception

It imports fine but then this happens
Traceback (most recent call last):
  File 
"/home/sim/dev/openlp/bible-improvements/openlp/plugins/bibles/lib/mediaitem.py",
 line 570, in on_version_combo_box_index_changed
self.initialise_advanced_bible(self.select_book_combo_box.currentData())
  File 
"/home/sim/dev/openlp/bible-improvements/openlp/plugins/bibles/lib/mediaitem.py",
 line 390, in initialise_advanced_bible
log.debug('initialise_advanced_bible {bible}, 
{ref}'.format(bible=self.bible.name, ref=last_book))
AttributeError: 'NoneType' object has no attribute 'name'

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

Title:
  Can't import webbible

Status in OpenLP:
  New

Bug description:
  Starting with on openlp configs or data, adding a couple of non-
  english bibles in FTW and then importing a new bible. I just
  downloaded the list and went with what was chosen.

  
  Here's the trace
  Traceback (most recent call last):
File "/home/sim/dev/openlp/trunk/openlp/core/widgets/wizard.py", line 228, 
in on_current_id_changed
  self.perform_wizard()
File 
"/home/sim/dev/openlp/trunk/openlp/plugins/bibles/forms/bibleimportform.py", 
line 794, in perform_wizard
  if importer.do_import(license_version) and not importer.stop_import_flag:
File 
"/home/sim/dev/openlp/trunk/openlp/plugins/bibles/lib/importers/http.py", line 
654, in do_import
  book_ref_id = self.get_book_ref_id_by_name(book, len(books), 
self.language_id)
File "/home/sim/dev/openlp/trunk/openlp/core/common/mixins.py", line 67, in 
wrapped
  raise e
File "/home/sim/dev/openlp/trunk/openlp/core/common/mixins.py", line 60, in 
wrapped
  return func(*args, **kwargs)
File "/home/sim/dev/openlp/trunk/openlp/plugins/bibles/lib/bibleimport.py", 
line 77, in get_book_ref_id_by_name
  book_id = AlternativeBookNamesDB.get_book_reference_id(book)
File "/home/sim/dev/openlp/trunk/openlp/plugins/bibles/lib/db.py", line 
809, in get_book_reference_id
  'SELECT book_reference_id, name FROM alternative_book_names')
File "/home/sim/dev/openlp/trunk/openlp/plugins/bibles/lib/db.py", line 
790, in run_sql
  cursor.execute(query, parameters)
  sqlite3.OperationalError: no such table: alternative_book_names

  
  I'm attaching a log

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1750447/+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 1750447] [NEW] Can't import webbible

2018-02-19 Thread Simon Hanna
Public bug reported:

Starting with on openlp configs or data, adding a couple of non-english
bibles in FTW and then importing a new bible. I just downloaded the list
and went with what was chosen.


Here's the trace
Traceback (most recent call last):
  File "/home/sim/dev/openlp/trunk/openlp/core/widgets/wizard.py", line 228, in 
on_current_id_changed
self.perform_wizard()
  File 
"/home/sim/dev/openlp/trunk/openlp/plugins/bibles/forms/bibleimportform.py", 
line 794, in perform_wizard
if importer.do_import(license_version) and not importer.stop_import_flag:
  File 
"/home/sim/dev/openlp/trunk/openlp/plugins/bibles/lib/importers/http.py", line 
654, in do_import
book_ref_id = self.get_book_ref_id_by_name(book, len(books), 
self.language_id)
  File "/home/sim/dev/openlp/trunk/openlp/core/common/mixins.py", line 67, in 
wrapped
raise e
  File "/home/sim/dev/openlp/trunk/openlp/core/common/mixins.py", line 60, in 
wrapped
return func(*args, **kwargs)
  File "/home/sim/dev/openlp/trunk/openlp/plugins/bibles/lib/bibleimport.py", 
line 77, in get_book_ref_id_by_name
book_id = AlternativeBookNamesDB.get_book_reference_id(book)
  File "/home/sim/dev/openlp/trunk/openlp/plugins/bibles/lib/db.py", line 809, 
in get_book_reference_id
'SELECT book_reference_id, name FROM alternative_book_names')
  File "/home/sim/dev/openlp/trunk/openlp/plugins/bibles/lib/db.py", line 790, 
in run_sql
cursor.execute(query, parameters)
sqlite3.OperationalError: no such table: alternative_book_names


I'm attaching a log

** Affects: openlp
 Importance: Undecided
 Status: New

** Attachment added: "openlp.log"
   https://bugs.launchpad.net/bugs/1750447/+attachment/5058448/+files/openlp.log

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

Title:
  Can't import webbible

Status in OpenLP:
  New

Bug description:
  Starting with on openlp configs or data, adding a couple of non-
  english bibles in FTW and then importing a new bible. I just
  downloaded the list and went with what was chosen.

  
  Here's the trace
  Traceback (most recent call last):
File "/home/sim/dev/openlp/trunk/openlp/core/widgets/wizard.py", line 228, 
in on_current_id_changed
  self.perform_wizard()
File 
"/home/sim/dev/openlp/trunk/openlp/plugins/bibles/forms/bibleimportform.py", 
line 794, in perform_wizard
  if importer.do_import(license_version) and not importer.stop_import_flag:
File 
"/home/sim/dev/openlp/trunk/openlp/plugins/bibles/lib/importers/http.py", line 
654, in do_import
  book_ref_id = self.get_book_ref_id_by_name(book, len(books), 
self.language_id)
File "/home/sim/dev/openlp/trunk/openlp/core/common/mixins.py", line 67, in 
wrapped
  raise e
File "/home/sim/dev/openlp/trunk/openlp/core/common/mixins.py", line 60, in 
wrapped
  return func(*args, **kwargs)
File "/home/sim/dev/openlp/trunk/openlp/plugins/bibles/lib/bibleimport.py", 
line 77, in get_book_ref_id_by_name
  book_id = AlternativeBookNamesDB.get_book_reference_id(book)
File "/home/sim/dev/openlp/trunk/openlp/plugins/bibles/lib/db.py", line 
809, in get_book_reference_id
  'SELECT book_reference_id, name FROM alternative_book_names')
File "/home/sim/dev/openlp/trunk/openlp/plugins/bibles/lib/db.py", line 
790, in run_sql
  cursor.execute(query, parameters)
  sqlite3.OperationalError: no such table: alternative_book_names

  
  I'm attaching a log

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1750447/+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 1748719] Re: deleting a bible causes a traceback

2018-02-11 Thread Simon Hanna
so it looks like the path contains the directory where the bibles are
stored and file contains a pathobject consisting on only a name, the
name of the bible db.

I didn't find uses of name. so I guess that can be removed.

Another weird thing about the BibleDB object is that it has a get_name
method that overwrites the name of the bible and then returns it. I
guess that's sort of valid, because I didn't find any occurrence of a
BibleDB object being created with a name, but it still looks weird...

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

Title:
  deleting a bible causes a traceback

Status in OpenLP:
  New

Bug description:
  Starting with no OpenLP config, when I import a couple of bibles
  during the FTW, and then delete a bible from the Library in the main
  interface I get a traceback.

  This happens in trunk

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1748719/+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 1748719] Re: deleting a bible causes a traceback

2018-02-11 Thread Simon Hanna
Hmm.. the bibles are a little messed up...

the init of a BibleDB object takes the following kwargs:

* path (path to the bible database file)
* name (name of the database, also used as file name for sqlite databases)
* file (no doc)

path and file are supposed to by Path objects, while the name is a
string.

It looks like during the migrations to the Paths, this was altered but
not to something useful.

especially the path and file look suspicious.

The cause of the actual bug is that the _setup method doesn't set
self.file which the delete method depends on.

It would be really helpful if all class attributes where defined in the
beginning of a class, so it's clear what the class supports and what
not. They don't have to be initialized there, but it should be easy to
see what attributes are available without looking through all methods in
the class searching for self.* to know what attributes are there.

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

Title:
  deleting a bible causes a traceback

Status in OpenLP:
  New

Bug description:
  Starting with no OpenLP config, when I import a couple of bibles
  during the FTW, and then delete a bible from the Library in the main
  interface I get a traceback.

  This happens in trunk

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1748719/+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 1748720] Re: FTW doesn't download the remote interface

2018-02-11 Thread Simon Hanna
hmm... I don't know where that should be done...
It looks like the migration to not include the web remote, didn't actually 
update the ftw.

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

Title:
  FTW doesn't download the remote interface

Status in OpenLP:
  New

Bug description:
  The FTW in trunk doesn't actually download the remote interface,
  although I checked the respective box

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1748720/+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 1748722] [NEW] Unable to query for bibles through the remote

2018-02-11 Thread Simon Hanna
Public bug reported:

Using OpenLP 2.4.6 the remote is currently unable to query bibles.

It seems to be a threading issue, here is a trace I encountered:


Exception happened during processing of request from ('127.0.0.1', 36114)
Traceback (most recent call last):
  File "/usr/lib/python3.6/socketserver.py", line 639, in process_request_thread
self.finish_request(request, client_address)
  File "/usr/lib/python3.6/socketserver.py", line 361, in finish_request
self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python3.6/socketserver.py", line 696, in __init__
self.handle()
  File "/usr/lib/python3.6/http/server.py", line 418, in handle
self.handle_one_request()
  File "/usr/lib/python3.6/http/server.py", line 406, in handle_one_request
method()
  File 
"/usr/lib/python3.6/site-packages/openlp/plugins/remotes/lib/httpserver.py", 
line 64, in do_GET
self.do_post_processor()
  File 
"/usr/lib/python3.6/site-packages/openlp/plugins/remotes/lib/httprouter.py", 
line 200, in do_post_processor
self.call_function(function, *args)
  File 
"/usr/lib/python3.6/site-packages/openlp/plugins/remotes/lib/httprouter.py", 
line 209, in call_function
response = function['function'](*args)
  File 
"/usr/lib/python3.6/site-packages/openlp/plugins/remotes/lib/httprouter.py", 
line 660, in search
results = plugin.media_item.search(text, False)
  File 
"/usr/lib/python3.6/site-packages/openlp/plugins/bibles/lib/mediaitem.py", line 
964, in search
search_results = self.plugin.manager.get_verses(bible, string, False, 
showError)
  File "/usr/lib/python3.6/site-packages/openlp/plugins/bibles/lib/manager.py", 
line 273, in get_verses
return self.db_cache[bible].get_verses(ref_list, show_error)
  File "/usr/lib/python3.6/site-packages/openlp/plugins/bibles/lib/http.py", 
line 701, in get_verses
return BibleDB.get_verses(self, reference_list, show_error)
  File "/usr/lib/python3.6/site-packages/openlp/plugins/bibles/lib/db.py", line 
387, in get_verses
end_verse = self.get_verse_count(book_id, chapter)
  File "/usr/lib/python3.6/site-packages/openlp/plugins/bibles/lib/http.py", 
line 741, in get_verse_count
return BiblesResourcesDB.get_verse_count(book_id, chapter)
  File "/usr/lib/python3.6/site-packages/openlp/plugins/bibles/lib/db.py", line 
671, in get_verse_count
details = BiblesResourcesDB.get_chapter(book_ref_id, chapter)
  File "/usr/lib/python3.6/site-packages/openlp/plugins/bibles/lib/db.py", line 
638, in get_chapter
'chapter, verse_count FROM chapters WHERE book_reference_id = ?', 
(book_ref_id,))
  File "/usr/lib/python3.6/site-packages/openlp/plugins/bibles/lib/db.py", line 
528, in run_sql
cursor.execute(query, parameters)
sqlite3.ProgrammingError: SQLite objects created in a thread can only be used 
in that same thread.The object was created in thread id 140286039147840 and 
this is thread id 140283320706816



I'm not sure if this should be fixed in 2.4 and released or just in
trunk...

While trying to replicate this in trunk I found a couple of other issues
that I opened. I'll try to see if I can fix them...

** Affects: openlp
 Importance: Undecided
 Status: New

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

Title:
  Unable to query for bibles through the remote

Status in OpenLP:
  New

Bug description:
  Using OpenLP 2.4.6 the remote is currently unable to query bibles.

  It seems to be a threading issue, here is a trace I encountered:

  
  Exception happened during processing of request from ('127.0.0.1', 36114)
  Traceback (most recent call last):
File "/usr/lib/python3.6/socketserver.py", line 639, in 
process_request_thread
  self.finish_request(request, client_address)
File "/usr/lib/python3.6/socketserver.py", line 361, in finish_request
  self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.6/socketserver.py", line 696, in __init__
  self.handle()
File "/usr/lib/python3.6/http/server.py", line 418, in handle
  self.handle_one_request()
File "/usr/lib/python3.6/http/server.py", line 406, in handle_one_request
  method()
File 
"/usr/lib/python3.6/site-packages/openlp/plugins/remotes/lib/httpserver.py", 
line 64, in do_GET
  self.do_post_processor()
File 
"/usr/lib/python3.6/site-packages/openlp/plugins/remotes/lib/httprouter.py", 
line 200, in do_post_processor
  self.call_function(function, *args)
File 
"/usr/lib/python3.6/site-packages/openlp/plugins/remotes/lib/httprouter.py", 
line 209, in call_function
  response = function['function'](*args)
File 
"/usr/lib/python3.6/site-packages/openlp/plugins/remotes/lib/httprouter.py", 
line 660, in search
  results = 

[Openlp-core] [Bug 1748719] [NEW] deleting a bible causes a traceback

2018-02-11 Thread Simon Hanna
Public bug reported:

Starting with no OpenLP config, when I import a couple of bibles during
the FTW, and then delete a bible from the Library in the main interface
I get a traceback.

This happens in trunk

** Affects: openlp
 Importance: Undecided
 Status: New

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

Title:
  deleting a bible causes a traceback

Status in OpenLP:
  New

Bug description:
  Starting with no OpenLP config, when I import a couple of bibles
  during the FTW, and then delete a bible from the Library in the main
  interface I get a traceback.

  This happens in trunk

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1748719/+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 1748720] [NEW] FTW doesn't download the remote interface

2018-02-11 Thread Simon Hanna
Public bug reported:

The FTW in trunk doesn't actually download the remote interface,
although I checked the respective box

** Affects: openlp
 Importance: Undecided
 Status: New

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

Title:
  FTW doesn't download the remote interface

Status in OpenLP:
  New

Bug description:
  The FTW in trunk doesn't actually download the remote interface,
  although I checked the respective box

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1748720/+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:~tomasgroth/openlp/remote-sync into lp:openlp

2018-01-24 Thread Simon Hanna
I like the idea very much. I'm currently working on a side project to implement 
a server with a database to view and eventually also sync songs. So I will like 
to consume what you are doing here :-)

I'm not sure if this is the right place to discuss things, point me somewhere 
else if you think so!

- Could you add comments to the Synchronizer(Interface) documenting what the 
methods should do?
- There should be a method to get remote changes(uuids prob) which probably 
takes a datetime object.


Things that I would like to see:
- Use something other than xml (personal dislike). maybe json?
- Allow multiple remotes to exist, possibly only taking care of specific object 
types (One remote for songs, other for images, ...) That would allow remotes to 
not have to support everything.
-- 
https://code.launchpad.net/~tomasgroth/openlp/remote-sync/+merge/336573
Your team OpenLP Core is requested to review the proposed merge of 
lp:~tomasgroth/openlp/remote-sync 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] [Bug 1744553] Re: replace live background with image causes crash

2018-01-21 Thread Simon Hanna
hmm.. can't reproduce it again...

But now it takes two clicks on replace live background to get it to
actually replace it...

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

Title:
  replace live background with image causes crash

Status in OpenLP:
  New

Bug description:
  Here is the trace

  
  Traceback (most recent call last):
File "/home/sim/dev/openlp/trunk/openlp/core/ui/media/mediacontroller.py", 
line 219, in media_state_live
  self.media_play(self.display_controllers[DisplayControllerType.Live], 
True)
File "/home/sim/dev/openlp/trunk/openlp/core/ui/media/mediacontroller.py", 
line 639, in media_play
  if not 
self.current_media_players[controller.controller_type].play(display):
  KeyError: 0

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1744553/+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 1744553] [NEW] replace live background with image causes crash

2018-01-21 Thread Simon Hanna
Public bug reported:

Here is the trace


Traceback (most recent call last):
  File "/home/sim/dev/openlp/trunk/openlp/core/ui/media/mediacontroller.py", 
line 219, in media_state_live
self.media_play(self.display_controllers[DisplayControllerType.Live], True)
  File "/home/sim/dev/openlp/trunk/openlp/core/ui/media/mediacontroller.py", 
line 639, in media_play
if not self.current_media_players[controller.controller_type].play(display):
KeyError: 0

** Affects: openlp
 Importance: Undecided
 Status: New

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

Title:
  replace live background with image causes crash

Status in OpenLP:
  New

Bug description:
  Here is the trace

  
  Traceback (most recent call last):
File "/home/sim/dev/openlp/trunk/openlp/core/ui/media/mediacontroller.py", 
line 219, in media_state_live
  self.media_play(self.display_controllers[DisplayControllerType.Live], 
True)
File "/home/sim/dev/openlp/trunk/openlp/core/ui/media/mediacontroller.py", 
line 639, in media_play
  if not 
self.current_media_players[controller.controller_type].play(display):
  KeyError: 0

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1744553/+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 Simon Hanna
The issue seems to be that the threads are all stored in the mainwindow
which isn't always there.

If you run the first time wizard in the very beginning, no mainwindow
exists.

So the threads should probably be attached to something that is created
much earlier, before anything else is done, so it's guaranteed to be
always there.

-- 
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] [NEW] first time wizard crashes

2018-01-12 Thread Simon Hanna
Public bug reported:

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.

** Affects: openlp
 Importance: Critical
 Status: New


** Tags: ftw threads

-- 
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:~thelinuxguy/openlp/fix-version-check into lp:openlp

2017-12-29 Thread Simon Hanna
Simon Hanna has proposed merging lp:~thelinuxguy/openlp/fix-version-check into 
lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/fix-version-check/+merge/335602

Fixed the version checking to be more robust

* Strip the response so empty responses that contain whitespace are in fact 
empty
* Change http to https to result in one less query
* Add test for responses containing white space
* Add .cache to bzrignore (generated by pytest when tests fail)
-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~thelinuxguy/openlp/fix-version-check into lp:openlp.
=== modified file '.bzrignore'
--- .bzrignore	2017-10-10 07:08:44 +
+++ .bzrignore	2017-12-29 10:42:37 +
@@ -45,3 +45,4 @@
 output
 htmlcov
 openlp-test-projectordb.sqlite
+.cache

=== modified file 'openlp/core/version.py'
--- openlp/core/version.py	2017-11-18 11:23:15 +
+++ openlp/core/version.py	2017-12-29 10:42:37 +
@@ -76,12 +76,12 @@
 """
 log.debug('VersionWorker - Start')
 # I'm not entirely sure why this was here, I'm commenting it out until I hit the same scenario
-time.sleep(1)
-download_url = 'http://www.openlp.org/files/version.txt'
+# time.sleep(1)
+download_url = 'https://www.openlp.org/files/version.txt'
 if self.current_version['build']:
-download_url = 'http://www.openlp.org/files/nightly_version.txt'
+download_url = 'https://www.openlp.org/files/nightly_version.txt'
 elif int(self.current_version['version'].split('.')[1]) % 2 != 0:
-download_url = 'http://www.openlp.org/files/dev_version.txt'
+download_url = 'https://www.openlp.org/files/dev_version.txt'
 headers = {
 'User-Agent': 'OpenLP/{version} {system}/{release}; '.format(version=self.current_version['full'],
  system=platform.system(),
@@ -92,7 +92,7 @@
 while retries < 3:
 try:
 response = requests.get(download_url, headers=headers)
-remote_version = response.text
+remote_version = response.text.strip()
 log.debug('New version found: %s', remote_version)
 break
 except OSError:

=== modified file 'tests/functional/openlp_core/test_version.py'
--- tests/functional/openlp_core/test_version.py	2017-09-13 06:08:38 +
+++ tests/functional/openlp_core/test_version.py	2017-12-29 10:42:37 +
@@ -63,7 +63,7 @@
 worker.start()
 
 # THEN: The check completes and the signal is emitted
-expected_download_url = 'http://www.openlp.org/files/version.txt'
+expected_download_url = 'https://www.openlp.org/files/version.txt'
 expected_headers = {'User-Agent': 'OpenLP/2.0 Linux/4.12.0-1-amd64; '}
 mock_requests.get.assert_called_once_with(expected_download_url, headers=expected_headers)
 mock_new_version.emit.assert_called_once_with('2.4.6')
@@ -88,7 +88,7 @@
 worker.start()
 
 # THEN: The check completes and the signal is emitted
-expected_download_url = 'http://www.openlp.org/files/dev_version.txt'
+expected_download_url = 'https://www.openlp.org/files/dev_version.txt'
 expected_headers = {'User-Agent': 'OpenLP/2.1.3 Linux/4.12.0-1-amd64; '}
 mock_requests.get.assert_called_once_with(expected_download_url, headers=expected_headers)
 mock_new_version.emit.assert_called_once_with('2.4.6')
@@ -113,7 +113,7 @@
 worker.start()
 
 # THEN: The check completes and the signal is emitted
-expected_download_url = 'http://www.openlp.org/files/nightly_version.txt'
+expected_download_url = 'https://www.openlp.org/files/nightly_version.txt'
 expected_headers = {'User-Agent': 'OpenLP/2.1-bzr2345 Linux/4.12.0-1-amd64; '}
 mock_requests.get.assert_called_once_with(expected_download_url, headers=expected_headers)
 mock_new_version.emit.assert_called_once_with('2.4.6')
@@ -122,6 +122,31 @@
 
 @patch('openlp.core.version.platform')
 @patch('openlp.core.version.requests')
+def test_worker_empty_response(mock_requests, mock_platform):
+"""Test the VersionWorkder.start() method for empty responses"""
+# GIVEN: A last check date, current version, and an instance of worker
+last_check_date = '1970-01-01'
+current_version = {'full': '2.1-bzr2345', 'version': '2.1', 'build': '2345'}
+mock_platform.system.return_value = 'Linux'
+mock_platform.release.return_value = '4.12.0-1-amd64'
+mock_requests.get.return_value = MagicMock(text='\n')
+worker = VersionWorker(last_check_date, current_version)
+
+# WHEN: The worker is run
+with patch.object(worker, 'new_version') as mock_new_version, \
+patch.object(worker, 'quit') as mock_quit:
+worker.start()
+
+# THEN: The check completes and 

[Openlp-core] [Bug 1735765] [NEW] Launching OpenLP in portable mode results in a traceback

2017-12-01 Thread Simon Hanna
Public bug reported:

Here is a traceback:


~/dev/openlp/trunk 27s
env ❯ python openlp.py -p   
Traceback (most recent call last):
  File "openlp.py", line 60, in 
main()
  File "/home/sim/dev/openlp/trunk/openlp/core/app.py", line 409, in main
settings.upgrade_settings()
  File "/home/sim/dev/openlp/trunk/openlp/core/common/settings.py", line 496, 
in upgrade_settings
new_value = new_rule(*old_values)
  File "/home/sim/dev/openlp/trunk/openlp/core/common/path.py", line 209, in 
str_to_path
raise TypeError('parameter \'string\' must be of type str')
TypeError: parameter 'string' must be of type str

** Affects: openlp
 Importance: Undecided
 Status: New

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

Title:
  Launching OpenLP in portable mode results in a traceback

Status in OpenLP:
  New

Bug description:
  Here is a traceback:

  
  ~/dev/openlp/trunk 27s
  env ❯ python openlp.py -p   
  Traceback (most recent call last):
File "openlp.py", line 60, in 
  main()
File "/home/sim/dev/openlp/trunk/openlp/core/app.py", line 409, in main
  settings.upgrade_settings()
File "/home/sim/dev/openlp/trunk/openlp/core/common/settings.py", line 496, 
in upgrade_settings
  new_value = new_rule(*old_values)
File "/home/sim/dev/openlp/trunk/openlp/core/common/path.py", line 209, in 
str_to_path
  raise TypeError('parameter \'string\' must be of type str')
  TypeError: parameter 'string' must be of type str

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1735765/+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 1735766] [NEW] Launching Openlp with -w results in a traceback

2017-12-01 Thread Simon Hanna
Public bug reported:

The traceback isn't shown on the command line but in a Bug report
window. Here is the traceback:


Traceback (most recent call last):
  File "openlp.py", line 60, in 
main()
  File "/home/sim/dev/openlp/trunk/openlp/core/app.py", line 425, in main
sys.exit(application.run(qt_args))
  File "/home/sim/dev/openlp/trunk/openlp/core/app.py", line 119, in run
Registry().execute('bootstrap_post_set_up')
  File "/home/sim/dev/openlp/trunk/openlp/core/common/registry.py", line 146, 
in execute
result = function(*args, **kwargs)
  File "/home/sim/dev/openlp/trunk/openlp/core/ui/settingsform.py", line 163, 
in bootstrap_post_set_up
self.api_tab = ApiTab(self)
  File "/home/sim/dev/openlp/trunk/openlp/core/api/tab.py", line 42, in __init__
super(ApiTab, self).__init__(parent, 'api', advanced_translated)
  File "/home/sim/dev/openlp/trunk/openlp/core/lib/settingstab.py", line 51, in 
__init__
self._setup()
  File "/home/sim/dev/openlp/trunk/openlp/core/lib/settingstab.py", line 60, in 
_setup
self.load()
  File "/home/sim/dev/openlp/trunk/openlp/core/api/tab.py", line 249, in load
self.master_version_value.setText(Registry().get_flag('website_version'))
  File "/home/sim/dev/openlp/trunk/openlp/core/common/registry.py", line 170, 
in get_flag
raise KeyError('Working Flag {key} not found in list'.format(key=key))
KeyError: 'Working Flag website_version not found in list'

** Affects: openlp
 Importance: Undecided
 Status: New

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

Title:
  Launching Openlp with -w results in a traceback

Status in OpenLP:
  New

Bug description:
  The traceback isn't shown on the command line but in a Bug report
  window. Here is the traceback:

  
  Traceback (most recent call last):
File "openlp.py", line 60, in 
  main()
File "/home/sim/dev/openlp/trunk/openlp/core/app.py", line 425, in main
  sys.exit(application.run(qt_args))
File "/home/sim/dev/openlp/trunk/openlp/core/app.py", line 119, in run
  Registry().execute('bootstrap_post_set_up')
File "/home/sim/dev/openlp/trunk/openlp/core/common/registry.py", line 146, 
in execute
  result = function(*args, **kwargs)
File "/home/sim/dev/openlp/trunk/openlp/core/ui/settingsform.py", line 163, 
in bootstrap_post_set_up
  self.api_tab = ApiTab(self)
File "/home/sim/dev/openlp/trunk/openlp/core/api/tab.py", line 42, in 
__init__
  super(ApiTab, self).__init__(parent, 'api', advanced_translated)
File "/home/sim/dev/openlp/trunk/openlp/core/lib/settingstab.py", line 51, 
in __init__
  self._setup()
File "/home/sim/dev/openlp/trunk/openlp/core/lib/settingstab.py", line 60, 
in _setup
  self.load()
File "/home/sim/dev/openlp/trunk/openlp/core/api/tab.py", line 249, in load
  self.master_version_value.setText(Registry().get_flag('website_version'))
File "/home/sim/dev/openlp/trunk/openlp/core/common/registry.py", line 170, 
in get_flag
  raise KeyError('Working Flag {key} not found in list'.format(key=key))
  KeyError: 'Working Flag website_version not found in list'

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1735766/+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:~thelinuxguy/openlp/backport-fix into lp:openlp/2.4

2017-03-29 Thread Simon Hanna
Simon Hanna has proposed merging lp:~thelinuxguy/openlp/backport-fix into 
lp:openlp/2.4.

Requested reviews:
  Tim Bentley (trb143)

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/backport-fix/+merge/321379

Backport songbeamer fix
-- 
Your team OpenLP Core is subscribed to branch lp:openlp/2.4.
=== modified file 'openlp/plugins/songs/lib/importers/songbeamer.py'
--- openlp/plugins/songs/lib/importers/songbeamer.py	2017-01-22 17:04:32 +
+++ openlp/plugins/songs/lib/importers/songbeamer.py	2017-03-29 22:05:48 +
@@ -22,11 +22,10 @@
 """
 The :mod:`songbeamer` module provides the functionality for importing SongBeamer songs into the OpenLP database.
 """
-import chardet
-import codecs
 import logging
 import os
 import re
+import chardet
 
 from openlp.plugins.songs.lib import VerseType
 from openlp.plugins.songs.lib.importers.songimport import SongImport
@@ -120,7 +119,7 @@
 # The encoding should only be ANSI (cp1252), UTF-8, Unicode, Big-Endian-Unicode.
 # So if it doesn't start with 'u' we default to cp1252. See:
 # https://forum.songbeamer.com/viewtopic.php?p=419=ca4814924e37c11e4438b7272a98b6f2
-if self.input_file_encoding.lower().startswith('u'):
+if not self.input_file_encoding.lower().startswith('u'):
 self.input_file_encoding = 'cp1252'
 infile = open(import_file, 'rt', encoding=self.input_file_encoding)
 song_data = infile.readlines()

=== modified file 'tests/functional/openlp_plugins/songs/test_songbeamerimport.py'
--- tests/functional/openlp_plugins/songs/test_songbeamerimport.py	2016-12-31 11:05:48 +
+++ tests/functional/openlp_plugins/songs/test_songbeamerimport.py	2017-03-29 22:05:48 +
@@ -49,6 +49,13 @@
 self.file_import([os.path.join(TEST_PATH, 'Lobsinget dem Herrn.sng')],
  self.load_external_result_data(os.path.join(TEST_PATH, 'Lobsinget dem Herrn.json')))
 
+def test_cp1252_encoded_file(self):
+"""
+Test that a CP1252 encoded file get's decoded properly.
+"""
+self.file_import([os.path.join(TEST_PATH, 'cp1252song.sng')],
+ self.load_external_result_data(os.path.join(TEST_PATH, 'cp1252song.json')))
+
 
 class TestSongBeamerImport(TestCase):
 """

=== added file 'tests/resources/songbeamersongs/cp1252song.json'
--- tests/resources/songbeamersongs/cp1252song.json	1970-01-01 00:00:00 +
+++ tests/resources/songbeamersongs/cp1252song.json	2017-03-29 22:05:48 +
@@ -0,0 +1,8 @@
+{
+"title": "Some Song",
+ "authors": ["Author"],
+ "verses" : [
+   ["Here are a couple of \"weird\" chars’’’.\n", "v"],
+   ["Here is another one….\n\n", "v"]
+ ]
+}

=== added file 'tests/resources/songbeamersongs/cp1252song.sng'
--- tests/resources/songbeamersongs/cp1252song.sng	1970-01-01 00:00:00 +
+++ tests/resources/songbeamersongs/cp1252song.sng	2017-03-29 22:05:48 +
@@ -0,0 +1,15 @@
+#LangCount=1
+#Editor=SongBeamer 4.28a
+#Version=3
+#Format=F/K//
+#TitleFormat=U
+#Title=Some Song
+#Author=Author
+#Melody=Author
+#(c)=No copyright
+#CCLI=00
+---
+Here are a couple of "weird" chars’’’.
+---
+Here is another one….
+

___
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:~thelinuxguy/openlp/backport-fix into lp:openlp/2.4

2017-03-29 Thread Simon Hanna
The proposal to merge lp:~thelinuxguy/openlp/backport-fix into lp:openlp/2.4 
has been updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/backport-fix/+merge/321284
-- 
Your team OpenLP Core is subscribed to branch lp:openlp/2.4.

___
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 1677262] [NEW] Two tests with same name

2017-03-29 Thread Simon Hanna
Public bug reported:

In `tests/functional/openlp_plugins/songs/test_lib.py` two functions
with the name `test_remove_typos_beginning_negated` exist. They are
different, but I'm not sure if both are valid. One should be either
removed or renamed.

** Affects: openlp
 Importance: Undecided
 Status: New

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

Title:
  Two tests with same name

Status in OpenLP:
  New

Bug description:
  In `tests/functional/openlp_plugins/songs/test_lib.py` two functions
  with the name `test_remove_typos_beginning_negated` exist. They are
  different, but I'm not sure if both are valid. One should be either
  removed or renamed.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1677262/+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:~thelinuxguy/openlp/backport-fix into lp:openlp/2.4

2017-03-29 Thread Simon Hanna
Simon Hanna has proposed merging lp:~thelinuxguy/openlp/backport-fix into 
lp:openlp/2.4.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/backport-fix/+merge/321284

Backport songbeamer fix
-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~thelinuxguy/openlp/backport-fix into lp:openlp/2.4.
=== modified file 'openlp/plugins/songs/lib/importers/songbeamer.py'
--- openlp/plugins/songs/lib/importers/songbeamer.py	2017-01-22 17:04:32 +
+++ openlp/plugins/songs/lib/importers/songbeamer.py	2017-03-29 12:16:17 +
@@ -22,8 +22,6 @@
 """
 The :mod:`songbeamer` module provides the functionality for importing SongBeamer songs into the OpenLP database.
 """
-import chardet
-import codecs
 import logging
 import os
 import re
@@ -120,7 +118,7 @@
 # The encoding should only be ANSI (cp1252), UTF-8, Unicode, Big-Endian-Unicode.
 # So if it doesn't start with 'u' we default to cp1252. See:
 # https://forum.songbeamer.com/viewtopic.php?p=419=ca4814924e37c11e4438b7272a98b6f2
-if self.input_file_encoding.lower().startswith('u'):
+if not self.input_file_encoding.lower().startswith('u'):
 self.input_file_encoding = 'cp1252'
 infile = open(import_file, 'rt', encoding=self.input_file_encoding)
 song_data = infile.readlines()

=== modified file 'tests/functional/openlp_plugins/songs/test_songbeamerimport.py'
--- tests/functional/openlp_plugins/songs/test_songbeamerimport.py	2016-12-31 11:05:48 +
+++ tests/functional/openlp_plugins/songs/test_songbeamerimport.py	2017-03-29 12:16:17 +
@@ -49,6 +49,13 @@
 self.file_import([os.path.join(TEST_PATH, 'Lobsinget dem Herrn.sng')],
  self.load_external_result_data(os.path.join(TEST_PATH, 'Lobsinget dem Herrn.json')))
 
+def test_cp1252_encoded_file(self):
+"""
+Test that a CP1252 encoded file get's decoded properly.
+"""
+self.file_import([os.path.join(TEST_PATH, 'cp1252song.sng')],
+ self.load_external_result_data(os.path.join(TEST_PATH, 'cp1252song.json')))
+
 
 class TestSongBeamerImport(TestCase):
 """

=== added file 'tests/resources/songbeamersongs/cp1252song.json'
--- tests/resources/songbeamersongs/cp1252song.json	1970-01-01 00:00:00 +
+++ tests/resources/songbeamersongs/cp1252song.json	2017-03-29 12:16:17 +
@@ -0,0 +1,8 @@
+{
+"title": "Some Song",
+ "authors": ["Author"],
+ "verses" : [
+   ["Here are a couple of \"weird\" chars’’’.\n", "v"],
+   ["Here is another one….\n\n", "v"]
+ ]
+}

=== added file 'tests/resources/songbeamersongs/cp1252song.sng'
--- tests/resources/songbeamersongs/cp1252song.sng	1970-01-01 00:00:00 +
+++ tests/resources/songbeamersongs/cp1252song.sng	2017-03-29 12:16:17 +
@@ -0,0 +1,15 @@
+#LangCount=1
+#Editor=SongBeamer 4.28a
+#Version=3
+#Format=F/K//
+#TitleFormat=U
+#Title=Some Song
+#Author=Author
+#Melody=Author
+#(c)=No copyright
+#CCLI=00
+---
+Here are a couple of "weird" chars’’’.
+---
+Here is another one….
+

___
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 1666006] Re: Song Editor alway saves theme

2017-03-29 Thread Simon Hanna
I can also confirm this is happening on 2.4.5 (archlinux) 
BUT it appears to be fixed in trunk

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

Title:
  Song Editor alway saves theme

Status in OpenLP:
  New

Bug description:
  OS:
  Ubuntu 16.10

  OpenLP
  2.4.5 (Previous version was not affected)
  PPA: http://ppa.launchpad.net/openlp-core/release/ubuntu yakkety main
  Installed version: 2.4.5-1~16.10

  Step to reproduce
  1. Add a new Song.
  2. Type some title and text for Lyrics, and add one author. Save it.
  3. Reopen it: There is an unwanted theme selected in 3td tab. Theme is the 
first theme in the list.

  Can anyone confirm this? Is this a database bug in my case, or a
  program bug?

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1666006/+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 1677152] [NEW] Why is all the projector stuff not a plugin?

2017-03-29 Thread Simon Hanna
Public bug reported:

Shouldn't the projector stuff be a plugin so it can be enabled/disabled?
I'm pretty sure a lot of churches don't have a compatible projector so
they can't use it.

** Affects: openlp
 Importance: Undecided
 Status: New

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

Title:
  Why is all the projector stuff not a plugin?

Status in OpenLP:
  New

Bug description:
  Shouldn't the projector stuff be a plugin so it can be
  enabled/disabled? I'm pretty sure a lot of churches don't have a
  compatible projector so they can't use it.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1677152/+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 1675587] [NEW] Allow creating Custom Slides from Library

2017-03-23 Thread Simon Hanna
Public bug reported:

Currently creating custom slides based on some item from the library is
only supported, if it's added to a service. It would be nice if items
that support this feature have it in the context-menu in the library
itself.

Based on issue reported in the forum
https://forums.openlp.org/discussion/3463/aktuelle-probleme#latest (It's
in german, the issue is regarding his first point if you use google
translate)

** Affects: openlp
 Importance: Undecided
 Status: New

** Description changed:

  Currently creating custom slides based on some item from the library is
  only supported, if it's added to a service. It would be nice if items
  that support this feature have it in the context-menu in the library
  itself.
+ 
+ Based on issue reported in the forum
+ https://forums.openlp.org/discussion/3463/aktuelle-probleme#latest (It's
+ in german, the issue is regarding his first point if you use google
+ translate)

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

Title:
  Allow creating Custom Slides from Library

Status in OpenLP:
  New

Bug description:
  Currently creating custom slides based on some item from the library
  is only supported, if it's added to a service. It would be nice if
  items that support this feature have it in the context-menu in the
  library itself.

  Based on issue reported in the forum
  https://forums.openlp.org/discussion/3463/aktuelle-probleme#latest
  (It's in german, the issue is regarding his first point if you use
  google translate)

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

2017-03-17 Thread Simon Hanna
Simon Hanna has proposed merging lp:~thelinuxguy/openlp/website-fixes into 
lp:openlp/website.

Requested reviews:
  Raoul Snyman (raoul-snyman)

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/website-fixes/+merge/320271

A fix for the social buttons appearing on more than one line.
I hope this mr is correct is filed against the correct branch...
-- 
Your team OpenLP Core is subscribed to branch lp:openlp/website.
=== modified file 'themes/openlp2v2/assets/css/custom.css'
--- themes/openlp2v2/assets/css/custom.css	2016-05-09 21:16:37 +
+++ themes/openlp2v2/assets/css/custom.css	2017-03-18 01:25:49 +
@@ -7,6 +7,12 @@
 License: Creative Commons Attribution 3.0 License (https://creativecommons.org/licenses/by/3.0/)
 File Description: Place here your custom CSS styles
 */
+@media (max-width: 767px) {
+.navbar-collapse {
+background-color: rgba(0, 0, 0, 0.90);
+}
+}
+
 .bg-image-1 {
 background: url("../images/worship-1.jpg") 50% 0px no-repeat;
 }
@@ -55,6 +61,11 @@
 text-shadow: 1px 1px 2px #000;
 }
 
+div#feature-details div.row {
+  margin-bottom: 5px;
+  margin-top: 5px;
+}
+
 div.product-chooser div.product-chooser-item {
 padding: 11px;
 border-radius: 6px;
@@ -276,10 +287,12 @@
 }
 
 .social-links {
-margin-left: auto;
-margin-right: auto;
-padding-left: 36px;
-width: 463px;
+text-align: center;
+}
+
+.social-links li {
+margin: 10px;
+width: 54px;
 }
 
 .social-links li.reddit a:hover {

=== modified file 'themes/openlp2v2/templates/front_page.html'
--- themes/openlp2v2/templates/front_page.html	2017-02-05 00:42:32 +
+++ themes/openlp2v2/templates/front_page.html	2017-03-18 01:25:49 +
@@ -156,7 +156,7 @@
 
 
 
-
+
 Features
 
 
@@ -170,6 +170,21 @@
 
 
 
+
+
+
+
+
+
+
+Media
+Integration with VLC means that you can display almost any video file and play almost any audio file in OpenLP. Using VLC means that a wide variety of formats are supported.
+
+
+
+
+
+
 
 
 Bibles
@@ -179,6 +194,21 @@
 
 
 
+
+
+
+
+
+
+
+Custom Slides
+Store your liturgy, announcements, or other custom slides in OpenLP. Just like a song, but with less structure, custom slides can also contain formatting and can be set to loop.
+
+
+
+
+
+
 
 
 Presentations
@@ -188,6 +218,21 @@
 
 
 
+
+
+
+
+
+
+
+Android/iOS Remote
+Control OpenLP remotely using any tablet or phone using our remote apps in the Google Play Store and Apple App Store. Search, go live, control slides, and more. Also accessible via any phone's web browser.
+
+
+
+
+
+
 
 
 Pictures
@@ -198,37 +243,9 @@
 
 
 
-
 
 
 
-
-
-
-Media
-Integration with VLC means that you can display almost any video file and play almost any audio file in OpenLP. Using VLC means that a wide variety of formats are

[Openlp-core] [Merge] lp:~thelinuxguy/openlp/website-fixes into lp:openlp/website

2017-03-17 Thread Simon Hanna
The proposal to merge lp:~thelinuxguy/openlp/website-fixes into 
lp:openlp/website has been updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/website-fixes/+merge/320184
-- 
Your team OpenLP Core is subscribed to branch lp:openlp/website.

___
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:~thelinuxguy/openlp/website-fixes into lp:openlp/website

2017-03-17 Thread Simon Hanna
You're right, it can be removed. I don't think there are any conflicting 
elements...
-- 
https://code.launchpad.net/~thelinuxguy/openlp/website-fixes/+merge/320184
Your team OpenLP Core is requested to review the proposed merge of 
lp:~thelinuxguy/openlp/website-fixes into lp:openlp/website.

___
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:~thelinuxguy/openlp/website-fixes into lp:openlp/website

2017-03-17 Thread Simon Hanna
Simon Hanna has proposed merging lp:~thelinuxguy/openlp/website-fixes into 
lp:openlp/website.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/website-fixes/+merge/320184

A fix for the social buttons appearing on more than one line.
I hope this mr is correct is filed against the correct branch...
-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~thelinuxguy/openlp/website-fixes into lp:openlp/website.
=== modified file 'themes/openlp2v2/assets/css/custom.css'
--- themes/openlp2v2/assets/css/custom.css	2016-05-09 21:16:37 +
+++ themes/openlp2v2/assets/css/custom.css	2017-03-17 14:08:19 +
@@ -275,13 +275,6 @@
 text-align: left;
 }
 
-.social-links {
-margin-left: auto;
-margin-right: auto;
-padding-left: 36px;
-width: 463px;
-}
-
 .social-links li.reddit a:hover {
 color: #ff4500;
 }

=== modified file 'themes/openlp2v2/templates/front_page.html'
--- themes/openlp2v2/templates/front_page.html	2017-02-05 00:42:32 +
+++ themes/openlp2v2/templates/front_page.html	2017-03-17 14:08:19 +
@@ -514,7 +514,7 @@
 
 
 
-
+
 https://plus.google.com/b/117120749304988900189/117120749304988900189; title="Follow us on Google+">
 https://www.facebook.com/openlp; title="Follow us on Facebook">
 https://twitter.com/openlp; title="Follow us on Twitter">

___
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 1673108] [NEW] Create New Custom Slide button is misleading

2017-03-15 Thread Simon Hanna
Public bug reported:

In the context menu of items in the Service Manager there is an entry
labeled "Create New Custom Slide".

Upon pressing it you get no visual feedback (unless you happen to have
the Custom slides open and see that something is added there)

The other issue I have with it, is that the label isn't very clear. I
was wondering why I could create a new custom slide from the context
menu of a song. It took me some time to figure out what it actually
does. Since the space is limited I'm not sure what the best approach to
improve this would be...

** Affects: openlp
 Importance: Undecided
 Status: New

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

Title:
  Create New Custom Slide button is misleading

Status in OpenLP:
  New

Bug description:
  In the context menu of items in the Service Manager there is an entry
  labeled "Create New Custom Slide".

  Upon pressing it you get no visual feedback (unless you happen to have
  the Custom slides open and see that something is added there)

  The other issue I have with it, is that the label isn't very clear. I
  was wondering why I could create a new custom slide from the context
  menu of a song. It took me some time to figure out what it actually
  does. Since the space is limited I'm not sure what the best approach
  to improve this would be...

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1673108/+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 1673113] [NEW] "Save & Preview" Button in Song Editor behaves in a strange way

2017-03-15 Thread Simon Hanna
Public bug reported:

When you get to the Song Editor by pressing the "edit and reload song
preview" button in the Preview Section, you get three button to process
the form "Save & Preview", "Save" and "Cancel".

My issue is with the first. Upon pressing it apparently nothing happens. The 
editor remains open.
In fact the "Save" button behaves in the way you would expect the "Save & 
Preview" button behaves. Upon clicking it, the editor closes and the preview is 
refreshed. (Note this does not happen if you press "Save" when accessing the 
Editor from any other place)

Can I remove the Save & Preview button and all related code?

** Affects: openlp
 Importance: Undecided
 Status: New

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

Title:
  "Save & Preview" Button in Song Editor behaves in a strange way

Status in OpenLP:
  New

Bug description:
  When you get to the Song Editor by pressing the "edit and reload song
  preview" button in the Preview Section, you get three button to
  process the form "Save & Preview", "Save" and "Cancel".

  My issue is with the first. Upon pressing it apparently nothing happens. The 
editor remains open.
  In fact the "Save" button behaves in the way you would expect the "Save & 
Preview" button behaves. Upon clicking it, the editor closes and the preview is 
refreshed. (Note this does not happen if you press "Save" when accessing the 
Editor from any other place)

  Can I remove the Save & Preview button and all related code?

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1673113/+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:~thelinuxguy/openlp/fix-encoding-songbeamer into lp:openlp

2017-03-13 Thread Simon Hanna
Btw. my remark on irc that it was "dumb" might have come over a little harsh. I 
meant it as a silly little mistake. :-)
I don't want to know how many of those I had over the years...
-- 
https://code.launchpad.net/~thelinuxguy/openlp/fix-encoding-songbeamer/+merge/319685
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:~thelinuxguy/openlp/fix-encoding-songbeamer into lp:openlp

2017-03-13 Thread Simon Hanna
Simon Hanna has proposed merging lp:~thelinuxguy/openlp/fix-encoding-songbeamer 
into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/fix-encoding-songbeamer/+merge/319685

Minor fix that makes sure that songbeamer files get decoded properly.
-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~thelinuxguy/openlp/fix-encoding-songbeamer into lp:openlp.
=== modified file 'openlp/plugins/songs/lib/importers/songbeamer.py'
--- openlp/plugins/songs/lib/importers/songbeamer.py	2017-01-12 21:04:53 +
+++ openlp/plugins/songs/lib/importers/songbeamer.py	2017-03-13 12:56:10 +
@@ -22,8 +22,6 @@
 """
 The :mod:`songbeamer` module provides the functionality for importing SongBeamer songs into the OpenLP database.
 """
-import chardet
-import codecs
 import logging
 import os
 import re
@@ -119,7 +117,7 @@
 # The encoding should only be ANSI (cp1252), UTF-8, Unicode, Big-Endian-Unicode.
 # So if it doesn't start with 'u' we default to cp1252. See:
 # https://forum.songbeamer.com/viewtopic.php?p=419=ca4814924e37c11e4438b7272a98b6f2
-if self.input_file_encoding.lower().startswith('u'):
+if not self.input_file_encoding.lower().startswith('u'):
 self.input_file_encoding = 'cp1252'
 infile = open(import_file, 'rt', encoding=self.input_file_encoding)
 song_data = infile.readlines()

=== modified file 'tests/functional/openlp_plugins/songs/test_songbeamerimport.py'
--- tests/functional/openlp_plugins/songs/test_songbeamerimport.py	2016-12-31 11:01:36 +
+++ tests/functional/openlp_plugins/songs/test_songbeamerimport.py	2017-03-13 12:56:10 +
@@ -49,6 +49,13 @@
 self.file_import([os.path.join(TEST_PATH, 'Lobsinget dem Herrn.sng')],
  self.load_external_result_data(os.path.join(TEST_PATH, 'Lobsinget dem Herrn.json')))
 
+def test_cp1252_encoded_file(self):
+"""
+Test that a CP1252 encoded file get's decoded properly.
+"""
+self.file_import([os.path.join(TEST_PATH, 'cp1252song.sng')],
+ self.load_external_result_data(os.path.join(TEST_PATH, 'cp1252song.json')))
+
 
 class TestSongBeamerImport(TestCase):
 """

=== added file 'tests/resources/songbeamersongs/cp1252song.json'
--- tests/resources/songbeamersongs/cp1252song.json	1970-01-01 00:00:00 +
+++ tests/resources/songbeamersongs/cp1252song.json	2017-03-13 12:56:10 +
@@ -0,0 +1,8 @@
+{
+"title": "Some Song",
+ "authors": ["Author"],
+ "verses" : [
+   ["Here are a couple of \"weird\" chars’’’.\n", "v"],
+   ["Here is another one….\n\n", "v"]
+ ]
+}

=== added file 'tests/resources/songbeamersongs/cp1252song.sng'
--- tests/resources/songbeamersongs/cp1252song.sng	1970-01-01 00:00:00 +
+++ tests/resources/songbeamersongs/cp1252song.sng	2017-03-13 12:56:10 +
@@ -0,0 +1,15 @@
+#LangCount=1
+#Editor=SongBeamer 4.28a
+#Version=3
+#Format=F/K//
+#TitleFormat=U
+#Title=Some Song
+#Author=Author
+#Melody=Author
+#(c)=No copyright
+#CCLI=00
+---
+Here are a couple of "weird" chars’’’.
+---
+Here is another one….
+

___
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 1659094] Re: Traceback on exit with py36

2017-01-26 Thread Simon Hanna
It might be related to the following bug I found
https://github.com/Flexget/Flexget/issues/1596#issuecomment-271146518

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

Title:
  Traceback on exit with py36

Status in OpenLP:
  New

Bug description:
  Steps to reproduce:
  1. Activate songusage plugin
  2. Song song live.
  3. Exit OpenLP.

  Confirmed on 2.4.4 and trunk

  Python: 3.6.0
  PyQt5 5.7.1
  sqlalchemy 1.1.5
  alembic 0.8.10

  I tried to delete the songusage db, but it didn't help.

  Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 
1182, in _execute_context
  context)
File "/usr/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 
470, in do_execute
  cursor.execute(statement, parameters)
  sqlite3.OperationalError: cannot VACUUM from within a transaction

  The above exception was the direct cause of the following exception:

  Traceback (most recent call last):
File 
"/home/tgc/projects/OpenLP/code/trunk-2.4/openlp/core/ui/mainwindow.py", line 
1106, in closeEvent
  self.clean_up()
File 
"/home/tgc/projects/OpenLP/code/trunk-2.4/openlp/core/ui/mainwindow.py", line 
1128, in clean_up
  self.plugin_manager.finalise_plugins()
File 
"/home/tgc/projects/OpenLP/code/trunk-2.4/openlp/core/common/openlpmixin.py", 
line 58, in wrapped
  raise e
File 
"/home/tgc/projects/OpenLP/code/trunk-2.4/openlp/core/common/openlpmixin.py", 
line 54, in wrapped
  return func(*args, **kwargs)
File 
"/home/tgc/projects/OpenLP/code/trunk-2.4/openlp/core/lib/pluginmanager.py", 
line 189, in finalise_plugins
  plugin.finalise()
File 
"/home/tgc/projects/OpenLP/code/trunk-2.4/openlp/plugins/songusage/songusageplugin.py",
 line 146, in finalise
  self.manager.finalise()
File "/home/tgc/projects/OpenLP/code/trunk-2.4/openlp/core/lib/db.py", line 
477, in finalise
  engine.execute("vacuum")
File "/usr/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 
2055, in execute
  return connection.execute(statement, *multiparams, **params)
File "/usr/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 
939, in execute
  return self._execute_text(object, multiparams, params)
File "/usr/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 
1097, in _execute_text
  statement, parameters
File "/usr/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 
1189, in _execute_context
  context)
File "/usr/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 
1393, in _handle_dbapi_exception
  exc_info
File "/usr/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 
203, in raise_from_cause
  reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/usr/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 
186, in reraise
  raise value.with_traceback(tb)
File "/usr/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 
1182, in _execute_context
  context)
File "/usr/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 
470, in do_execute
  cursor.execute(statement, parameters)
  sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) cannot VACUUM 
from within a transaction [SQL: 'vacuum']

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1659094/+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 1659094] Re: Traceback on exit with py36

2017-01-26 Thread Simon Hanna
I can confirm this running on Archlinux using the same versions as
mentioned above.

** Bug watch added: github.com/Flexget/Flexget/issues #1596
   https://github.com/Flexget/Flexget/issues/1596

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

Title:
  Traceback on exit with py36

Status in OpenLP:
  New

Bug description:
  Steps to reproduce:
  1. Activate songusage plugin
  2. Song song live.
  3. Exit OpenLP.

  Confirmed on 2.4.4 and trunk

  Python: 3.6.0
  PyQt5 5.7.1
  sqlalchemy 1.1.5
  alembic 0.8.10

  I tried to delete the songusage db, but it didn't help.

  Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 
1182, in _execute_context
  context)
File "/usr/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 
470, in do_execute
  cursor.execute(statement, parameters)
  sqlite3.OperationalError: cannot VACUUM from within a transaction

  The above exception was the direct cause of the following exception:

  Traceback (most recent call last):
File 
"/home/tgc/projects/OpenLP/code/trunk-2.4/openlp/core/ui/mainwindow.py", line 
1106, in closeEvent
  self.clean_up()
File 
"/home/tgc/projects/OpenLP/code/trunk-2.4/openlp/core/ui/mainwindow.py", line 
1128, in clean_up
  self.plugin_manager.finalise_plugins()
File 
"/home/tgc/projects/OpenLP/code/trunk-2.4/openlp/core/common/openlpmixin.py", 
line 58, in wrapped
  raise e
File 
"/home/tgc/projects/OpenLP/code/trunk-2.4/openlp/core/common/openlpmixin.py", 
line 54, in wrapped
  return func(*args, **kwargs)
File 
"/home/tgc/projects/OpenLP/code/trunk-2.4/openlp/core/lib/pluginmanager.py", 
line 189, in finalise_plugins
  plugin.finalise()
File 
"/home/tgc/projects/OpenLP/code/trunk-2.4/openlp/plugins/songusage/songusageplugin.py",
 line 146, in finalise
  self.manager.finalise()
File "/home/tgc/projects/OpenLP/code/trunk-2.4/openlp/core/lib/db.py", line 
477, in finalise
  engine.execute("vacuum")
File "/usr/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 
2055, in execute
  return connection.execute(statement, *multiparams, **params)
File "/usr/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 
939, in execute
  return self._execute_text(object, multiparams, params)
File "/usr/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 
1097, in _execute_text
  statement, parameters
File "/usr/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 
1189, in _execute_context
  context)
File "/usr/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 
1393, in _handle_dbapi_exception
  exc_info
File "/usr/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 
203, in raise_from_cause
  reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/usr/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 
186, in reraise
  raise value.with_traceback(tb)
File "/usr/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 
1182, in _execute_context
  context)
File "/usr/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 
470, in do_execute
  cursor.execute(statement, parameters)
  sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) cannot VACUUM 
from within a transaction [SQL: 'vacuum']

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1659094/+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 1616649] [NEW] Reason why song importers are disabled is unclear

2016-08-24 Thread Simon Hanna
Public bug reported:

There are a couple of Song importers that are OS specific.
Mediashout for instance has the following string hardcoded
"... only supported on Windows. It has been disabled due to a missing python 
dependency ..."

The error confused me because I had the dependencies installed. I don't think 
programatically changing the error message is viable so I propose the following 
two options
1. Not show unsupported importers in the first place
2. Show all importers but gray out unsupported ones and disable their 
selection. Their name could be followed by a message like "unsupported on your 
platform"

** Affects: openlp
 Importance: Undecided
 Status: New

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

Title:
  Reason why song importers are disabled is unclear

Status in OpenLP:
  New

Bug description:
  There are a couple of Song importers that are OS specific.
  Mediashout for instance has the following string hardcoded
  "... only supported on Windows. It has been disabled due to a missing python 
dependency ..."

  The error confused me because I had the dependencies installed. I don't think 
programatically changing the error message is viable so I propose the following 
two options
  1. Not show unsupported importers in the first place
  2. Show all importers but gray out unsupported ones and disable their 
selection. Their name could be followed by a message like "unsupported on your 
platform"

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1616649/+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:~thelinuxguy/openlp/rework-remote into lp:openlp

2016-07-23 Thread Simon Hanna
I'm tracking my work here https://github.com/simonsmiley/openlp-remote

It currently requires Tim's branch (With a minor fix that's comented on his 
merge request)

To get it running, clone the repo and run "npm install" followed by "npm start"

you will need to enable cross origin resource sharing for now (because it's 
served under another location than the api)
I'm using chromium with this extension

https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi?utm_source=chrome-app-launcher-info-dialog

It currently can display everything but can't search or use alerts.

All the buttons in the footer are functioning
-- 
https://code.launchpad.net/~thelinuxguy/openlp/rework-remote/+merge/282342
Your team OpenLP Core is requested to review the proposed merge of 
lp:~thelinuxguy/openlp/rework-remote 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:~trb143/openlp/websockets into lp:openlp

2016-07-23 Thread Simon Hanna
Could you convert the polls to strings before sending them in websockets -> 
handle_websocket ?
current_poll = str(current_poll, 'utf-8')
main_poll = str(main_poll, 'utf-8')
That way parsing them in js is straightforward
-- 
https://code.launchpad.net/~trb143/openlp/websockets/+merge/296703
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:~thelinuxguy/openlp/rework-remote into lp:openlp

2016-07-22 Thread Simon Hanna
Ok, I got started with angular. All the fetching works like a charm. I have 
issues with posting though. It's because the current remote doesn't actually 
use post requests and there doesn't seem to be a nice way in angular2 to send 
data along a get request.

Could this be changed along the process? It would require updates to the mobile 
apps as well...
-- 
https://code.launchpad.net/~thelinuxguy/openlp/rework-remote/+merge/282342
Your team OpenLP Core is requested to review the proposed merge of 
lp:~thelinuxguy/openlp/rework-remote 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:~thelinuxguy/openlp/rework-remote into lp:openlp

2016-06-30 Thread Simon Hanna
So, after quite some time, I'm coming back to this :-)

In the meantime I played around a little with material frameworks 
(materializecss.com) and also with angular.

I don't think ionic is the way to go, because it's mainly targeting mobile 
phone displays.

I would go for plain html with materializecss or angular with angular-material. 
Which approach do you prefer
-- 
https://code.launchpad.net/~thelinuxguy/openlp/rework-remote/+merge/282342
Your team OpenLP Core is requested to review the proposed merge of 
lp:~thelinuxguy/openlp/rework-remote 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:~thelinuxguy/openlp/change-dropdown-to-checkbox into lp:openlp

2016-05-17 Thread Simon Hanna
Simon Hanna has proposed merging 
lp:~thelinuxguy/openlp/change-dropdown-to-checkbox into lp:openlp.

Requested reviews:
  Tim Bentley (trb143)
Related bugs:
  Bug #1530073 in OpenLP: "Dropdown in 'Manage plugins' should be a checkbox"
  https://bugs.launchpad.net/openlp/+bug/1530073

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/change-dropdown-to-checkbox/+merge/294957

* Change the Combobox used for the state of plugins to a checkbox.
* Do not show the plugins version numbers as they provide no additional 
information
* Show the plugin details (about text) even if the plugin is disabled

-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/ui/plugindialog.py'
--- openlp/core/ui/plugindialog.py	2015-12-31 22:46:06 +
+++ openlp/core/ui/plugindialog.py	2016-05-17 19:32:55 +
@@ -53,15 +53,9 @@
 self.plugin_info_layout.setObjectName('plugin_info_layout')
 self.status_label = QtWidgets.QLabel(self.plugin_info_group_box)
 self.status_label.setObjectName('status_label')
-self.status_combo_box = QtWidgets.QComboBox(self.plugin_info_group_box)
-self.status_combo_box.addItems(('', ''))
-self.status_combo_box.setObjectName('status_combo_box')
-self.plugin_info_layout.addRow(self.status_label, self.status_combo_box)
-self.version_label = QtWidgets.QLabel(self.plugin_info_group_box)
-self.version_label.setObjectName('version_label')
-self.version_number_label = QtWidgets.QLabel(self.plugin_info_group_box)
-self.version_number_label.setObjectName('version_number_label')
-self.plugin_info_layout.addRow(self.version_label, self.version_number_label)
+self.status_checkbox = QtWidgets.QCheckBox(self.plugin_info_group_box)
+self.status_checkbox.setObjectName('status_checkbox')
+self.plugin_info_layout.addRow(self.status_label, self.status_checkbox)
 self.about_label = QtWidgets.QLabel(self.plugin_info_group_box)
 self.about_label.setObjectName('about_label')
 self.about_text_browser = QtWidgets.QTextBrowser(self.plugin_info_group_box)
@@ -80,8 +74,6 @@
 """
 plugin_view_dialog.setWindowTitle(translate('OpenLP.PluginForm', 'Manage Plugins'))
 self.plugin_info_group_box.setTitle(translate('OpenLP.PluginForm', 'Plugin Details'))
-self.version_label.setText('%s:' % UiStrings().Version)
 self.about_label.setText('%s:' % UiStrings().About)
 self.status_label.setText(translate('OpenLP.PluginForm', 'Status:'))
-self.status_combo_box.setItemText(0, translate('OpenLP.PluginForm', 'Active'))
-self.status_combo_box.setItemText(1, translate('OpenLP.PluginForm', 'Inactive'))
+self.status_checkbox.setText(translate('OpenLP.PluginForm', 'Active'))

=== modified file 'openlp/core/ui/pluginform.py'
--- openlp/core/ui/pluginform.py	2016-01-09 16:26:14 +
+++ openlp/core/ui/pluginform.py	2016-05-17 19:32:55 +
@@ -49,7 +49,7 @@
 self._clear_details()
 # Right, now let's put some signals and slots together!
 self.plugin_list_widget.itemSelectionChanged.connect(self.on_plugin_list_widget_selection_changed)
-self.status_combo_box.currentIndexChanged.connect(self.on_status_combo_box_changed)
+self.status_checkbox.stateChanged.connect(self.on_status_checkbox_changed)
 
 def load(self):
 """
@@ -86,24 +86,23 @@
 """
 Clear the plugin details widgets
 """
-self.status_combo_box.setCurrentIndex(-1)
-self.version_number_label.setText('')
+self.status_checkbox.setChecked(False)
 self.about_text_browser.setHtml('')
-self.status_combo_box.setEnabled(False)
+self.status_checkbox.setEnabled(False)
 
 def _set_details(self):
 """
 Set the details of the currently selected plugin
 """
 log.debug('PluginStatus: %s', str(self.active_plugin.status))
-self.version_number_label.setText(self.active_plugin.version)
 self.about_text_browser.setHtml(self.active_plugin.about())
 self.programatic_change = True
-status = PluginStatus.Active
-if self.active_plugin.status == PluginStatus.Active:
-status = PluginStatus.Inactive
-self.status_combo_box.setCurrentIndex(status)
-self.status_combo_box.setEnabled(True)
+if self.active_plugin.status != PluginStatus.Disabled:
+self.status_checkbox.setChecked(self.active_plugin.status == PluginStatus.Active)
+self.status_checkbox.setEnabled(True)
+else:
+self.status_checkbox.setChecked(False)
+self.status_checkbox.setEnabled(False)
 self.programatic_change = False
 
 def on_plugin_list_widget_selection_changed(self):
@@ -116,22 +115,

[Openlp-core] [Merge] lp:~thelinuxguy/openlp/change-dropdown-to-checkbox into lp:openlp

2016-05-17 Thread Simon Hanna
The proposal to merge lp:~thelinuxguy/openlp/change-dropdown-to-checkbox into 
lp:openlp has been updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/change-dropdown-to-checkbox/+merge/294886
-- 
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:~thelinuxguy/openlp/change-dropdown-to-checkbox into lp:openlp

2016-05-17 Thread Simon Hanna
The proposal to merge lp:~thelinuxguy/openlp/change-dropdown-to-checkbox into 
lp:openlp has been updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/change-dropdown-to-checkbox/+merge/286812
-- 
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:~thelinuxguy/openlp/rework-remote into lp:openlp

2016-03-09 Thread Simon Hanna
I used bootstrap, because I'm familiar with it and get it done :-)

Since there are mobile apps for android and ios, I thought that having the 
remote a responsive website makes it usable from computers (or just tablets 
with bigger screens).

I think having the remote somewhat responsive is a nice feature.

I will not try to fix the errors, unless we actually go with this.

If the android app is also suffering the issue, could it be that the bug is in 
the rest api?
-- 
https://code.launchpad.net/~thelinuxguy/openlp/rework-remote/+merge/282342
Your team OpenLP Core is requested to review the proposed merge of 
lp:~thelinuxguy/openlp/rework-remote 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:~thelinuxguy/openlp/change-dropdown-to-checkbox into lp:openlp

2016-02-22 Thread Simon Hanna
Simon Hanna has proposed merging 
lp:~thelinuxguy/openlp/change-dropdown-to-checkbox into lp:openlp.

Requested reviews:
  Tim Bentley (trb143)
Related bugs:
  Bug #1530073 in OpenLP: "Dropdown in 'Manage plugins' should be a checkbox"
  https://bugs.launchpad.net/openlp/+bug/1530073

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/change-dropdown-to-checkbox/+merge/286812

* Change the Combobox used for the state of plugins to a checkbox.
* Do not show the plugins version numbers as they provide no additional 
information
* Show the plugin details (about text) even if the plugin is disabled

-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/ui/plugindialog.py'
--- openlp/core/ui/plugindialog.py	2015-12-31 22:46:06 +
+++ openlp/core/ui/plugindialog.py	2016-02-22 14:57:18 +
@@ -53,15 +53,9 @@
 self.plugin_info_layout.setObjectName('plugin_info_layout')
 self.status_label = QtWidgets.QLabel(self.plugin_info_group_box)
 self.status_label.setObjectName('status_label')
-self.status_combo_box = QtWidgets.QComboBox(self.plugin_info_group_box)
-self.status_combo_box.addItems(('', ''))
-self.status_combo_box.setObjectName('status_combo_box')
-self.plugin_info_layout.addRow(self.status_label, self.status_combo_box)
-self.version_label = QtWidgets.QLabel(self.plugin_info_group_box)
-self.version_label.setObjectName('version_label')
-self.version_number_label = QtWidgets.QLabel(self.plugin_info_group_box)
-self.version_number_label.setObjectName('version_number_label')
-self.plugin_info_layout.addRow(self.version_label, self.version_number_label)
+self.status_checkbox = QtWidgets.QCheckBox(self.plugin_info_group_box)
+self.status_checkbox.setObjectName('status_checkbox')
+self.plugin_info_layout.addRow(self.status_label, self.status_checkbox)
 self.about_label = QtWidgets.QLabel(self.plugin_info_group_box)
 self.about_label.setObjectName('about_label')
 self.about_text_browser = QtWidgets.QTextBrowser(self.plugin_info_group_box)
@@ -80,8 +74,6 @@
 """
 plugin_view_dialog.setWindowTitle(translate('OpenLP.PluginForm', 'Manage Plugins'))
 self.plugin_info_group_box.setTitle(translate('OpenLP.PluginForm', 'Plugin Details'))
-self.version_label.setText('%s:' % UiStrings().Version)
 self.about_label.setText('%s:' % UiStrings().About)
 self.status_label.setText(translate('OpenLP.PluginForm', 'Status:'))
-self.status_combo_box.setItemText(0, translate('OpenLP.PluginForm', 'Active'))
-self.status_combo_box.setItemText(1, translate('OpenLP.PluginForm', 'Inactive'))
+self.status_checkbox.setText(translate('OpenLP.PluginForm', 'Active'))

=== modified file 'openlp/core/ui/pluginform.py'
--- openlp/core/ui/pluginform.py	2016-01-09 16:26:14 +
+++ openlp/core/ui/pluginform.py	2016-02-22 14:57:18 +
@@ -49,7 +49,7 @@
 self._clear_details()
 # Right, now let's put some signals and slots together!
 self.plugin_list_widget.itemSelectionChanged.connect(self.on_plugin_list_widget_selection_changed)
-self.status_combo_box.currentIndexChanged.connect(self.on_status_combo_box_changed)
+self.status_checkbox.stateChanged.connect(self.on_status_checkbox_changed)
 
 def load(self):
 """
@@ -86,24 +86,23 @@
 """
 Clear the plugin details widgets
 """
-self.status_combo_box.setCurrentIndex(-1)
-self.version_number_label.setText('')
+self.status_checkbox.setChecked(False)
 self.about_text_browser.setHtml('')
-self.status_combo_box.setEnabled(False)
+self.status_checkbox.setEnabled(False)
 
 def _set_details(self):
 """
 Set the details of the currently selected plugin
 """
 log.debug('PluginStatus: %s', str(self.active_plugin.status))
-self.version_number_label.setText(self.active_plugin.version)
 self.about_text_browser.setHtml(self.active_plugin.about())
 self.programatic_change = True
-status = PluginStatus.Active
-if self.active_plugin.status == PluginStatus.Active:
-status = PluginStatus.Inactive
-self.status_combo_box.setCurrentIndex(status)
-self.status_combo_box.setEnabled(True)
+if self.active_plugin.status != PluginStatus.Disabled:
+self.status_checkbox.setChecked(self.active_plugin.status == PluginStatus.Active)
+self.status_checkbox.setEnabled(True)
+else:
+self.status_checkbox.setChecked(False)
+self.status_checkbox.setEnabled(False)
 self.programatic_change = False
 
 def on_plugin_list_widget_selection_changed(self):
@@ -116,22 +115,

[Openlp-core] [Merge] lp:~thelinuxguy/openlp/change-dropdown-to-checkbox into lp:openlp

2016-02-22 Thread Simon Hanna
The proposal to merge lp:~thelinuxguy/openlp/change-dropdown-to-checkbox into 
lp:openlp has been updated.

Description changed to:

* Change the Combobox used for the state of plugins to a checkbox.
* Do not show the plugins version numbers as they provide no additional 
information
* Show the plugin details (about text) even if the plugin is disabled


For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/change-dropdown-to-checkbox/+merge/281481
-- 
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:~thelinuxguy/openlp/skip-bzr-test into lp:openlp

2016-02-15 Thread Simon Hanna
I meant the released archives. I would like to enable tests in the process of 
building the package for archlinux. I know I could patch it, but I guess other 
distros also (should) run the testsuite
-- 
https://code.launchpad.net/~thelinuxguy/openlp/skip-bzr-test/+merge/286073
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:~thelinuxguy/openlp/skip-bzr-test into lp:openlp

2016-02-15 Thread Simon Hanna
Simon Hanna has proposed merging lp:~thelinuxguy/openlp/skip-bzr-test into 
lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/skip-bzr-test/+merge/286073

Currently testing the releases is failing because they obviously are no bzr 
branches.
This change checks the return code of the bzr call and if it is 3 it skips the 
test.

Sadly the return codes for "bzr tags" are not documented in the manual, but I 
got 3 when running it on my machine. It felt safer to use " == 3" instead of 
the more generic " != 0"


-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~thelinuxguy/openlp/skip-bzr-test into lp:openlp.
=== modified file 'tests/utils/test_bzr_tags.py'
--- tests/utils/test_bzr_tags.py	2016-02-13 14:41:12 +
+++ tests/utils/test_bzr_tags.py	2016-02-15 16:07:36 +
@@ -44,6 +44,8 @@
 # WHEN getting the branches tags
 bzr = Popen(('bzr', 'tags', '--directory=' + path), stdout=PIPE)
 std_out = bzr.communicate()[0]
+if bzr.returncode == 3:
+self.skipTest("Skipping bzr tag test because this isn't a bzr branch")
 count = len(TAGS1)
 tags = [line.decode('utf-8').split()[0] for line in std_out.splitlines()]
 count1 = 0

___
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 1536802] Re: Add "Launch remote" under "Tools" menu

2016-01-23 Thread Simon Hanna
Currenlty there is an icon that is displayed when the remote plugin is
active. It would be nice to attach a context menu to it with options to
open the different links

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

Title:
  Add "Launch remote" under "Tools" menu

Status in OpenLP:
  Won't Fix

Bug description:
  At the moment OpenLP remote function has to be started by going to:
  "Settings > Configure OpenLP > Remote > Clicking the desired link.

  We could make this easier by adding these to a sub-menu for "Tools"

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1536802/+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:~thelinuxguy/openlp/fix-remote into lp:openlp

2016-01-14 Thread Simon Hanna
This didn't happen to me. What exactly did you do? Are you running something 
other than linux?

-- 
https://code.launchpad.net/~thelinuxguy/openlp/fix-remote/+merge/282447
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:~thelinuxguy/openlp/fix-remote into lp:openlp

2016-01-13 Thread Simon Hanna
Simon Hanna has proposed merging lp:~thelinuxguy/openlp/fix-remote into 
lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #1533401 in OpenLP: "Remote plugin stays active until a restart"
  https://bugs.launchpad.net/openlp/+bug/1533401

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/fix-remote/+merge/282447

Fix the remote plugin not being able to be toggled on and off (It used to not 
shut the server down)
Fix error displayed on console about not specifying a default parser for 
BeautifulSoup
Fix a couple of pep8 errors

-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~thelinuxguy/openlp/fix-remote into lp:openlp.
=== modified file 'openlp/plugins/bibles/lib/http.py'
--- openlp/plugins/bibles/lib/http.py	2015-12-31 22:46:06 +
+++ openlp/plugins/bibles/lib/http.py	2016-01-13 14:53:34 +
@@ -288,7 +288,7 @@
 except UnicodeDecodeError:
 page_source = str(page_source, 'cp1251')
 try:
-soup = BeautifulSoup(page_source)
+soup = BeautifulSoup(page_source, 'lxml')
 except Exception:
 log.error('BeautifulSoup could not parse the Bible page.')
 send_error_message('parse')
@@ -759,7 +759,7 @@
 page_source = re.sub(pre_parse_regex, pre_parse_substitute, page_source.decode())
 soup = None
 try:
-soup = BeautifulSoup(page_source)
+soup = BeautifulSoup(page_source, 'lxml')
 CLEANER_REGEX.sub('', str(soup))
 except Exception:
 log.exception('BeautifulSoup could not parse the bible page.')

=== modified file 'openlp/plugins/remotes/lib/httpserver.py'
--- openlp/plugins/remotes/lib/httpserver.py	2015-12-31 22:46:06 +
+++ openlp/plugins/remotes/lib/httpserver.py	2016-01-13 14:53:34 +
@@ -87,10 +87,6 @@
 """
 self.http_server.start_server()
 
-def stop(self):
-log.debug("stop called")
-self.http_server.stop = True
-
 
 class OpenLPServer(RegistryProperties):
 def __init__(self):
@@ -138,9 +134,9 @@
 self.httpd = server_class((address, port), CustomHandler)
 log.debug("Server started for class %s %s %d" % (server_class, address, port))
 break
-except OSError:
-log.debug("failed to start http server thread state %d %s" %
-  (loop, self.http_thread.isRunning()))
+except OSError as e:
+log.debug("failed to start http server thread state {} {}  with error {}".format(
+loop, self.http_thread.isRunning(), e))
 loop += 1
 time.sleep(0.1)
 except:
@@ -152,8 +148,9 @@
 """
 Stop the server
 """
-if self.http_thread.isRunning():
-self.http_thread.stop()
+self.httpd.shutdown()
+self.http_thread.exit()
+self.httpd.socket.close()
 self.httpd = None
 log.debug('Stopped the server.')
 

=== modified file 'openlp/plugins/songs/forms/editsongform.py'
--- openlp/plugins/songs/forms/editsongform.py	2016-01-10 16:01:43 +
+++ openlp/plugins/songs/forms/editsongform.py	2016-01-13 14:53:34 +
@@ -515,7 +515,7 @@
 self.topics_list_view.addItem(topic_name)
 self.songbooks_list_view.clear()
 for songbook_entry in self.song.songbook_entries:
-self.add_songbook_entry_to_list(songbook_entry.songbook.id, songbook_entry.songbook.name, 
+self.add_songbook_entry_to_list(songbook_entry.songbook.id, songbook_entry.songbook.name,
 songbook_entry.entry)
 self.audio_list_widget.clear()
 for media in self.song.media_files:

=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py	2016-01-10 16:01:43 +
+++ openlp/plugins/songs/lib/mediaitem.py	2016-01-13 14:53:34 +
@@ -255,9 +255,9 @@
 search_entry = re.sub(r'[^0-9]', '', search_keywords[2])
 
 songbook_entries = (self.plugin.manager.session.query(SongBookEntry)
-   .join(Book)
-   .order_by(Book.name)
-   .order_by(SongBookEntry.entry))
+.join(Book)
+.order_by(Book.name)
+.order_by(SongBookEntry.entry))
 for songbook_entry in songbook_entries:
 if songbook_entry.song.temporary:
 continue

=== modified file 'tests/functional/openlp_core_lib/test_htmlbuilder.py'
--- tests/functional/openlp_core_lib/test_htmlbuilder.py	2016-01-03 11:47:07 +
+++ tests/functional/openlp_core_lib/test_htmlbuilder.py	2016-01-13 14:53:34 +
@@ -363,9 +363,8 @@
 """
 Test the webkit_

Re: [Openlp-core] [Merge] lp:~thelinuxguy/openlp/rework-remote into lp:openlp

2016-01-12 Thread Simon Hanna
Yeah, I didn't think it would make into 2.4
I'm not so good with webdesign, so if someone wants to write a theme to have 
something other than the default look, go ahead!

-- 
https://code.launchpad.net/~thelinuxguy/openlp/rework-remote/+merge/282342
Your team OpenLP Core is requested to review the proposed merge of 
lp:~thelinuxguy/openlp/rework-remote 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] [Bug 1533401] [NEW] Remote plugin stays active until a restart

2016-01-12 Thread Simon Hanna
Public bug reported:

Deactivating the remote plugin has no effect until OpenLP is restarted

** Affects: openlp
 Importance: Undecided
 Status: New

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

Title:
  Remote plugin stays active until a restart

Status in OpenLP:
  New

Bug description:
  Deactivating the remote plugin has no effect until OpenLP is restarted

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1533401/+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:~thelinuxguy/openlp/rework-remote into lp:openlp

2016-01-12 Thread Simon Hanna
fixed the buttons
-- 
https://code.launchpad.net/~thelinuxguy/openlp/rework-remote/+merge/282342
Your team OpenLP Core is requested to review the proposed merge of 
lp:~thelinuxguy/openlp/rework-remote 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] [Bug 1404669] Re: KDE Plasma 5 is breaking the look of OpenLP

2016-01-11 Thread Simon Hanna
** Branch linked: lp:~thelinuxguy/openlp/fix-stylesheet

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

Title:
  KDE Plasma 5 is breaking the look of OpenLP

Status in OpenLP:
  Confirmed

Bug description:
  Need to be checked on other platforms.
  In 2.0 all the lists in the media item are white by default.

  In 2.1 Song and Bible are white.
  The rest are grey not sure why and had a good look to see what has changed.

  This looks bad!
  If may be a Fedora thing but not convinced.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1404669/+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 1404669] Re: KDE Plasma 5 is breaking the look of OpenLP

2016-01-10 Thread Simon Hanna
I went asking on #kde and #qt about this issue:
It's not a bug, it's a feature in plasma.

If I got it right, plasma either displays the icons or the text, not
both. This behavior can only be changed by having the users themselves
edit their plasma configurations.

My personal opinion that the stylesheets improve the looks by a lot!
The 'Fix' would probably be dropping the icons, and only display a text. I 
don't think the icons are necessary in the media manager, what do you think?

I don't yet know how easy it is to just disable the icons in the
mediamanager

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

Title:
  KDE Plasma 5 is breaking the look of OpenLP

Status in OpenLP:
  Confirmed

Bug description:
  Need to be checked on other platforms.
  In 2.0 all the lists in the media item are white by default.

  In 2.1 Song and Bible are white.
  The rest are grey not sure why and had a good look to see what has changed.

  This looks bad!
  If may be a Fedora thing but not convinced.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1404669/+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:~thelinuxguy/openlp/make-methods-static into lp:openlp

2016-01-10 Thread Simon Hanna
Simon Hanna has proposed merging lp:~thelinuxguy/openlp/make-methods-static 
into lp:openlp.

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

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/make-methods-static/+merge/282119

Make some methods static where possible
Move some methods out of their classes where it makes sense

Add .coveragerc so that local html reports can be generated

fix pep8 errors
-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file '.bzrignore'
--- .bzrignore	2016-01-02 23:37:22 +
+++ .bzrignore	2016-01-10 16:05:42 +
@@ -43,5 +43,4 @@
 .coverage
 cover
 *.kdev4
-./.coveragerc
-./coverage
+coverage

=== added file '.coveragerc'
--- .coveragerc	1970-01-01 00:00:00 +
+++ .coveragerc	2016-01-10 16:05:42 +
@@ -0,0 +1,5 @@
+[run]
+source = openlp
+
+[html]
+directory = coverage

=== modified file 'openlp/core/lib/plugin.py'
--- openlp/core/lib/plugin.py	2015-12-31 22:46:06 +
+++ openlp/core/lib/plugin.py	2016-01-10 16:05:42 +
@@ -263,7 +263,8 @@
 else:
 self.media_item.on_add_click()
 
-def about(self):
+@staticmethod
+def about():
 """
 Show a dialog when the user clicks on the 'About' button in the plugin manager.
 """

=== modified file 'openlp/core/lib/renderer.py'
--- openlp/core/lib/renderer.py	2015-12-31 22:46:06 +
+++ openlp/core/lib/renderer.py	2016-01-10 16:05:42 +
@@ -273,7 +273,7 @@
 except ValueError:
 text_to_render = text.split('\n[---]\n')[0]
 text = ''
-text_to_render, raw_tags, html_tags = self._get_start_tags(text_to_render)
+text_to_render, raw_tags, html_tags = get_start_tags(text_to_render)
 if text:
 text = raw_tags + text
 else:
@@ -441,7 +441,7 @@
 previous_raw = line + line_end
 continue
 # Figure out how many words of the line will fit on screen as the line will not fit as a whole.
-raw_words = self._words_split(line)
+raw_words = Renderer.words_split(line)
 html_words = list(map(expand_tags, raw_words))
 previous_html, previous_raw = \
 self._binary_chop(formatted, previous_html, previous_raw, html_words, raw_words, ' ', line_end)
@@ -451,42 +451,6 @@
 formatted.append(previous_raw)
 return formatted
 
-def _get_start_tags(self, raw_text):
-"""
-Tests the given text for not closed formatting tags and returns a tuple consisting of three unicode strings::
-
-('{st}{r}Text text text{/r}{/st}', '{st}{r}', '')
-
-The first unicode string is the text, with correct closing tags. The second unicode string are OpenLP's opening
-formatting tags and the third unicode string the html opening formatting tags.
-
-:param raw_text: The text to test. The text must **not** contain html tags, only OpenLP formatting tags
-are allowed::
-{st}{r}Text text text
-"""
-raw_tags = []
-html_tags = []
-for tag in FormattingTags.get_html_tags():
-if tag['start tag'] == '{br}':
-continue
-if raw_text.count(tag['start tag']) != raw_text.count(tag['end tag']):
-raw_tags.append((raw_text.find(tag['start tag']), tag['start tag'], tag['end tag']))
-html_tags.append((raw_text.find(tag['start tag']), tag['start html']))
-# Sort the lists, so that the tags which were opened first on the first slide (the text we are checking) will be
-# opened first on the next slide as well.
-raw_tags.sort(key=lambda tag: tag[0])
-html_tags.sort(key=lambda tag: tag[0])
-# Create a list with closing tags for the raw_text.
-end_tags = []
-start_tags = []
-for tag in raw_tags:
-start_tags.append(tag[1])
-end_tags.append(tag[2])
-end_tags.reverse()
-# Remove the indexes.
-html_tags = [tag[1] for tag in html_tags]
-return raw_text + ''.join(end_tags), ''.join(start_tags), ''.join(html_tags)
-
 def _binary_chop(self, formatted, previous_html, previous_raw, html_list, raw_list, separator, line_end):
 """
 This implements the binary chop algorithm for faster rendering. This algorithm works line based (line by line)
@@ -521,7 +485,7 @@
 if smallest_index == index or highest_index == index:
 index = smallest_index
 text = previous_raw.rstrip('') + separator.join(raw_list[:index + 1])
-text, raw_t

[Openlp-core] [Merge] lp:~thelinuxguy/openlp/make-methods-static into lp:openlp

2016-01-10 Thread Simon Hanna
The proposal to merge lp:~thelinuxguy/openlp/make-methods-static into lp:openlp 
has been updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/make-methods-static/+merge/282107
-- 
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:~thelinuxguy/openlp/fix-stylesheet into lp:openlp

2016-01-10 Thread Simon Hanna
Simon Hanna has proposed merging lp:~thelinuxguy/openlp/fix-stylesheet into 
lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~thelinuxguy/openlp/fix-stylesheet/+merge/282126

Reenable the stylesheet
remove the icons from mediamanager so that display in plasma works

-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~thelinuxguy/openlp/fix-stylesheet into lp:openlp.
=== modified file 'openlp/core/lib/plugin.py'
--- openlp/core/lib/plugin.py	2015-12-31 22:46:06 +
+++ openlp/core/lib/plugin.py	2016-01-10 20:08:31 +
@@ -275,7 +275,7 @@
 """
 if self.media_item:
 self.media_item.initialise()
-self.main_window.media_dock_manager.insert_dock(self.media_item, self.icon, self.weight)
+self.main_window.media_dock_manager.add_item_to_dock(self.media_item)
 
 def finalise(self):
 """

=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py	2016-01-09 19:10:56 +
+++ openlp/core/ui/mainwindow.py	2016-01-10 20:08:31 +
@@ -153,8 +153,7 @@
 # Create the MediaManager
 self.media_manager_dock = OpenLPDockWidget(main_window, 'media_manager_dock',
':/system/system_mediamanager.png')
-# TODO: Figure out how to fix the stylesheet and add it back in
-# self.media_manager_dock.setStyleSheet(MEDIA_MANAGER_STYLE)
+self.media_manager_dock.setStyleSheet(MEDIA_MANAGER_STYLE)
 # Create the media toolbox
 self.media_tool_box = QtWidgets.QToolBox(self.media_manager_dock)
 self.media_tool_box.setObjectName('media_tool_box')

=== modified file 'openlp/core/ui/mediadockmanager.py'
--- openlp/core/ui/mediadockmanager.py	2015-12-31 22:46:06 +
+++ openlp/core/ui/mediadockmanager.py	2016-01-10 20:08:31 +
@@ -39,23 +39,12 @@
 """
 self.media_dock = media_dock
 
-def add_dock(self, media_item, icon, weight):
+def add_item_to_dock(self, media_item):
 """
 Add a MediaManagerItem to the dock
-
-:param media_item:  The item to add to the dock
-:param icon: An icon for this dock item
-:param weight:
-"""
-visible_title = media_item.plugin.get_string(StringContent.VisibleName)
-log.info('Adding %s dock' % visible_title)
-self.media_dock.addItem(media_item, icon, visible_title['title'])
-
-def insert_dock(self, media_item, icon, weight):
-"""
-This should insert a dock item at a given location
-This does not work as it gives a Segmentation error.
-For now add at end of stack if not present
+If the item has been added before, it's silently skipped
+
+:param media_item: The item to add to the dock
 """
 visible_title = media_item.plugin.get_string(StringContent.VisibleName)
 log.debug('Inserting %s dock' % visible_title['title'])
@@ -65,7 +54,7 @@
 match = True
 break
 if not match:
-self.media_dock.addItem(media_item, icon, visible_title['title'])
+self.media_dock.addItem(media_item, visible_title['title'])
 
 def remove_dock(self, media_item):
 """

=== modified file 'tests/functional/openlp_plugins/images/test_imagetab.py'
--- tests/functional/openlp_plugins/images/test_imagetab.py	2015-12-31 22:46:06 +
+++ tests/functional/openlp_plugins/images/test_imagetab.py	2016-01-10 20:08:31 +
@@ -80,12 +80,14 @@
 
 def save_tab_change_test_test(self):
 """
-Test a change triggers post processing.
+Test a color change is applied and triggers post processing.
 """
 # GIVEN: Apply a change to the form.
-self.form.background_color = '#99'
+self.form.on_background_color_changed('#99')
 # WHEN: the save is invoked
 self.form.save()
 # THEN: the post process should be requested
 self.assertEqual(1, self.form.settings_form.register_post_process.call_count,
  'Image Post processing should have been requested')
+# THEN: The color should be set
+self.assertEqual(self.form.background_color, '#99', 'The updated color should have been saved')

___
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 933277] Re: Song author system doesn't support single word authors, like bands

2016-01-09 Thread Simon Hanna
Are the first and last names actually used somewhere? (It might be the
searching, I didn't check)

Currently it is possible to add authors that only have one name. When
adding authors from the song edit form, the form doesn't enforce more
than one word. Adding one word there, just adds the text to the display
name and leaves the first and last names empty.

The way I see it if removing first and last names is no problem, they
could be removed. If they are essential, then the song edit form should
as well enforce more than one word

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

Title:
  Song author system doesn't support single word authors, like bands

Status in OpenLP:
  Confirmed

Bug description:
  The way the author system is currently implemented you are required to
  provide both a "First Name" and a "Last Name". This doesn't work for
  bands who have a single word name. When a band has a multi word name I
  can work around this issue by putting half in the "First Name" field
  and half in the "Last Name" field. For single word authors I've worked
  around this by putting a single space in the "Last Name" field.
  Ideally each author would have a type, (i.e. Person or Band), and then
  if you pick Band there would only be a single text field. Having 3
  fields, "First Name", "Last Name" and "Display Name" is probably over
  kill anyways. A single "Name" field would probably be sufficient. I
  understand that at this point changing fields in the database could be
  difficult, but it would be nice if there was an elegant way to handle
  single word authors.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/933277/+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 1266270] Re: OpenLP hides dialogs whe using "play slides in loop" on OSX

2016-01-09 Thread Simon Hanna
Can someone confirm, that it's fixed in trunk?

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

Title:
  OpenLP hides dialogs whe using "play slides in loop" on OSX

Status in OpenLP:
  Confirmed
Status in OpenLP 2.0 series:
  Won't Fix
Status in OpenLP trunk series:
  Confirmed

Bug description:
  OpenLP 2.0.3 on OSX 10.6.8

  Tested on Ubuntu 13.10 and appears fine.

  Send a group of images live and start the images looping using the
  "play slides in loop" then click on "Save as". The "Save as" dialogue
  disappears when the live image changes.

  The first time that this happened OpenLP crashed with the following
  log: http://pastebin.com/MY3NnUWK

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1266270/+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 848316] Re: Highlight the current slide in the slidecontroller

2016-01-09 Thread Simon Hanna
For me this looks like it's fixed in trunk...

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

Title:
  Highlight the current slide in the slidecontroller

Status in OpenLP:
  Confirmed

Bug description:
  Either using colours or perhaps bold, highlight the current slide in
  the slidecontroller so that it is easier to see which slide is
  currently selected.

  See http://openlp.org/en/forums/development/feature-requests/clear-
  distinction-between-verses-in-preview-and-live-view

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


  1   2   >