[Openlp-core] [Merge] lp:~phill-ridout/openlp/1213254_2.0 into lp:openlp/2.0

2013-08-19 Thread Phill
Phill has proposed merging lp:~phill-ridout/openlp/1213254_2.0 into 
lp:openlp/2.0.

Requested reviews:
  Raoul Snyman (raoul-snyman)
Related bugs:
  Bug #1213254 in OpenLP: OpenLP 1 database importer crashes when encountering 
control chars
  https://bugs.launchpad.net/openlp/+bug/1213254

For more details, see:
https://code.launchpad.net/~phill-ridout/openlp/1213254_2.0/+merge/180938

Fix the importing of some OpenLP 1 databases by filtering out invalid xml 
chars. code from 
http://stackoverflow.com/questions/8733233/filtering-out-certain-bytes-in-python
-- 
https://code.launchpad.net/~phill-ridout/openlp/1213254_2.0/+merge/180938
Your team OpenLP Core is subscribed to branch lp:openlp/2.0.
=== modified file 'openlp/plugins/songs/lib/xml.py'
--- openlp/plugins/songs/lib/xml.py	2012-12-30 19:41:24 +
+++ openlp/plugins/songs/lib/xml.py	2013-08-19 20:19:56 +
@@ -78,6 +78,17 @@
 NAMESPACE = u'http://openlyrics.info/namespace/2009/song'
 NSMAP = '{' + NAMESPACE + '}' + '%s'
 
+def clean_xml_string(xml):
+
+Filter out invalid characters in xml
+Source http://stackoverflow.com/questions/8733233/filtering-out-certain-bytes-in-python
+
+return ''.join(char for char in xml if
+0x20 = char = 0xD7FF
+or char in (0x9, 0xA, 0xD)
+or 0xE000 = char = 0xFFFD
+or 0x1 = char = 0x10)
+
 
 class SongXML(object):
 
@@ -112,6 +123,7 @@
 The verse's language code (ISO-639). This is not required, but
 should be added if available.
 
+content = clean_xml_string(content)
 verse = etree.Element(u'verse', type=unicode(type),
 label=unicode(number))
 if lang:

___
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/1213254_2.0 into lp:openlp/2.0

2013-08-19 Thread Raoul Snyman
Review: Approve

Don't forget to make a fix for 2.1 as well, and include a small test or two 
around the function you created.
-- 
https://code.launchpad.net/~phill-ridout/openlp/1213254_2.0/+merge/180938
Your team OpenLP Core is subscribed to branch lp:openlp/2.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 1213254] Re: OpenLP 1 database importer crashes when encountering control chars

2013-08-19 Thread Raoul Snyman
** Also affects: openlp/trunk
   Importance: Undecided
   Status: New

** Changed in: openlp/trunk
   Importance: Undecided = Medium

** Changed in: openlp/trunk
Milestone: None = 2.1.1

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

Title:
  OpenLP 1 database importer crashes when encountering control chars

Status in OpenLP - Worship Presentation Software:
  New
Status in OpenLP 2.0 series:
  In Progress
Status in OpenLP trunk series:
  New

Bug description:
  http://support.openlp.org/issues/1941

  --- Exception Traceback ---
  Traceback (most recent call last):
  File 
D:\OpenLP_Code\release-2.0.1\build\pyi.win32\OpenLP\out00-PYZ.pyz\openlp.core.ui.wizard,
 line 188, in onCurrentIdChanged
  File 
D:\OpenLP_Code\release-2.0.1\build\pyi.win32\OpenLP\out00-PYZ.pyz\openlp.plugins.songs.forms.songimportform,
 line 391, in performWizard
  File 
D:\OpenLP_Code\release-2.0.1\build\pyi.win32\OpenLP\out00-PYZ.pyz\openlp.plugins.songs.lib.olp1import,
 line 161, in doImport
  File 
D:\OpenLP_Code\release-2.0.1\build\pyi.win32\OpenLP\out00-PYZ.pyz\openlp.plugins.songs.lib.songimport,
 line 327, in finish
  File 
D:\OpenLP_Code\release-2.0.1\build\pyi.win32\OpenLP\out00-PYZ.pyz\openlp.plugins.songs.lib.xml,
 line 119, in add_verse_to_lyrics
  File lxml.etree.pyx, line 2613, in lxml.etree.CDATA.__init__ 
(src/lxml/lxml.etree.c:51419)
  File apihelpers.pxi, line 1366, in lxml.etree._utf8 
(src/lxml/lxml.etree.c:22211)
  ValueError: All strings must be XML compatible: Unicode or ASCII, no NULL 
bytes or control characters

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1213254/+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 1213254] Re: OpenLP 1 database importer crashes when encountering control chars

2013-08-19 Thread Phill
** Changed in: openlp/trunk
 Assignee: (unassigned) = Phill (phill-ridout)

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

Title:
  OpenLP 1 database importer crashes when encountering control chars

Status in OpenLP - Worship Presentation Software:
  New
Status in OpenLP 2.0 series:
  In Progress
Status in OpenLP trunk series:
  New

Bug description:
  http://support.openlp.org/issues/1941

  --- Exception Traceback ---
  Traceback (most recent call last):
  File 
D:\OpenLP_Code\release-2.0.1\build\pyi.win32\OpenLP\out00-PYZ.pyz\openlp.core.ui.wizard,
 line 188, in onCurrentIdChanged
  File 
D:\OpenLP_Code\release-2.0.1\build\pyi.win32\OpenLP\out00-PYZ.pyz\openlp.plugins.songs.forms.songimportform,
 line 391, in performWizard
  File 
D:\OpenLP_Code\release-2.0.1\build\pyi.win32\OpenLP\out00-PYZ.pyz\openlp.plugins.songs.lib.olp1import,
 line 161, in doImport
  File 
D:\OpenLP_Code\release-2.0.1\build\pyi.win32\OpenLP\out00-PYZ.pyz\openlp.plugins.songs.lib.songimport,
 line 327, in finish
  File 
D:\OpenLP_Code\release-2.0.1\build\pyi.win32\OpenLP\out00-PYZ.pyz\openlp.plugins.songs.lib.xml,
 line 119, in add_verse_to_lyrics
  File lxml.etree.pyx, line 2613, in lxml.etree.CDATA.__init__ 
(src/lxml/lxml.etree.c:51419)
  File apihelpers.pxi, line 1366, in lxml.etree._utf8 
(src/lxml/lxml.etree.c:22211)
  ValueError: All strings must be XML compatible: Unicode or ASCII, no NULL 
bytes or control characters

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

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


Re: [Openlp-core] [Merge] lp:~phill-ridout/openlp/1197659_2.0 into lp:openlp/2.0

2013-08-19 Thread Raoul Snyman
Review: Approve


-- 
https://code.launchpad.net/~phill-ridout/openlp/1197659_2.0/+merge/180727
Your team OpenLP Core is subscribed to branch lp:openlp/2.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] [Merge] lp:~raoul-snyman/openlp/bug-1194622-2.0 into lp:openlp/2.0

2013-08-19 Thread Raoul Snyman
Raoul Snyman has proposed merging lp:~raoul-snyman/openlp/bug-1194622-2.0 into 
lp:openlp/2.0.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #1194622 in OpenLP: [support-system] Traceback when importing bible with 
disabled bible plugin in FTW
  https://bugs.launchpad.net/openlp/+bug/1194622

For more details, see:
https://code.launchpad.net/~raoul-snyman/openlp/bug-1194622-2.0/+merge/180948

Fix bug #1194622: skip the Bibles page if the Bibles plugin is not enabled.
-- 
https://code.launchpad.net/~raoul-snyman/openlp/bug-1194622-2.0/+merge/180948
Your team OpenLP Core is requested to review the proposed merge of 
lp:~raoul-snyman/openlp/bug-1194622-2.0 into lp:openlp/2.0.
=== modified file 'openlp/core/ui/firsttimeform.py'
--- openlp/core/ui/firsttimeform.py	2013-04-09 09:53:42 +
+++ openlp/core/ui/firsttimeform.py	2013-08-19 21:14:43 +
@@ -26,7 +26,9 @@
 # with this program; if not, write to the Free Software Foundation, Inc., 59  #
 # Temple Place, Suite 330, Boston, MA 02111-1307 USA  #
 ###
-
+
+The First Time Wizard
+
 import io
 import logging
 import os
@@ -48,6 +50,7 @@
 
 log = logging.getLogger(__name__)
 
+
 class ThemeScreenshotThread(QtCore.QThread):
 
 This thread downloads the theme screenshots.
@@ -56,6 +59,9 @@
 QtCore.QThread.__init__(self, parent)
 
 def run(self):
+
+Run the thread.
+
 themes = self.parent().config.get(u'themes', u'files')
 themes = themes.split(u',')
 themes_dir = self.parent().config.get(u'themes', u'directory')
@@ -189,6 +195,11 @@
 return -1
 elif self.currentId() == FirstTimePage.NoInternet:
 return FirstTimePage.Progress
+elif self.currentId() == FirstTimePage.Songs:
+if self.bibleCheckBox.isChecked():
+return FirstTimePage.Bibles
+else:
+return FirstTimePage.Themes
 elif self.currentId() == FirstTimePage.Themes:
 Receiver.send_message(u'cursor_busy')
 Receiver.send_message(u'openlp_process_events')
@@ -395,7 +406,7 @@
 self.max_progress += size
 if self.max_progress:
 # Add on 2 for plugins status setting plus a finished point.
-self.max_progress = self.max_progress + 2
+self.max_progress += 2
 self.progressBar.setValue(0)
 self.progressBar.setMinimum(0)
 self.progressBar.setMaximum(self.max_progress)

=== modified file 'openlp/core/ui/firsttimewizard.py'
--- openlp/core/ui/firsttimewizard.py	2012-12-30 19:41:24 +
+++ openlp/core/ui/firsttimewizard.py	2013-08-19 21:14:43 +
@@ -34,7 +34,11 @@
 from openlp.core.lib import translate
 from openlp.core.lib.ui import add_welcome_page
 
+
 class FirstTimePage(object):
+
+An enumeration object to make it easy for a developer to determine which page is which by index
+
 Welcome = 0
 Plugins = 1
 NoInternet = 2

___
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 1194622] Re: [support-system] Traceback when importing bible with disabled bible plugin in FTW

2013-08-19 Thread Raoul Snyman
** Changed in: openlp/2.0
   Status: Confirmed = In Progress

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

Title:
  [support-system] Traceback when importing bible with disabled bible
  plugin in FTW

Status in OpenLP - Worship Presentation Software:
  Confirmed
Status in OpenLP 2.0 series:
  In Progress
Status in OpenLP trunk series:
  Confirmed

Bug description:
  Hello,

  http://support.openlp.org/issues/2009

  1) Disable the Bible Plugin
  2) Restart OpenLP (it could be that this step is not required)
  3) Start the FTW
  4) Make sure the bible plugin is not checked!
  5) On the bible download page select a bible

  Result:
  Traceback (most recent call last):
File 
/usr/lib/python2.7/site-packages/openlp/plugins/bibles/lib/mediaitem.py, line 
407, in reloadBibles
  self.plugin.manager.reload_bibles()
  AttributeError: 'NoneType' object has no attribute 'reload_bibles'

  
  Expected:
  I am not sure, this is a strange case. Either the bible download page should 
not be shown or we should inform the user that we need to enable the bible 
plugin.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1194622/+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 1194622] Re: [support-system] Traceback when importing bible with disabled bible plugin in FTW

2013-08-19 Thread Launchpad Bug Tracker
** Branch linked: lp:~raoul-snyman/openlp/bug-1194622-2.0

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

Title:
  [support-system] Traceback when importing bible with disabled bible
  plugin in FTW

Status in OpenLP - Worship Presentation Software:
  Confirmed
Status in OpenLP 2.0 series:
  In Progress
Status in OpenLP trunk series:
  Confirmed

Bug description:
  Hello,

  http://support.openlp.org/issues/2009

  1) Disable the Bible Plugin
  2) Restart OpenLP (it could be that this step is not required)
  3) Start the FTW
  4) Make sure the bible plugin is not checked!
  5) On the bible download page select a bible

  Result:
  Traceback (most recent call last):
File 
/usr/lib/python2.7/site-packages/openlp/plugins/bibles/lib/mediaitem.py, line 
407, in reloadBibles
  self.plugin.manager.reload_bibles()
  AttributeError: 'NoneType' object has no attribute 'reload_bibles'

  
  Expected:
  I am not sure, this is a strange case. Either the bible download page should 
not be shown or we should inform the user that we need to enable the bible 
plugin.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1194622/+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 1097606] Re: Pasting from other applications can cause the song editor to fail

2013-08-19 Thread Raoul Snyman
All three of those support issues are dead ends. Without a clear way to
reproduce this issue, nor a clear way to fix this issue, I would regard
this bug as Incomplete. I'm setting it to Incomplete until such time as
we can reliably reproduce it.

** Changed in: openlp/2.0
   Status: Confirmed = Incomplete

** Changed in: openlp/trunk
   Status: Confirmed = Incomplete

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

Title:
  Pasting from other applications can cause the song editor to fail

Status in OpenLP - Worship Presentation Software:
  Incomplete
Status in OpenLP 2.0 series:
  Incomplete
Status in OpenLP trunk series:
  Incomplete

Bug description:
  This has been reported many times on the support tracker. I think this
  has been looked at before and no solution was found, but its still a
  bug.

  http://support.openlp.org/issues/1791
  http://support.openlp.org/issues/1781
  http://support.openlp.org/issues/1027

To manage notifications about this bug go to:
https://bugs.launchpad.net/openlp/+bug/1097606/+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 1088450] Re: OpenLP Crashes when trying to open a file with no modified date

2013-08-19 Thread Raoul Snyman
** Changed in: openlp/2.0
Milestone: 2.0.2 = 2.0.3

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

Title:
  OpenLP Crashes when trying to open a file with no modified date

Status in OpenLP - Worship Presentation Software:
  New
Status in OpenLP 2.0 series:
  New
Status in OpenLP trunk series:
  New

Bug description:
  http://support.openlp.org/issues/1224

  OpenLP Crashes when trying to save a file with no modified date.

  As mentioned in the linked issue, its not really our fault, but
  perhaps we can put a check in?

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