forked from openlp/openlp
Fixed path to xmlrootclass
bzr-revno: 179
This commit is contained in:
parent
8abce6443f
commit
889b43dc81
@ -20,9 +20,9 @@ import sys
|
|||||||
import os
|
import os
|
||||||
from types import StringType, ListType, NoneType
|
from types import StringType, ListType, NoneType
|
||||||
|
|
||||||
sys.path.append(os.path.abspath("./../.."))
|
sys.path.append(os.path.abspath("./../../.."))
|
||||||
|
|
||||||
from openlp.core.xmlrootclass import XmlRootClass
|
from openlp.core.lib.xmlrootclass import XmlRootClass
|
||||||
|
|
||||||
class SongException(Exception):
|
class SongException(Exception):
|
||||||
pass
|
pass
|
||||||
@ -33,6 +33,17 @@ class SongTitleError(SongException):
|
|||||||
class SongTypeError(SongException):
|
class SongTypeError(SongException):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
class SongSlideError(SongException):
|
||||||
|
pass
|
||||||
|
|
||||||
|
# TODO: Song: Logging - not all, but enough
|
||||||
|
# TODO: Song: Handle OpenLP2 format
|
||||||
|
# TODO: Song: Import OpenLP1
|
||||||
|
# TODO: Song: Export OpenLP1
|
||||||
|
# TODO: Song: Export Song to CCLI
|
||||||
|
# TODO: Song: Export Song to OpenSong
|
||||||
|
# TODO: Song: Import ChangingSong
|
||||||
|
# TODO: Song: Export ChangingSong
|
||||||
|
|
||||||
_blankSongXml = \
|
_blankSongXml = \
|
||||||
'''<?xml version="1.0" encoding="iso-8859-1"?>
|
'''<?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
@ -548,12 +559,29 @@ class Song(XmlRootClass) :
|
|||||||
slideNumber -- 0: all slides, 1..n : specific slide
|
slideNumber -- 0: all slides, 1..n : specific slide
|
||||||
a list of strings are returned
|
a list of strings are returned
|
||||||
"""
|
"""
|
||||||
return []
|
num = len(self.slideList)
|
||||||
|
if num < 1 :
|
||||||
|
raise SongSlideError("No slides in this song")
|
||||||
|
elif slideNumber > num :
|
||||||
|
raise SongSlideError("Slide number too high")
|
||||||
|
if slideNumber > 0 :
|
||||||
|
# return this slide
|
||||||
|
res = self.slideList[slideNumber-1]
|
||||||
|
# find theme in this slide
|
||||||
|
else :
|
||||||
|
res = []
|
||||||
|
for i in range(num):
|
||||||
|
if i > 0 :
|
||||||
|
res.append("")
|
||||||
|
res.extend()
|
||||||
|
# remove formattingincluding themes
|
||||||
|
return res
|
||||||
|
|
||||||
def GetRenderSlide(self, slideNumber):
|
def GetRenderSlide(self, slideNumber):
|
||||||
"""Return the slide to be rendered including the additional
|
"""Return the slide to be rendered including the additional
|
||||||
properties
|
properties
|
||||||
|
|
||||||
|
slideNumber -- 1 .. numberOfSlides
|
||||||
Returns a list as:
|
Returns a list as:
|
||||||
[theme (string),
|
[theme (string),
|
||||||
title (string),
|
title (string),
|
||||||
@ -562,6 +590,11 @@ class Song(XmlRootClass) :
|
|||||||
cclino (string),
|
cclino (string),
|
||||||
lyric-part as a list of strings]
|
lyric-part as a list of strings]
|
||||||
"""
|
"""
|
||||||
|
num = len(self.slideList)
|
||||||
|
if num < 1 :
|
||||||
|
raise SongSlideError("No slides in this song")
|
||||||
|
elif slideNumber > num :
|
||||||
|
raise SongSlideError("Slide number too high")
|
||||||
res = []
|
res = []
|
||||||
if self.showTitle :
|
if self.showTitle :
|
||||||
title = self.GetTitle()
|
title = self.GetTitle()
|
||||||
@ -579,8 +612,9 @@ class Song(XmlRootClass) :
|
|||||||
ccli = self.GetSongCcliNo()
|
ccli = self.GetSongCcliNo()
|
||||||
else :
|
else :
|
||||||
ccli = ""
|
ccli = ""
|
||||||
|
theme = self.GetTheme()
|
||||||
# examine the slide for a theme
|
# examine the slide for a theme
|
||||||
res.append(self.GetTheme())
|
res.append(theme)
|
||||||
res.append(title)
|
res.append(title)
|
||||||
res.append(author)
|
res.append(author)
|
||||||
res.append(cpright)
|
res.append(cpright)
|
||||||
|
Loading…
Reference in New Issue
Block a user