From c161ed1e2dd1e527e5cd0925cda43337311536de Mon Sep 17 00:00:00 2001 From: Louis Date: Fri, 27 Jun 2014 16:51:02 +0200 Subject: [PATCH] =?UTF-8?q?Possibilit=C3=A9=20d'utiliser=20des=20intersong?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cela fonctionnait il y a longtemps, mais a été perdu au fil du temps. http://www.patacrep.com/forum/viewtopic.php?pid=670#p670 --- patacrep/content/song.py | 5 ++++- patacrep/data/latex/patacrep.sty | 11 +++++++++++ patacrep/plastex.py | 2 +- patacrep/plastex_songs.py | 4 ++++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/patacrep/content/song.py b/patacrep/content/song.py index 85a175e8..a9123244 100755 --- a/patacrep/content/song.py +++ b/patacrep/content/song.py @@ -61,7 +61,10 @@ def parse(keyword, argument, contentlist, config): contentlist = [ files.relpath(filename, songdir) for filename - in files.recursive_find(songdir, "*.sg") + in ( + files.recursive_find(songdir, "*.sg") + + files.recursive_find(songdir, "*.is") + ) ] for elem in contentlist: before = len(songlist) diff --git a/patacrep/data/latex/patacrep.sty b/patacrep/data/latex/patacrep.sty index 084e5866..a0919772 100644 --- a/patacrep/data/latex/patacrep.sty +++ b/patacrep/data/latex/patacrep.sty @@ -415,4 +415,15 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Intersong management : discard command \sortassong +\newcommand{\sortassong}[2][]{% + \@ifnextchar[% + \@void% + {}% +} +\def\@void[#1]{} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \endinput diff --git a/patacrep/plastex.py b/patacrep/plastex.py index 6ffab971..c4c81e62 100644 --- a/patacrep/plastex.py +++ b/patacrep/plastex.py @@ -106,7 +106,7 @@ def parsetex(filename): for node in doc.allChildNodes: if node.nodeName == "selectlanguage": data["languages"].add(node.attributes['lang']) - if node.nodeName == "beginsong": + if node.nodeName in ["beginsong", "sortassong"]: data["titles"] = node.attributes["titles"] data["args"] = node.attributes["args"] diff --git a/patacrep/plastex_songs.py b/patacrep/plastex_songs.py index 37536ef6..43c31986 100755 --- a/patacrep/plastex_songs.py +++ b/patacrep/plastex_songs.py @@ -61,3 +61,7 @@ class beginsong(plasTeX.Command): # pylint: disable=invalid-name,too-many-public else: args[key] = unicode(val) self.attributes['args'] = args + +class sortassong(beginsong): # pylint: disable=invalid-name,too-many-public-methods + r"""Treat '\sortassong' exactly as if it were a '\beginsong'.""" + pass