[Openlp-core] [Merge] lp:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-09-14 Thread noreply
The proposal to merge lp:~john+ubuntu-g/openlp/singingthefaith into lp:openlp 
has been updated.

Status: Approved => Merged

For more details, see:
https://code.launchpad.net/~john+ubuntu-g/openlp/singingthefaith/+merge/372277
-- 
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:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-09-13 Thread Raoul Snyman
The proposal to merge lp:~john+ubuntu-g/openlp/singingthefaith into lp:openlp 
has been updated.

Status: Needs review => Approved

For more details, see:
https://code.launchpad.net/~john+ubuntu-g/openlp/singingthefaith/+merge/372277
-- 
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:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-09-13 Thread Raoul Snyman
Review: Approve


-- 
https://code.launchpad.net/~john+ubuntu-g/openlp/singingthefaith/+merge/372277
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:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-09-05 Thread Tomas Groth
Review: Approve

Looks good.
-- 
https://code.launchpad.net/~john+ubuntu-g/openlp/singingthefaith/+merge/372277
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:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-09-04 Thread John Lines
John Lines has proposed merging lp:~john+ubuntu-g/openlp/singingthefaith into 
lp:openlp.

Commit message:
Initial merge of SingingTheFaithImport, including update to importer.py

Requested reviews:
  Tomas Groth (tomasgroth)
  Phill (phill-ridout)
  Raoul Snyman (raoul-snyman)

For more details, see:
https://code.launchpad.net/~john+ubuntu-g/openlp/singingthefaith/+merge/372277

Singing The Faith is the new Authorized Hymn book for the Methodist Church of 
Great Britain.
There is an electronic version of the Hymn book, for Windows only, which can 
export Hymns as text files.

This import module smooths the process of converting these text files into 
OpenLP. The input format is messy and not intended for automatic processing so 
the importer uses a combination of heuristics and a hints file. This version 
has not been tested on all the hymns in Singing The Faith, but deals with most 
of the, more than 600, hymns it has been tested with.

Documentation for the source format and hints file is at 
https://wiki.openlp.org/Development:SingingTheFaith_Format

The change includes a test module, which works for the single verse case, and 
for a whole song - both without use of hints, and another couple of cases using 
hints.


-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/plugins/songs/lib/importer.py'
--- openlp/plugins/songs/lib/importer.py	2019-04-13 13:00:22 +
+++ openlp/plugins/songs/lib/importer.py	2019-09-04 16:19:42 +
@@ -42,6 +42,7 @@
 from .importers.powersong import PowerSongImport
 from .importers.presentationmanager import PresentationManagerImport
 from .importers.propresenter import ProPresenterImport
+from .importers.singingthefaith import SingingTheFaithImport
 from .importers.songbeamer import SongBeamerImport
 from .importers.songpro import SongProImport
 from .importers.songshowplus import SongShowPlusImport
@@ -173,16 +174,17 @@
 PowerSong = 16
 PresentationManager = 17
 ProPresenter = 18
-SongBeamer = 19
-SongPro = 20
-SongShowPlus = 21
-SongsOfFellowship = 22
-SundayPlus = 23
-VideoPsalm = 24
-WordsOfWorship = 25
-WorshipAssistant = 26
-WorshipCenterPro = 27
-ZionWorx = 28
+SingingTheFaith = 19
+SongBeamer = 20
+SongPro = 21
+SongShowPlus = 22
+SongsOfFellowship = 23
+SundayPlus = 24
+VideoPsalm = 25
+WordsOfWorship = 26
+WorshipAssistant = 27
+WorshipCenterPro = 28
+ZionWorx = 29
 
 # Set optional attribute defaults
 __defaults__ = {
@@ -343,6 +345,16 @@
 'filter': '{text} (*.pro4 *.pro5 *.pro6)'.format(text=translate('SongsPlugin.ImportWizardForm',
 'ProPresenter Song Files'))
 },
+SingingTheFaith: {
+'class': SingingTheFaithImport,
+'name': 'SingingTheFaith',
+'prefix': 'singingTheFaith',
+'filter': '{text} (*.txt)'.format(text=translate('SongsPlugin.ImportWizardForm',
+ 'Singing The Faith Exported Files')),
+'descriptionText': translate('SongsPlugin.ImportWizardForm',
+ 'First use Singing The Faith Electonic edition to export '
+ 'the song(s) in Text format.')
+},
 SongBeamer: {
 'class': SongBeamerImport,
 'name': 'SongBeamer',
@@ -462,6 +474,7 @@
 SongFormat.PowerSong,
 SongFormat.PresentationManager,
 SongFormat.ProPresenter,
+SongFormat.SingingTheFaith,
 SongFormat.SongBeamer,
 SongFormat.SongPro,
 SongFormat.SongShowPlus,

=== added file 'openlp/plugins/songs/lib/importers/singingthefaith-hints.tag'
--- openlp/plugins/songs/lib/importers/singingthefaith-hints.tag	1970-01-01 00:00:00 +
+++ openlp/plugins/songs/lib/importers/singingthefaith-hints.tag	2019-09-04 16:19:42 +
@@ -0,0 +1,666 @@
+Tag-STFHints-version: 1.0
+Version: 2
+SongbookNumberInTitle: False
+End:
+Hymn: 2
+VerseOrder: V1,C1,V2,C1,V3,C1
+End:
+Hymn: 8
+AddSpaceAfterColon: 2,11,20,33
+End:
+Hymn: 10
+CommentsLine: 17
+End:
+Hymn: 11
+CommentsLine: 24
+End:
+Hymn: 15
+VerseOrder: V1,C1,V2,C1,C2,C1
+End:
+Hymn: 18
+CommentsLine: 16
+End:
+Hymn: 19
+CommentsLine: 8
+End:
+Hymn: 22
+CommentsLine: 20
+End:
+Hymn: 24
+IgnoreLine: 13
+VerseOrder: V1,V2,V1
+End:
+Hymn: 26
+VerseOrder: V1,C1,V2,C1,V3,C1,V4,C1,V5,C1
+End:
+Hymn: 27
+AddComment: Verse 1 is original Shona
+SongTitle: Jesu, tawa pano
+IgnoreLine: 2
+CommentsLine: 31
+End:
+Hymn: 28
+CommentsLine: 41
+End:
+Hymn: 29
+CommentsLine: 18
+End:
+Hymn: 30
+CommentsLine: 26
+End:
+Hymn: 35
+VerseOrder: V1,C1,V2,C1,V3,C1
+End:
+Hymn: 37
+IgnoreLine: 42
+VerseOrder: V1,V2,C1,V3,V4,C1
+End:
+Hymn: 38
+ManualCheck: Yes
+AddComment: Make all and cantor words Bold tagged for readability
+SongTitle: 

[Openlp-core] [Merge] lp:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-09-04 Thread John Lines
The proposal to merge lp:~john+ubuntu-g/openlp/singingthefaith into lp:openlp 
has been updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~john+ubuntu-g/openlp/singingthefaith/+merge/372194
-- 
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:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-09-03 Thread Tomas Groth
Review: Needs Fixing

Hi John, sorry for mentioning this before, but the hint file should be placed 
in the folder openlp/plugins/songs/lib/importers/
If the user does not supply a hint file you can then load it from this path:
AppLocation.get_directory(AppLocation.PluginsDir) / 'songs' / 'lib' / 
'importers' / 'singingthefaith-hints.tag'
As you can see I would recommend renaming it to 'singingthefaith-hints.tag' or 
something similar to make it easy to see what it is used for.
And please set 'SongbookNumberInTitle' in the default hint file to False.
-- 
https://code.launchpad.net/~john+ubuntu-g/openlp/singingthefaith/+merge/372194
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:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-09-03 Thread John Lines
John Lines has proposed merging lp:~john+ubuntu-g/openlp/singingthefaith into 
lp:openlp.

Commit message:
Initial merge of SingingTheFaithImport, including update to importer.py

Requested reviews:
  Raoul Snyman (raoul-snyman)
  Tomas Groth (tomasgroth)
  Phill (phill-ridout)

For more details, see:
https://code.launchpad.net/~john+ubuntu-g/openlp/singingthefaith/+merge/372194

Singing The Faith is the new Authorized Hymn book for the Methodist Church of 
Great Britain.
There is an electronic version of the Hymn book, for Windows only, which can 
export Hymns as text files.

This import module smooths the process of converting these text files into 
OpenLP. The input format is messy and not intended for automatic processing so 
the importer uses a combination of heuristics and a hints file. This version 
has not been tested on all the hymns in Singing The Faith, but deals with most 
of the, more than 600, hymns it has been tested with.

Documentation for the source format and hints file is at 
https://wiki.openlp.org/Development:SingingTheFaith_Format

The change includes a test module, which works for the single verse case, and 
for a whole song - both without use of hints, and another couple of cases using 
hints.


-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/plugins/songs/lib/importer.py'
--- openlp/plugins/songs/lib/importer.py	2019-04-13 13:00:22 +
+++ openlp/plugins/songs/lib/importer.py	2019-09-03 12:48:40 +
@@ -42,6 +42,7 @@
 from .importers.powersong import PowerSongImport
 from .importers.presentationmanager import PresentationManagerImport
 from .importers.propresenter import ProPresenterImport
+from .importers.singingthefaith import SingingTheFaithImport
 from .importers.songbeamer import SongBeamerImport
 from .importers.songpro import SongProImport
 from .importers.songshowplus import SongShowPlusImport
@@ -173,16 +174,17 @@
 PowerSong = 16
 PresentationManager = 17
 ProPresenter = 18
-SongBeamer = 19
-SongPro = 20
-SongShowPlus = 21
-SongsOfFellowship = 22
-SundayPlus = 23
-VideoPsalm = 24
-WordsOfWorship = 25
-WorshipAssistant = 26
-WorshipCenterPro = 27
-ZionWorx = 28
+SingingTheFaith = 19
+SongBeamer = 20
+SongPro = 21
+SongShowPlus = 22
+SongsOfFellowship = 23
+SundayPlus = 24
+VideoPsalm = 25
+WordsOfWorship = 26
+WorshipAssistant = 27
+WorshipCenterPro = 28
+ZionWorx = 29
 
 # Set optional attribute defaults
 __defaults__ = {
@@ -343,6 +345,16 @@
 'filter': '{text} (*.pro4 *.pro5 *.pro6)'.format(text=translate('SongsPlugin.ImportWizardForm',
 'ProPresenter Song Files'))
 },
+SingingTheFaith: {
+'class': SingingTheFaithImport,
+'name': 'SingingTheFaith',
+'prefix': 'singingTheFaith',
+'filter': '{text} (*.txt)'.format(text=translate('SongsPlugin.ImportWizardForm',
+ 'Singing The Faith Exported Files')),
+'descriptionText': translate('SongsPlugin.ImportWizardForm',
+ 'First use Singing The Faith Electonic edition to export '
+ 'the song(s) in Text format.')
+},
 SongBeamer: {
 'class': SongBeamerImport,
 'name': 'SongBeamer',
@@ -462,6 +474,7 @@
 SongFormat.PowerSong,
 SongFormat.PresentationManager,
 SongFormat.ProPresenter,
+SongFormat.SingingTheFaith,
 SongFormat.SongBeamer,
 SongFormat.SongPro,
 SongFormat.SongShowPlus,

=== added file 'openlp/plugins/songs/lib/importers/singingthefaith.py'
--- openlp/plugins/songs/lib/importers/singingthefaith.py	1970-01-01 00:00:00 +
+++ openlp/plugins/songs/lib/importers/singingthefaith.py	2019-09-03 12:48:40 +
@@ -0,0 +1,427 @@
+# -*- coding: utf-8 -*-
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
+
+###
+# OpenLP - Open Source Lyrics Projection  #
+# --- #
+# Copyright (c) 2008-2019 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 3 of the License.  #
+# #
+# This program is distributed in the hope that it will be useful, but WITHOUT #
+# ANY WARRANTY; without even the 

[Openlp-core] [Merge] lp:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-09-03 Thread John Lines
The proposal to merge lp:~john+ubuntu-g/openlp/singingthefaith into lp:openlp 
has been updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~john+ubuntu-g/openlp/singingthefaith/+merge/372191
-- 
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:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-09-03 Thread John Lines
John Lines has proposed merging lp:~john+ubuntu-g/openlp/singingthefaith into 
lp:openlp.

Commit message:
Initial merge of SingingTheFaithImport, including update to importer.py

Requested reviews:
  Tomas Groth (tomasgroth)
  Phill (phill-ridout)
  Raoul Snyman (raoul-snyman)

For more details, see:
https://code.launchpad.net/~john+ubuntu-g/openlp/singingthefaith/+merge/372191

Singing The Faith is the new Authorized Hymn book for the Methodist Church of 
Great Britain.
There is an electronic version of the Hymn book, for Windows only, which can 
export Hymns as text files.

This import module smooths the process of converting these text files into 
OpenLP. The input format is messy and not intended for automatic processing so 
the importer uses a combination of heuristics and a hints file. This version 
has not been tested on all the hymns in Singing The Faith, but deals with most 
of the, more than 600, hymns it has been tested with.

Documentation for the source format and hints file is at 
https://wiki.openlp.org/Development:SingingTheFaith_Format

The change includes a test module, which works for the single verse case, and 
for a whole song.


-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/plugins/songs/lib/importer.py'
--- openlp/plugins/songs/lib/importer.py	2019-04-13 13:00:22 +
+++ openlp/plugins/songs/lib/importer.py	2019-09-03 11:58:03 +
@@ -42,6 +42,7 @@
 from .importers.powersong import PowerSongImport
 from .importers.presentationmanager import PresentationManagerImport
 from .importers.propresenter import ProPresenterImport
+from .importers.singingthefaith import SingingTheFaithImport
 from .importers.songbeamer import SongBeamerImport
 from .importers.songpro import SongProImport
 from .importers.songshowplus import SongShowPlusImport
@@ -173,16 +174,17 @@
 PowerSong = 16
 PresentationManager = 17
 ProPresenter = 18
-SongBeamer = 19
-SongPro = 20
-SongShowPlus = 21
-SongsOfFellowship = 22
-SundayPlus = 23
-VideoPsalm = 24
-WordsOfWorship = 25
-WorshipAssistant = 26
-WorshipCenterPro = 27
-ZionWorx = 28
+SingingTheFaith = 19
+SongBeamer = 20
+SongPro = 21
+SongShowPlus = 22
+SongsOfFellowship = 23
+SundayPlus = 24
+VideoPsalm = 25
+WordsOfWorship = 26
+WorshipAssistant = 27
+WorshipCenterPro = 28
+ZionWorx = 29
 
 # Set optional attribute defaults
 __defaults__ = {
@@ -343,6 +345,16 @@
 'filter': '{text} (*.pro4 *.pro5 *.pro6)'.format(text=translate('SongsPlugin.ImportWizardForm',
 'ProPresenter Song Files'))
 },
+SingingTheFaith: {
+'class': SingingTheFaithImport,
+'name': 'SingingTheFaith',
+'prefix': 'singingTheFaith',
+'filter': '{text} (*.txt)'.format(text=translate('SongsPlugin.ImportWizardForm',
+ 'Singing The Faith Exported Files')),
+'descriptionText': translate('SongsPlugin.ImportWizardForm',
+ 'First use Singing The Faith Electonic edition to export '
+ 'the song(s) in Text format.')
+},
 SongBeamer: {
 'class': SongBeamerImport,
 'name': 'SongBeamer',
@@ -462,6 +474,7 @@
 SongFormat.PowerSong,
 SongFormat.PresentationManager,
 SongFormat.ProPresenter,
+SongFormat.SingingTheFaith,
 SongFormat.SongBeamer,
 SongFormat.SongPro,
 SongFormat.SongShowPlus,

=== added file 'openlp/plugins/songs/lib/importers/singingthefaith.py'
--- openlp/plugins/songs/lib/importers/singingthefaith.py	1970-01-01 00:00:00 +
+++ openlp/plugins/songs/lib/importers/singingthefaith.py	2019-09-03 11:58:03 +
@@ -0,0 +1,427 @@
+# -*- coding: utf-8 -*-
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
+
+###
+# OpenLP - Open Source Lyrics Projection  #
+# --- #
+# Copyright (c) 2008-2019 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 3 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 

[Openlp-core] [Merge] lp:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-09-03 Thread John Lines
The proposal to merge lp:~john+ubuntu-g/openlp/singingthefaith into lp:openlp 
has been updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~john+ubuntu-g/openlp/singingthefaith/+merge/372031
-- 
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:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-09-02 Thread Tomas Groth
Review: Needs Fixing

The tests are failing, see 
https://ci.openlp.io/job/MP-03-Linux-Tests/234/console
Also see the inline comment.

Diff comments:

> 
> === added file 'resources/hints.tag'
> --- resources/hints.tag   1970-01-01 00:00:00 +
> +++ resources/hints.tag   2019-08-29 22:04:22 +
> @@ -0,0 +1,666 @@
> +Tag-STFHints-version: 1.0
> +Version: 2
> +SongbookNumberInTitle: True

This should default to false.

> +End:
> +Hymn: 2
> +VerseOrder: V1,C1,V2,C1,V3,C1
> +End:
> +Hymn: 8
> +AddSpaceAfterColon: 2,11,20,33
> +End:
> +Hymn: 10
> +CommentsLine: 17
> +End:
> +Hymn: 11
> +CommentsLine: 24
> +End:
> +Hymn: 15
> +VerseOrder: V1,C1,V2,C1,C2,C1
> +End:
> +Hymn: 18
> +CommentsLine: 16
> +End:
> +Hymn: 19
> +CommentsLine: 8
> +End:
> +Hymn: 22
> +CommentsLine: 20
> +End:
> +Hymn: 24
> +IgnoreLine: 13
> +VerseOrder: V1,V2,V1
> +End:
> +Hymn: 26
> +VerseOrder: V1,C1,V2,C1,V3,C1,V4,C1,V5,C1
> +End:
> +Hymn: 27
> +AddComment: Verse 1 is original Shona
> +SongTitle: Jesu, tawa pano
> +IgnoreLine: 2
> +CommentsLine: 31
> +End:
> +Hymn: 28
> +CommentsLine: 41
> +End:
> +Hymn: 29
> +CommentsLine: 18
> +End:
> +Hymn: 30
> +CommentsLine: 26
> +End:
> +Hymn: 35
> +VerseOrder: V1,C1,V2,C1,V3,C1
> +End:
> +Hymn: 37
> +IgnoreLine: 42
> +VerseOrder: V1,V2,C1,V3,V4,C1
> +End:
> +Hymn: 38
> +ManualCheck: Yes
> +AddComment: Make all and cantor words Bold tagged for readability
> +SongTitle: Wa wa wa Emimimo
> +End:
> +Hymn: 40
> +VariantVerse: 15 1 Blessed be the name of the Lord/Glory to the name of the 
> Lord|blessed be the name/glory to the name
> +VariantVerse: 17 1 Blessed be the name of the Lord/Holy is the name of the 
> Lord|blessed be the name/holy is the name
> +VerseOrder: V1,C1,V2,C1,V3,C1
> +End:
> +Hymn: 41
> +IgnoreIndent: Yes
> +IgnoreLine: 35,42
> +VerseOrder: V1,V2,V3,V4,V2,V3,V5,V3
> +End:
> +Hymn: 43
> +IgnoreIndent: Yes
> +CommentsLine: 40
> +End:
> +Hymn: 45
> +IgnoreIndent: Yes
> +CommentsLine: 104
> +End:
> +Hymn: 46
> +VerseOrder: V1,C1,V2,C1,C2,C1
> +End:
> +Hymn: 48
> +VerseOrder: V1,C1,V2,C2
> +End:
> +Hymn: 51
> +VerseOrder: V1,C1,V2,C1,V3,C1
> +End:
> +Hymn: 55
> +AddSpaceAfterSemi: 15
> +End:
> +Hymn: 60
> +CommentsLine: 22
> +End:
> +Hymn: 61
> +VerseOrder: C1,V1,C1
> +End:
> +Hymn: 64
> +IgnoreLine: 23,25
> +VerseOrder: V1,C1,C2,V2,C1,C2,C3
> +End:
> +Hymn: 65
> +VerseOrder: V1,C1,V2,C2,V3,C1,V4,C1
> +End:
> +Hymn: 68
> +IgnoreLine: 15,31
> +VerseOrder: C1,V1,C1,V2,C2,C1
> +End:
> +Hymn: 71
> +IgnoreLine: 23
> +VerseOrder: V1,C1,V2,C1,V3
> +End:
> +Hymn: 74
> +IgnoreIndent: Yes
> +End:
> +Hymn: 77
> +IgnoreLine: 32
> +CommentsLine: 37
> +VerseOrder: V1,V2,C1,V3,C1
> +End:
> +Hymn: 78
> +VerseOrder: V1,V2,V1,V2,V3
> +End:
> +Hymn: 82
> +VerseOrder: V1,C1,V2,C1,V3,C1,V4,C1
> +End:
> +Hymn: 84
> +IgnoreIndent: Yes
> +End:
> +Hymn: 86
> +CommentsLine: 86
> +End:
> +Hymn: 89
> +VerseOrder: V1,V2,C1
> +End:
> +Hymn: 92
> +IgnoreIndent: Yes
> +IgnoreLine: 2,18,48
> +SongTitle: Think of a world without any flowers
> +End:
> +Hymn: 93
> +AddSpaceAfterSemi: 9,10,11,12
> +IgnoreLine: 21,30,31,32,33
> +VerseOrder: V1,C1,V2,C1,V3,C1
> +End:
> +Hymn: 94
> +AuthorLine: 24
> +VerseOrder: V1,C1,V2,C1,V3,C1
> +End:
> +Hymn: 95
> +AddSpaceAfterSemi: 2
> +End:
> +Hymn: 98
> +IgnoreLine: 17,19,24
> +VerseOrder: V1,C1,V2,C1,C2,C1
> +AddComment: C2 is an optional Bridge
> +End:
> +Hymn: 100
> +VerseOrder: C1,V1,C1,V2,C1,V3,C1,V4,C1
> +End:
> +Hymn: 102
> +VerseOrder: V1,C1,V2,C1,V3,C1,V4,C1,V5,C1
> +End:
> +Hymn: 103
> +AddSpaceAfterColon: 2,3,11,20
> +End:
> +Hymn: 105
> +VerseOrder: C1,V1,C1,V2,C1
> +End:
> +Hymn: 118
> +IgnoreLine: 15,21
> +CommentsLine: 28
> +VerseOrder: V1,C1,C1,V2,C1,V3,C1,C1,C2
> +End:
> +Hymn: 123
> +CommentsLine: 40
> +End:
> +Hymn: 140
> +IgnoreLine: 14
> +VerseOrder: V1,C1,V2,C1
> +End:
> +Hymn: 141
> +AddSpaceAfterSemi: 2
> +End:
> +Hymn: 145
> +ManualCheck: Yes
> +AddComment: Make cantor and all bold, and add to all verses
> +SongTitle: Night has fallen
> +End:
> +Hymn: 147
> +AddSpaceAfterSemi: 22
> +End:
> +Hymn: 165
> +IgnoreLine: 2,11,20,29,38
> +CommentsLine: 50
> +SongTitle: Advent candles tell their story
> +End:
> +Hymn: 166
> +CommentsLine: 40
> +VerseOrder: V1,C1,V2,C1,V3,C1,V4,C1,V5,C2
> +End:
> +Hymn: 168
> +CommentsLine: 30
> +End:
> +Hymn: 170
> +VerseOrder: V1,C1,V2,C1,V3,C1,V4,C2
> +End:
> +Hymn: 173
> +VerseOrder: V1,C1,V2,C1,V3,C2
> +End:
> +Hymn: 174
> +CommentsLine: 41
> +End:
> +Hymn: 175
> +IgnoreLine: 22,29
> +VerseOrder: V1,C1,V2,C1,C2,C1
> +End:
> +Hymn: 176
> +CommentsLine: 26
> +ManualCheck: Yes
> +End:
> +Hymn: 178
> +VerseOrder: V1,C1,V2,C1,V3,C1,V4,C2
> +End:
> +Hymn: 186
> +IgnoreIndent: Yes
> +CommentsLine: 24
> +End:
> +Hymn: 194
> +IgnoreIndent: Yes
> +End:
> +Hymn: 200
> +AddSpaceAfterColon: 2
> +CommentsLine: 24
> +End:
> +Hymn: 209
> +IgnoreLine: 11,17,23
> +VerseOrder: V1,C1,C1,V2,C1,V3,C1
> +End:
> +Hymn: 212
> +CommentsLine: 46
> +End:
> +Hymn: 220
> +AddSpaceAfterColon: 30
> +End:
> +Hymn: 227
> +VerseOrder: V1,V2,V3,V4,V1
> 

[Openlp-core] [Merge] lp:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-08-29 Thread John Lines
The proposal to merge lp:~john+ubuntu-g/openlp/singingthefaith into lp:openlp 
has been updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~john+ubuntu-g/openlp/singingthefaith/+merge/370364
-- 
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:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-08-29 Thread Tomas Groth
Review: Needs Information

Hi John,

I still don't get why the hint file is not included...
If you already made the file, why should others have to do it? I assume that 
the "Singing The Faith" files that can be imported are the same for all 
potential users? 
-- 
https://code.launchpad.net/~john+ubuntu-g/openlp/singingthefaith/+merge/370364
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:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-08-23 Thread John Lines
The use of STFnnn - in the title is now controlled by a hint. Also other code 
tidying.
-- 
https://code.launchpad.net/~john+ubuntu-g/openlp/singingthefaith/+merge/370364
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:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-08-22 Thread Tomas Groth
Is there any reason the hint file isn't included? If it is not bundled with 
OpenLP, then where is the user supposed to get it from?
-- 
https://code.launchpad.net/~john+ubuntu-g/openlp/singingthefaith/+merge/370364
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:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-08-15 Thread Raoul Snyman
Hey John, if you're ready for us to take another look at this, make sure to 
resubmit it.
-- 
https://code.launchpad.net/~john+ubuntu-g/openlp/singingthefaith/+merge/370364
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:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-08-04 Thread Phill
Just a few more inline comments.

Diff comments:

> === modified file 'openlp/plugins/songs/lib/importer.py'
> --- openlp/plugins/songs/lib/importer.py  2019-04-13 13:00:22 +
> +++ openlp/plugins/songs/lib/importer.py  2019-07-28 08:47:32 +
> @@ -343,6 +345,15 @@
>  'filter': '{text} (*.pro4 *.pro5 
> *.pro6)'.format(text=translate('SongsPlugin.ImportWizardForm',
>  
> 'ProPresenter Song Files'))
>  },
> +SingingTheFaith: {
> +'class': SingingTheFaithImport,
> +'name': 'SingingTheFaith',
> +'prefix': 'singingTheFaith',
> +'filter': '%s (*.txt)' % 
> translate('SongsPlugin.ImportWizardForm', 'Singing The Faith Exported Files'),

use .format here please

> +'descriptionText': translate('SongsPlugin.ImportWizardForm',
> + 'First use Singing The Faith 
> Electonic edition to export '
> + 'the song(s) in Text format.')
> +},
>  SongBeamer: {
>  'class': SongBeamerImport,
>  'name': 'SongBeamer',
> 
> === added file 'openlp/plugins/songs/lib/importers/singingthefaith.py'
> --- openlp/plugins/songs/lib/importers/singingthefaith.py 1970-01-01 
> 00:00:00 +
> +++ openlp/plugins/songs/lib/importers/singingthefaith.py 2019-07-28 
> 08:47:32 +
> @@ -0,0 +1,409 @@
> +# -*- coding: utf-8 -*-
> +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 
> softtabstop=4
> +
> +###
> +# OpenLP - Open Source Lyrics Projection 
>  #
> +# 
> --- #
> +# Copyright (c) 2008-2019 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 3 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 
>  #
> +###
> +"""
> +The :mod:`singingthefaith` module provides the functionality for importing 
> songs which are
> +exported from Singing The Faith - an Authorised songbook for the Methodist 
> Church of
> +Great Britain."""
> +
> +import logging
> +import re
> +from pathlib import Path
> +
> +from openlp.core.common.i18n import translate
> +from openlp.plugins.songs.lib.importers.songimport import SongImport
> +
> +log = logging.getLogger(__name__)
> +
> +
> +class SingingTheFaithImport(SongImport):
> +"""
> +Import songs exported from SingingTheFaith
> +"""
> +
> +def __init__(self, manager, **kwargs):
> +"""
> +Initialise the class.
> +"""
> +super(SingingTheFaithImport, self).__init__(manager, **kwargs)
> +self.hints_available = False
> +self.checks_needed = True
> +self.hint_line = {}
> +self.hint_file_version = '0'
> +self.hint_verse_order = ''
> +self.hint_song_title = ''
> +self.hint_comments = ''
> +self.hint_ccli = ''
> +self.hint_ignore_indent = False
> +
> +def do_import(self):
> +"""
> +Receive a single file or a list of files to import.
> +"""
> +if not isinstance(self.import_source, list):
> +return
> +self.import_wizard.progress_bar.setMaximum(len(self.import_source))
> +for file_path in self.import_source:
> +if self.stop_import_flag:
> +return
> +if isinstance(file_path, str):
> +song_file = open(file_path, 'rt', encoding='cp1251')

is *should* be a path object by here. Were you having issues where it wasn't?

> +self.do_import_file(song_file)
> +song_file.close()
> +else:
> +with file_path.open('rt', encoding='cp1251') 

[Openlp-core] [Merge] lp:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-07-19 Thread John Lines
The proposal to merge lp:~john+ubuntu-g/openlp/singingthefaith into lp:openlp 
has been updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~john+ubuntu-g/openlp/singingthefaith/+merge/369490
-- 
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:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-07-16 Thread John Lines
Using new string formatting, constructor for class.
-- 
https://code.launchpad.net/~john+ubuntu-g/openlp/singingthefaith/+merge/369490
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:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-07-14 Thread Tomas Groth
Review: Needs Fixing

Generally it looks good to me, though I haven't tested. But a few things to fix.

Diff comments:

> 
> === added file 'openlp/plugins/songs/lib/importers/singingthefaith.py'
> --- openlp/plugins/songs/lib/importers/singingthefaith.py 1970-01-01 
> 00:00:00 +
> +++ openlp/plugins/songs/lib/importers/singingthefaith.py 2019-07-12 
> 14:37:32 +
> @@ -0,0 +1,350 @@
> +# -*- coding: utf-8 -*-
> +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 
> softtabstop=4
> +
> +###
> +# OpenLP - Open Source Lyrics Projection 
>  #
> +# 
> --- #
> +# Copyright (c) 2008-2019 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 needs to be updated to the GPL3 license, which is also used in some of the 
files you added.

> +#
>  #
> +# 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 
>  #
> +###
> +"""
> +The :mod:`singingthefaith` module provides the functionality for importing 
> songs which are
> +exported from Singing The Faith - an Authorised songbook for the Methodist 
> Church of
> +Great Britain."""
> +
> +import logging
> +import re
> +from pathlib import Path
> +
> +from openlp.core.common.i18n import translate
> +from openlp.plugins.songs.lib.importers.songimport import SongImport
> +
> +log = logging.getLogger(__name__)
> +
> +
> +class SingingTheFaithImport(SongImport):
> +"""
> +Import songs exported from SingingTheFaith
> +"""
> +
> +hints_available = False
> +checks_needed = True
> +hint_line = {}
> +hint_file_version = '0'
> +hint_verse_order = ''
> +hint_song_title = ''
> +hint_comments = ''
> +hint_ignore_indent = False

I would propose to put the initialization of these variables in the constructor 
(__init__) and make them member variables (eg. self.hints_available), otherwise 
the value will not be reset the second time you run the importer.

> +
> +def do_import(self):
> +"""
> +Receive a single file or a list of files to import.
> +"""
> +if not isinstance(self.import_source, list):
> +return
> +self.import_wizard.progress_bar.setMaximum(len(self.import_source))
> +for file_path in self.import_source:
> +if self.stop_import_flag:
> +return
> +if isinstance(file_path, str):
> +song_file = open(file_path, 'rt', encoding='cp1251')
> +self.do_import_file(song_file)
> +song_file.close()
> +else:
> +with file_path.open('rt', encoding='cp1251') as song_file:
> +self.do_import_file(song_file)
> +
> +def do_import_file(self, file):
> +"""
> +Process the SingingTheFaith file - pass in a file-like object, not a 
> file path.
> +"""
> +singing_the_faith_version = 1
> +self.set_defaults()
> +# Setup variables
> +line_number = 0
> +old_indent = 0
> +# The chorus indent is how many spaces the chorus is indented - it 
> might be 6,
> +# but we test for >= and I do not know how consistent to formatting 
> of the
> +# exported songs is.
> +chorus_indent = 5
> +song_title = 'STF000 -'
> +song_number = '0'
> +ccli = '0'
> +current_verse = ''
> +current_verse_type = 'v'
> +current_verse_number = 1
> +# Potentially we could try to track current chorus number to 
> automatically handle
> +# more than 1 chorus, currently unused.
> +# current_chorus_number = 1
> +has_chorus = False
> +chorus_written = False
> +auto_verse_order_ok = False
> +

Re: [Openlp-core] [Merge] lp:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-07-03 Thread Phill
Review: Needs Fixing

Please change your string formatting to use the 'new' style with the format 
function. ( https://pyformat.info/ ) also string formatting is preferred over 
concatenation (i.e, "part1" + var + "part2")

single quotes for strings, not double quotes

do_import_file is very long can this be split in to smaller methods?



Diff comments:

> 
> === added file 'openlp/plugins/songs/lib/importers/singingthefaith.py'
> --- openlp/plugins/songs/lib/importers/singingthefaith.py 1970-01-01 
> 00:00:00 +
> +++ openlp/plugins/songs/lib/importers/singingthefaith.py 2019-06-30 
> 19:19:46 +
> @@ -0,0 +1,347 @@
> +# -*- coding: utf-8 -*-
> +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 
> softtabstop=4
> +
> +###
> +# OpenLP - Open Source Lyrics Projection 
>  #
> +# 
> --- #
> +# Copyright (c) 2008-2019 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 
>  #
> +###
> +"""
> +The :mod:`singingthefaith` module provides the functionality for importing 
> songs which are
> +exported from Singing The Faith - an Authorised songbook for the Methodist 
> Church of
> +Great Britain."""
> +
> +import logging
> +import re
> +from pathlib import Path
> +
> +from openlp.core.common.i18n import translate
> +from openlp.plugins.songs.lib.importers.songimport import SongImport
> +
> +log = logging.getLogger(__name__)
> +
> +
> +class SingingTheFaithImport(SongImport):
> +"""
> +Import songs exported from SingingTheFaith
> +"""
> +
> +hints_available = False
> +checks_needed = True
> +hintline = {}

can we have some consistency here and make these hint_line

> +hintfile_version = '0'

and hint_file_version

> +hint_verseOrder = ''

also please stick to 'snake_case' variable names like hint_verse_order

> +hint_songtitle = ''

hint_song_title

> +hint_comments = ''
> +hint_ignoreIndent = False

hint_ignore_indent

> +
> +def do_import(self):
> +"""
> +Receive a single file or a list of files to import.
> +"""
> +if not isinstance(self.import_source, list):
> +return
> +self.import_wizard.progress_bar.setMaximum(len(self.import_source))
> +for file_path in self.import_source:
> +if self.stop_import_flag:
> +return
> +with file_path.open('rt', encoding='cp1251') as song_file:
> +self.do_import_file(song_file)
> +
> +def do_import_file(self, file):
> +"""
> +Process the SingingTheFaith file - pass in a file-like object, not a 
> file path.
> +"""
> +singingTheFaithVersion = 1

singing_the_faith_version

> +self.set_defaults()
> +# Setup variables
> +line_number = 0
> +old_indent = 0
> +# The chorus indent is how many spaces the chorus is indented - it 
> might be 6,
> +# but we test for >= and I do not know how consistent to formatting 
> of the
> +# exported songs is.
> +chorus_indent = 5
> +song_title = 'STF000 -'
> +song_number = '0'
> +ccli = '0'
> +current_verse = ''
> +current_verse_type = 'v'
> +current_verse_number = 1
> +# Potentially we could try to track current chorus number to 
> automatically handle
> +# more than 1 chorus, currently unused.
> +# current_chorus_number = 1
> +has_chorus = False
> +chorus_written = False
> +auto_verse_order_ok = False
> +copyright = ''
> +# the check_flag is prepended to the title, removed if the import 
> should be OK

[Openlp-core] [Merge] lp:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-06-30 Thread John Lines
John Lines has proposed merging lp:~john+ubuntu-g/openlp/singingthefaith into 
lp:openlp.

Commit message:
Initial merge of SingingTheFaithImport, including update to importer.py

Requested reviews:
  Raoul Snyman (raoul-snyman)

For more details, see:
https://code.launchpad.net/~john+ubuntu-g/openlp/singingthefaith/+merge/369490

Singing The Faith is the new Authorized Hymn book for the Methodist Church of 
Great Britain.
There is an electronic version of the Hymn book, for Windows only, which can 
export Hymns as text files.

This import module smooths the process of converting these text files into 
OpenLP. The input format is messy and not intended for automatic processing so 
the importer uses a combination of heuristics and a hints file. This version 
has not been tested on all the hymns in Singing The Faith, but deals with most 
of the, more than 100, hymns it has been tested with.

Note that it includes a test module, which works for the single verse case. 
Multiple verse songs import OK, but tests fail.
-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/plugins/songs/lib/importer.py'
--- openlp/plugins/songs/lib/importer.py	2019-04-13 13:00:22 +
+++ openlp/plugins/songs/lib/importer.py	2019-06-30 19:19:46 +
@@ -42,6 +42,7 @@
 from .importers.powersong import PowerSongImport
 from .importers.presentationmanager import PresentationManagerImport
 from .importers.propresenter import ProPresenterImport
+from .importers.singingthefaith import SingingTheFaithImport
 from .importers.songbeamer import SongBeamerImport
 from .importers.songpro import SongProImport
 from .importers.songshowplus import SongShowPlusImport
@@ -173,16 +174,17 @@
 PowerSong = 16
 PresentationManager = 17
 ProPresenter = 18
-SongBeamer = 19
-SongPro = 20
-SongShowPlus = 21
-SongsOfFellowship = 22
-SundayPlus = 23
-VideoPsalm = 24
-WordsOfWorship = 25
-WorshipAssistant = 26
-WorshipCenterPro = 27
-ZionWorx = 28
+SingingTheFaith = 19
+SongBeamer = 20
+SongPro = 21
+SongShowPlus = 22
+SongsOfFellowship = 23
+SundayPlus = 24
+VideoPsalm = 25
+WordsOfWorship = 26
+WorshipAssistant = 27
+WorshipCenterPro = 28
+ZionWorx = 29
 
 # Set optional attribute defaults
 __defaults__ = {
@@ -343,6 +345,15 @@
 'filter': '{text} (*.pro4 *.pro5 *.pro6)'.format(text=translate('SongsPlugin.ImportWizardForm',
 'ProPresenter Song Files'))
 },
+SingingTheFaith: {
+'class': SingingTheFaithImport,
+'name': 'SingingTheFaith',
+'prefix': 'singingTheFaith',
+'filter': '%s (*.txt)' % translate('SongsPlugin.ImportWizardForm', 'Singing The Faith Exported Files'),
+'descriptionText': translate('SongsPlugin.ImportWizardForm',
+ 'First use Singing The Faith Electonic edition to export '
+ 'the song(s) in Text format.')
+},
 SongBeamer: {
 'class': SongBeamerImport,
 'name': 'SongBeamer',
@@ -462,6 +473,7 @@
 SongFormat.PowerSong,
 SongFormat.PresentationManager,
 SongFormat.ProPresenter,
+SongFormat.SingingTheFaith,
 SongFormat.SongBeamer,
 SongFormat.SongPro,
 SongFormat.SongShowPlus,

=== added file 'openlp/plugins/songs/lib/importers/singingthefaith.py'
--- openlp/plugins/songs/lib/importers/singingthefaith.py	1970-01-01 00:00:00 +
+++ openlp/plugins/songs/lib/importers/singingthefaith.py	2019-06-30 19:19:46 +
@@ -0,0 +1,347 @@
+# -*- coding: utf-8 -*-
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
+
+###
+# OpenLP - Open Source Lyrics Projection  #
+# --- #
+# Copyright (c) 2008-2019 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.   #
+# #
+# 

[Openlp-core] [Merge] lp:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-06-30 Thread John Lines
The proposal to merge lp:~john+ubuntu-g/openlp/singingthefaith into lp:openlp 
has been updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~john+ubuntu-g/openlp/singingthefaith/+merge/369489
-- 
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:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-06-30 Thread John Lines
Fix lint tests outside main importer code
-- 
https://code.launchpad.net/~john+ubuntu-g/openlp/singingthefaith/+merge/369489
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:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-06-30 Thread John Lines
John Lines has proposed merging lp:~john+ubuntu-g/openlp/singingthefaith into 
lp:openlp.

Commit message:
Initial merge of SingingTheFaithImport, including update to importer.py

Requested reviews:
  Raoul Snyman (raoul-snyman)

For more details, see:
https://code.launchpad.net/~john+ubuntu-g/openlp/singingthefaith/+merge/369489

Singing The Faith is the new Authorized Hymn book for the Methodist Church of 
Great Britain.
There is an electronic version of the Hymn book, for Windows only, which can 
export Hymns as text files.

This import module smooths the process of converting these text files into 
OpenLP. The input format is messy and not intended for automatic processing so 
the importer uses a combination of heuristics and a hints file. This version 
has not been tested on all the hymns in Singing The Faith, but deals with most 
of the, more than 100, hymns it has been tested with.

Note that it includes a test module, which works for the single verse case. 
Multiple verse songs import OK, but tests fail.
-- 
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/plugins/songs/lib/importer.py'
--- openlp/plugins/songs/lib/importer.py	2019-04-13 13:00:22 +
+++ openlp/plugins/songs/lib/importer.py	2019-06-30 18:28:14 +
@@ -42,6 +42,7 @@
 from .importers.powersong import PowerSongImport
 from .importers.presentationmanager import PresentationManagerImport
 from .importers.propresenter import ProPresenterImport
+from .importers.singingthefaith import SingingTheFaithImport
 from .importers.songbeamer import SongBeamerImport
 from .importers.songpro import SongProImport
 from .importers.songshowplus import SongShowPlusImport
@@ -173,16 +174,17 @@
 PowerSong = 16
 PresentationManager = 17
 ProPresenter = 18
-SongBeamer = 19
-SongPro = 20
-SongShowPlus = 21
-SongsOfFellowship = 22
-SundayPlus = 23
-VideoPsalm = 24
-WordsOfWorship = 25
-WorshipAssistant = 26
-WorshipCenterPro = 27
-ZionWorx = 28
+SingingTheFaith = 19
+SongBeamer = 20
+SongPro = 21
+SongShowPlus = 22
+SongsOfFellowship = 23
+SundayPlus = 24
+VideoPsalm = 25
+WordsOfWorship = 26
+WorshipAssistant = 27
+WorshipCenterPro = 28
+ZionWorx = 29
 
 # Set optional attribute defaults
 __defaults__ = {
@@ -343,6 +345,15 @@
 'filter': '{text} (*.pro4 *.pro5 *.pro6)'.format(text=translate('SongsPlugin.ImportWizardForm',
 'ProPresenter Song Files'))
 },
+   SingingTheFaith: {
+'class': SingingTheFaithImport,
+'name': 'SingingTheFaith',
+'prefix': 'singingTheFaith',
+'filter': '%s (*.txt)' % translate('SongsPlugin.ImportWizardForm', 'Singing The Faith Exported Files'),
+'descriptionText': translate('SongsPlugin.ImportWizardForm',
+ 'First use Singing The Faith Electonic edition to export '
+ 'the song(s) in Text format.')
+},
 SongBeamer: {
 'class': SongBeamerImport,
 'name': 'SongBeamer',
@@ -462,6 +473,7 @@
 SongFormat.PowerSong,
 SongFormat.PresentationManager,
 SongFormat.ProPresenter,
+SongFormat.SingingTheFaith,
 SongFormat.SongBeamer,
 SongFormat.SongPro,
 SongFormat.SongShowPlus,

=== added file 'openlp/plugins/songs/lib/importers/singingthefaith.py'
--- openlp/plugins/songs/lib/importers/singingthefaith.py	1970-01-01 00:00:00 +
+++ openlp/plugins/songs/lib/importers/singingthefaith.py	2019-06-30 18:28:14 +
@@ -0,0 +1,347 @@
+# -*- coding: utf-8 -*-
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
+
+###
+# OpenLP - Open Source Lyrics Projection  #
+# --- #
+# Copyright (c) 2008-2019 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.   #
+# #
+# 

[Openlp-core] [Merge] lp:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-06-30 Thread John Lines
The proposal to merge lp:~john+ubuntu-g/openlp/singingthefaith into lp:openlp 
has been updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~john+ubuntu-g/openlp/singingthefaith/+merge/369398
-- 
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:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-06-30 Thread John Lines
1. Thanks for the info on flake8 - is now flake8 clean - you are quite right - 
it is better for me to learn about the tools.
2. Think indentation is fixed - flake8 was handy as well
3. Email address now set in my bzr config
4. Can you have another look at the change now.

-- 
https://code.launchpad.net/~john+ubuntu-g/openlp/singingthefaith/+merge/369398
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:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-06-29 Thread Raoul Snyman
Review: Needs Fixing

Hey John, a couple things.

1. You have a ton of linting issues. I started commenting, and then I realised 
that it would be better to just point you to flake8. See the link at the bottom 
of my comment for a quick introduction to linting and flake8.

2. You have some inconsistent indentation. Indentation in Python is very 
important, so we take it seriously. Also, please make sure you are indenting 
using spaces and not tabs.

3. You are not committing your code with the e-mail address associated with 
Launchpad. Please can you fix that by issuing a bzr whoami "John Lines 
"

4. Once you've made all your changes, and you're ready for another review, you 
need to resubmit your merge proposal. Do this by clicking the "Resubmit" link 
in the top right hand corner of the page.

5. If you're struggling with anything, pop into our IRC channel, there's 
usually someone around who is happy to help.

https://medium.com/python-pandemonium/what-is-flake8-and-why-we-should-use-it-b89bd78073f2

Diff comments:

> 
> === added file 'openlp/plugins/songs/lib/importers/singingthefaith.py'
> --- openlp/plugins/songs/lib/importers/singingthefaith.py 1970-01-01 
> 00:00:00 +
> +++ openlp/plugins/songs/lib/importers/singingthefaith.py 2019-06-29 
> 14:44:42 +
> @@ -0,0 +1,381 @@
> +# -*- coding: utf-8 -*-
> +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 
> softtabstop=4
> +
> +###
> +# OpenLP - Open Source Lyrics Projection 
>  #
> +# 
> --- #
> +# Copyright (c) 2008-2019 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 
>  #
> +###
> +"""
> +The :mod:`singingthefaith` module provides the functionality for importing 
> songs which are
> +exported from Singing The Faith - an Authorised songbook for the Methodist 
> Church of
> +Great Britain."""
> +
> +
> +import logging
> +import re
> +import os
> +from pathlib import Path
> +
> +from openlp.core.common.i18n import translate
> +from openlp.plugins.songs.lib.importers.songimport import SongImport
> +
> +log = logging.getLogger(__name__)
> +
> +
> +class SingingTheFaithImport(SongImport):
> +"""
> +Import songs exported from SingingTheFaith
> +"""
> +
> +hints_available = False
> +checks_needed = True
> +hintline = {}
> +hintfile_version = '0'
> +hint_verseOrder = ''
> +hint_songtitle = ''
> +hint_comments = ''
> +hint_ignoreIndent = False
> +
> +
> +def do_import(self):
> +"""
> +Receive a single file or a list of files to import.
> +"""
> +if not isinstance(self.import_source, list):
> +return
> +self.import_wizard.progress_bar.setMaximum(len(self.import_source))
> +for file_path in self.import_source:
> +if self.stop_import_flag:
> +return
> +with file_path.open('rt', encoding='cp1251') as song_file:
> +self.do_import_file(song_file)
> +
> +def do_import_file(self, file):
> +"""
> +Process the SingingTheFaith file - pass in a file-like object, not a 
> file path.
> +"""
> +singingTheFaithVersion = 1
> +self.set_defaults()
> +# Setup variables
> +line_number = 0
> +old_indent = 0
> +chorus_indent = 5   # It might be 6, but we test for >=

We're not fond of inline comments. Rather place the comment above the line.

> +song_title = 'STF000 -'
> +song_number = '0'
> +ccli = '0'
> +current_verse = ''
> +current_verse_type = 'v'
> +current_verse_number = 1
> +has_chorus = 

Re: [Openlp-core] [Merge] lp:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-06-29 Thread John Lines
> A few in-line comments. Also you don't need to use parenthesis around the
> expressions in the if statements.

Thanks - have updated to use Path more, and have removed redudant parentheses 
round expressions in if statements
-- 
https://code.launchpad.net/~john+ubuntu-g/openlp/singingthefaith/+merge/369398
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:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-06-28 Thread Phill
A few in-line comments. Also you don't need to use parenthesis around the 
expressions in the if statements.

Diff comments:

> 
> === added file 'openlp/plugins/songs/lib/importers/singingthefaith.py'
> --- openlp/plugins/songs/lib/importers/singingthefaith.py 1970-01-01 
> 00:00:00 +
> +++ openlp/plugins/songs/lib/importers/singingthefaith.py 2019-06-27 
> 12:35:49 +
> @@ -0,0 +1,389 @@
> +# -*- coding: utf-8 -*-
> +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 
> softtabstop=4
> +
> +###
> +# OpenLP - Open Source Lyrics Projection 
>  #
> +# 
> --- #
> +# Copyright (c) 2008-2019 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 
>  #
> +###
> +"""
> +The :mod:`singingthefaith` module provides the functionality for importing 
> songs which are
> +exported from Singing The Faith - an Authorised songbook for the Methodist 
> Church of
> +Great Britain."""
> +
> +
> +import logging
> +import re
> +
> +import os
> +
> +from openlp.core.common.i18n import translate
> +from openlp.plugins.songs.lib.importers.songimport import SongImport
> +
> +log = logging.getLogger(__name__)
> +
> +
> +class SingingTheFaithImport(SongImport):
> +"""
> +Import songs exported from SingingTheFaith
> +"""
> +
> +hints_available = False
> +checks_needed = True
> +hintline = {}
> +hintfile_version = '0'
> +hint_verseOrder = ''
> +hint_songtitle = ''
> +hint_comments = ''
> +hint_ignoreIndent = False
> +
> +def __init__(self, manager, **kwargs):

No need to re implement __init__ here as its not doing anything

> +"""
> +Initialise the class.
> +"""
> +super(SingingTheFaithImport, self).__init__(manager, **kwargs)
> +
> +def do_import(self):
> +"""
> +Receive a single file or a list of files to import.
> +"""
> +if not isinstance(self.import_source, list):
> +return
> +self.import_wizard.progress_bar.setMaximum(len(self.import_source))
> +for filename in self.import_source:

file_path would be more descriptive, as it should be a Path object here...

> +if self.stop_import_flag:
> +return
> +song_file = open(filename, 'rt', encoding='cp1251')

a context manager here would be better as it would close the file even if an 
exception were raised. Also the Path object has the open method built 
(https://docs.python.org/3/library/pathlib.html#pathlib.Path.open) in Ex.:

with file_path.open('rt', encoding='cp1251'):

> +self.do_import_file(song_file)
> +song_file.close()
> +
> +def do_import_file(self, file):
> +"""
> +Process the SingingTheFaith file - pass in a file-like object, not a 
> file path.
> +"""
> +singingTheFaithVersion = 1
> +self.set_defaults()
> +# Setup variables
> +line_number = 0
> +old_indent = 0
> +chorus_indent = 5   # It might be 6, but we test for >=
> +song_title = 'STF000 -'
> +song_number = '0'
> +ccli = '0'
> +current_verse = ''
> +current_verse_type = 'v'
> +current_verse_number = 1
> +has_chorus = False
> +chorus_written = False
> +verses = []
> +author = ''
> +copyright = ''
> +check_flag = 'z'# Prepended to title, remove if we think 
> import should be OK
> +
> +
> +self.add_comment("Imported with Singing The Faith Importer v 
> "+str(singingTheFaithVersion))
> +
> +# Get the file_song_number - so we can use it for hints

Re: [Openlp-core] [Merge] lp:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-06-27 Thread Raoul Snyman
Review: Needs Fixing

The test is failing because the "add_verse" method is not called, or not called 
with that exact data. I've broken up the error message into 3 parts below for 
easier reading.

AssertionError:

add_verse('Amazing grace! How sweet the sound!\nThat saved a wretch like me!\nI 
once was lost, but now am found;\nWas blind, but now I see.', 'v1')

call not found
-- 
https://code.launchpad.net/~john+ubuntu-g/openlp/singingthefaith/+merge/369398
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:~john+ubuntu-g/openlp/singingthefaith into lp:openlp

2019-06-27 Thread John Lines
John Lines has proposed merging lp:~john+ubuntu-g/openlp/singingthefaith into 
lp:openlp.

Commit message:
Initial merge of SingingTheFaithImport, including update to importer.py

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~john+ubuntu-g/openlp/singingthefaith/+merge/369398

Singing The Faith is the new Authorized Hymn book for the Methodist Church of 
Great Britain.
There is an electronic version of the Hymn book, for Windows only, which can 
export Hymns as text files.

This import module smooths the process of converting these text files into 
OpenLP. The input format is messy and not intended for automatic processing so 
the importer uses a combination of heuristics and a hints file. This version 
has not been tested on all the hymns in Singing The Faith, but deals with most 
of the, more than 100, hymns it has been tested with.

Note that it includes a test module, but that test module fails, and I am not 
sure why.
-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~john+ubuntu-g/openlp/singingthefaith into lp:openlp.
=== modified file 'openlp/plugins/songs/lib/importer.py'
--- openlp/plugins/songs/lib/importer.py	2019-04-13 13:00:22 +
+++ openlp/plugins/songs/lib/importer.py	2019-06-27 12:35:49 +
@@ -42,6 +42,7 @@
 from .importers.powersong import PowerSongImport
 from .importers.presentationmanager import PresentationManagerImport
 from .importers.propresenter import ProPresenterImport
+from .importers.singingthefaith import SingingTheFaithImport
 from .importers.songbeamer import SongBeamerImport
 from .importers.songpro import SongProImport
 from .importers.songshowplus import SongShowPlusImport
@@ -173,16 +174,17 @@
 PowerSong = 16
 PresentationManager = 17
 ProPresenter = 18
-SongBeamer = 19
-SongPro = 20
-SongShowPlus = 21
-SongsOfFellowship = 22
-SundayPlus = 23
-VideoPsalm = 24
-WordsOfWorship = 25
-WorshipAssistant = 26
-WorshipCenterPro = 27
-ZionWorx = 28
+SingingTheFaith = 19
+SongBeamer = 20
+SongPro = 21
+SongShowPlus = 22
+SongsOfFellowship = 23
+SundayPlus = 24
+VideoPsalm = 25
+WordsOfWorship = 26
+WorshipAssistant = 27
+WorshipCenterPro = 28
+ZionWorx = 29
 
 # Set optional attribute defaults
 __defaults__ = {
@@ -343,6 +345,15 @@
 'filter': '{text} (*.pro4 *.pro5 *.pro6)'.format(text=translate('SongsPlugin.ImportWizardForm',
 'ProPresenter Song Files'))
 },
+   SingingTheFaith: {
+'class': SingingTheFaithImport,
+'name': 'SingingTheFaith',
+'prefix': 'singingTheFaith',
+'filter': '%s (*.txt)' % translate('SongsPlugin.ImportWizardForm', 'Singing The Faith Exported Files'),
+'descriptionText': translate('SongsPlugin.ImportWizardForm',
+ 'First use Singing The Faith Electonic edition to export '
+ 'the song(s) in Text format.')
+},
 SongBeamer: {
 'class': SongBeamerImport,
 'name': 'SongBeamer',
@@ -462,6 +473,7 @@
 SongFormat.PowerSong,
 SongFormat.PresentationManager,
 SongFormat.ProPresenter,
+SongFormat.SingingTheFaith,
 SongFormat.SongBeamer,
 SongFormat.SongPro,
 SongFormat.SongShowPlus,

=== added file 'openlp/plugins/songs/lib/importers/singingthefaith.py'
--- openlp/plugins/songs/lib/importers/singingthefaith.py	1970-01-01 00:00:00 +
+++ openlp/plugins/songs/lib/importers/singingthefaith.py	2019-06-27 12:35:49 +
@@ -0,0 +1,389 @@
+# -*- coding: utf-8 -*-
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
+
+###
+# OpenLP - Open Source Lyrics Projection  #
+# --- #
+# Copyright (c) 2008-2019 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.   #
+#