songbeamer

The songbeamer module provides the functionality for importing SongBeamer songs into the OpenLP database.

class openlp.plugins.songs.lib.importers.songbeamer.SongBeamerImport(manager, **kwargs)[source]

Bases: openlp.plugins.songs.lib.importers.songimport.SongImport

Import Song Beamer files(s). Song Beamer file format is text based in the beginning are one or more control tags written.

HTML_TAG_PAIRS = [(re.compile('<b>'), '{st}'), (re.compile('</b>'), '{/st}'), (re.compile('<i>'), '{it}'), (re.compile('</i>'), '{/it}'), (re.compile('<u>'), '{u}'), (re.compile('</u>'), '{/u}'), (re.compile('<p>'), '{p}'), (re.compile('</p>'), '{/p}'), (re.compile('<super>'), '{su}'), (re.compile('</super>'), '{/su}'), (re.compile('<sub>'), '{sb}'), (re.compile('</sub>'), '{/sb}'), (re.compile('<br.*?>'), '{br}'), (re.compile('<[/]?wordwrap>'), ''), (re.compile('<[/]?strike>'), ''), (re.compile('<[/]?h.*?>'), ''), (re.compile('<[/]?s.*?>'), ''), (re.compile('<[/]?linespacing.*?>'), ''), (re.compile('<[/]?c.*?>'), ''), (re.compile('<align.*?>'), ''), (re.compile('<valign.*?>'), '')]
check_verse_marks(line)[source]

Check and add the verse’s MarkType. Returns True if the given line contains a correct verse mark otherwise False.

Parameters:line – The line to check for marks.
convert_verse_marks(line)[source]

Convert the verse’s MarkType. Returns the OpenLP versemark if the given line contains a correct SongBeamer verse mark otherwise None.

Parameters:line – The line to check for marks.
do_import()[source]

Receive a single file or a list of files to import.

insert_chords(line_number, line)[source]

Insert chords into text if any exists and chords import is enabled

Parameters:
  • linenumber – Number of the current line
  • line – The line of lyrics to insert chords
parse_audio_file(audio_file_path)[source]

Parse audio file. The path is relative to the SongsBeamer Songs folder.

Parameters:audio_file_path – Path to the audio file
parse_chords(chords)[source]
Parse chords. The chords are in a base64 encode string. The decoded string is an index of chord placement separated by “

“, like this: “<linecolumn>,<linenumber>,<chord> “

param chords:Chords in a base64 encoded string
parse_tags(line)[source]

Parses a meta data line.

Parameters:line

The line in the file. It should consist of a tag and a value for this tag (unicode):

'#Title=Nearer my God to Thee'
replace_html_tags()[source]

This can be called to replace SongBeamer’s specific (html) tags with OpenLP’s specific (html) tags.

class openlp.plugins.songs.lib.importers.songbeamer.SongBeamerTypes[source]

Bases: object

MarkTypes = {'$$m=': 'o', 'bridge': 'b', 'chorus': 'c', 'coda': 'e', 'ending': 'e', 'interlude': 'b', 'intro': 'i', 'misc': 'o', 'part': 'o', 'pre-bridge': 'o', 'pre-chorus': 'p', 'pre-coda': 'o', 'pre-refrain': 'p', 'refrain': 'c', 'strophe': 'v', 'teil': 'o', 'unbekannt': 'o', 'unbenannt': 'o', 'unknown': 'o', 'vers': 'v', 'verse': 'v', 'zwischenspiel': 'b'}
class openlp.plugins.songs.lib.importers.songbeamer.VerseTagMode[source]

Bases: object

ContainsNoTags = 2
ContainsNoTagsRestart = 3
ContainsTags = 1
Unknown = 0