From 1711aaae1c2b3397d739a0669df124e0534711b0 Mon Sep 17 00:00:00 2001 From: pin Date: Fri, 5 Feb 2010 20:17:44 +0000 Subject: [PATCH] Ajout des tirets autours des syllabes. git-svn-id: https://svn.cri.ensmp.fr/svn/minwii/trunk@9 fe552daf-6dbe-4428-90eb-1537e0879342 --- src/songs/musicxmltosong.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/songs/musicxmltosong.py b/src/songs/musicxmltosong.py index 00903a1..1724fc4 100755 --- a/src/songs/musicxmltosong.py +++ b/src/songs/musicxmltosong.py @@ -138,13 +138,22 @@ class Note(object) : class Lyric(object) : + + _syllabicModifiers = { + 'single' : '%s', + 'begin' : '%s -', + 'middle' : '- %s -', + 'end' : '- %s' + } + def __init__(self, node) : self.node = node self.syllabic = _getNodeValue(node, 'syllabic', 'single') self.text = _getNodeValue(node, 'text') def __str__(self) : - return self.text.encode('utf-8') + text = self._syllabicModifiers[self.syllabic] % self.text + return text.encode('utf-8') __repr__ = __str__ -- 2.20.1