![]() ![]() format ( verse = verse_joints, lines = lines ) \ ![]() Missing song tag.' ))) return fields = dir ( root ) decode = '. name, str ( translate ( 'SongsPlugin.OpenSongImport', 'Invalid OpenSong song file. exception ( 'Error parsing XML' ) return root = tree. parse ( file ) except ( Error, LxmlError ): self. def do_import_file ( self, file ): """ Process the OpenSong file - pass in a file-like object, not a file path. """ def _init_ ( self, manager, ** kwargs ): """ Initialise the class. The Author and Copyright tags are also imported to the appropriate places. Slide 1 Line 1|Slide 1 Line 2||Slide 2 Line 1|Slide 2 Line 2 Lines beginning with are comments The tag is used to populate the OpenLP verse display order field. | indicates a blank line, and || a new slide. A7 Bm 1 Some_ Words Lines that contain only whitespace are ignored. Guitar chords can be provided "above" the lyrics (the line is preceded by a period "."), and one or more "_" can be used to signify long-drawn-out words. Other labels can be used also: C Chorus B Bridge All verses are imported and tagged appropriately. Additionally, the labels can have either upper or lower case Vs. The number does not necessarily appear at the start of the line. Either or both forms can be used in one song. An example of line grouping:: 1List of words 2Some words for the 2nd Verse 1Another Line 2etc. The 'v' in the verse specifiers above can be left out, it is implied. An example of complete verses:: List of words Another Line Some words for the 2nd verse etc. grouping all line 1's of a verse together, all line 2's of a verse together, and so on. Verses can be expressed in one of 2 ways, either in complete verses, or by line grouping, i.e. If it is not a space the following applies. However, it doesn't describe the section, so here's an attempt: If the first character of a line is a space, then the rest of that line is lyrics. class OpenSongImport ( SongImport ): """ Import songs exported from OpenSong The format is described loosely on the `OpenSong File Format Specification `_ page on the OpenSong web site. # 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 # import logging import re from lxml import objectify from lxml.etree import Error, LxmlError from import translate, Settings from import VerseType from .importers.songimport import SongImport from .ui import SongStrings log = logging. See the GNU General Public License for # more details. # 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. # -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 # OpenLP - Open Source Lyrics Projection # - # Copyright (c) 2008-2017 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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |