Merge lp://qastaging/~john+ubuntu-g/openlp/singingthefaith into lp://qastaging/openlp

Proposed by John Lines
Status: Superseded
Proposed branch: lp://qastaging/~john+ubuntu-g/openlp/singingthefaith
Merge into: lp://qastaging/openlp
Diff against target: 1463 lines (+1348/-11)
14 files modified
openlp/plugins/songs/lib/importer.py (+23/-10)
openlp/plugins/songs/lib/importers/singingthefaith.py (+427/-0)
resources/hints.tag (+666/-0)
tests/functional/openlp_plugins/songs/test_singingthefaithimport.py (+63/-0)
tests/helpers/songfileimport.py (+2/-1)
tests/resources/songs/singingthefaith/H1.txt (+9/-0)
tests/resources/songs/singingthefaith/H2.txt (+30/-0)
tests/resources/songs/singingthefaith/STF001.json (+13/-0)
tests/resources/songs/singingthefaith/STF002.json (+29/-0)
tests/resources/songs/singingthefaith/hints/H1.txt (+9/-0)
tests/resources/songs/singingthefaith/hints/H2.txt (+30/-0)
tests/resources/songs/singingthefaith/hints/STF001.json (+13/-0)
tests/resources/songs/singingthefaith/hints/STF002.json (+29/-0)
tests/resources/songs/singingthefaith/hints/hints.tag (+5/-0)
To merge this branch: bzr merge lp://qastaging/~john+ubuntu-g/openlp/singingthefaith
Reviewer Review Type Date Requested Status
Tomas Groth Needs Fixing
Phill Pending
Raoul Snyman Pending
Review via email: mp+372031@code.qastaging.launchpad.net

This proposal supersedes a proposal from 2019-07-19.

This proposal has been superseded by a proposal from 2019-09-03.

Commit message

Initial merge of SingingTheFaithImport, including update to importer.py

Description of the change

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.

To post a comment you must log in.
Revision history for this message
Raoul Snyman (raoul-snyman) wrote : Posted in a previous version of this proposal

Linux tests failed, please see https://ci.openlp.io/job/MP-02-Linux_Tests/191/ for more details

Revision history for this message
Raoul Snyman (raoul-snyman) wrote : Posted in a previous version of this proposal

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

review: Needs Fixing
Revision history for this message
Phill (phill-ridout) wrote : Posted in a previous version of this proposal

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

Revision history for this message
John Lines (john+ubuntu-g) wrote : Posted in a previous version of this proposal

> 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

Revision history for this message
Raoul Snyman (raoul-snyman) wrote : Posted in a previous version of this proposal

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 <email address hidden>"

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

review: Needs Fixing
Revision history for this message
John Lines (john+ubuntu-g) wrote : Posted in a previous version of this proposal

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.

Revision history for this message
Raoul Snyman (raoul-snyman) wrote : Posted in a previous version of this proposal

Linux tests passed!

Revision history for this message
Raoul Snyman (raoul-snyman) wrote : Posted in a previous version of this proposal

Linting failed, please see https://ci.openlp.io/job/MP-03-Linting/132/ for more details

Revision history for this message
John Lines (john+ubuntu-g) wrote : Posted in a previous version of this proposal

Fix lint tests outside main importer code

Revision history for this message
Raoul Snyman (raoul-snyman) wrote : Posted in a previous version of this proposal

Linux tests passed!

Revision history for this message
Raoul Snyman (raoul-snyman) wrote : Posted in a previous version of this proposal

Linting passed!

Revision history for this message
Raoul Snyman (raoul-snyman) wrote : Posted in a previous version of this proposal

macOS tests passed!

Revision history for this message
Phill (phill-ridout) wrote : Posted in a previous version of this proposal

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?

review: Needs Fixing
Revision history for this message
Tomas Groth (tomasgroth) wrote : Posted in a previous version of this proposal

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

review: Needs Fixing
Revision history for this message
John Lines (john+ubuntu-g) wrote : Posted in a previous version of this proposal

Using new string formatting, constructor for class.

Revision history for this message
Raoul Snyman (raoul-snyman) wrote : Posted in a previous version of this proposal

Linux tests passed!

Revision history for this message
Raoul Snyman (raoul-snyman) wrote : Posted in a previous version of this proposal

Linting passed!

Revision history for this message
Phill (phill-ridout) wrote : Posted in a previous version of this proposal

Just a few more inline comments.

Revision history for this message
Raoul Snyman (raoul-snyman) wrote : Posted in a previous version of this proposal

Hey John, if you're ready for us to take another look at this, make sure to resubmit it.

Revision history for this message
Tomas Groth (tomasgroth) wrote : Posted in a previous version of this proposal

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?

Revision history for this message
John Lines (john+ubuntu-g) wrote : Posted in a previous version of this proposal

The use of STFnnn - in the title is now controlled by a hint. Also other code tidying.

Revision history for this message
Tomas Groth (tomasgroth) wrote : Posted in a previous version of this proposal

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?

review: Needs Information
Revision history for this message
Raoul Snyman (raoul-snyman) wrote :

JavaScript tests passed!

Revision history for this message
Raoul Snyman (raoul-snyman) wrote :

Linux tests failed, please see https://ci.openlp.io/job/MP-03-Linux-Tests/234/ for more details

Revision history for this message
Tomas Groth (tomasgroth) wrote :

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

review: Needs Fixing
2907. By John Lines

fix tests to allow for SongbookNumberInTitle defaulting to false and add hints tests

2908. By John Lines

Merge trunk updates

2909. By John Lines

add tests with hints subdirectory

2910. By John Lines

Linting fix

2911. By John Lines

put default hints plugin directory and chnage name to singingthefaith-hints.tag

2912. By John Lines

Merge trunk updates

2913. By John Lines

Tweaks to hints - now version 3, H470 and H567

Unmerged revisions

2913. By John Lines

Tweaks to hints - now version 3, H470 and H567

2912. By John Lines

Merge trunk updates

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.