X-Git-Url: https://scm.cri.ensmp.fr/git/minwii.git/blobdiff_plain/7a0c63dc85eee41f5982574cc282e7c636705a83..9371dfb82887daf6c2c4124def9929284239190a:/src/songs/musicxmltosong.py diff --git a/src/songs/musicxmltosong.py b/src/songs/musicxmltosong.py index eb5d5c3..d24d81a 100755 --- a/src/songs/musicxmltosong.py +++ b/src/songs/musicxmltosong.py @@ -110,7 +110,7 @@ class Part(object) : def iterNotes(self) : "exécution de la chanson avec l'alternance couplets / refrains" - for verse in self.verses : + for verse in cycle(self.verses) : print "---partie---" repeats = len(verse[0].lyrics) if repeats > 1 : @@ -257,9 +257,12 @@ class Lyric(object) : self.syllabic = _getNodeValue(node, 'syllabic', 'single') self.text = _getNodeValue(node, 'text') - def __str__(self) : + def syllabus(self, encoding='utf-8'): text = self._syllabicModifiers[self.syllabic] % self.text - return text.encode('utf-8') + return text.encode(encoding) + + def __str__(self) : + return self.syllabus() __repr__ = __str__