|
@ -83,9 +83,10 @@ def unprefixed(title, prefixes): |
|
|
class SongsList: |
|
|
class SongsList: |
|
|
"""Manipulation et traitement de liste de chansons""" |
|
|
"""Manipulation et traitement de liste de chansons""" |
|
|
|
|
|
|
|
|
def __init__(self, library, prefixes): |
|
|
def __init__(self, library, prefixes, language): |
|
|
self._library = library |
|
|
self._library = library |
|
|
self._prefixes = prefixes |
|
|
self._prefixes = prefixes |
|
|
|
|
|
self._language = language |
|
|
|
|
|
|
|
|
# Liste triée des chansons |
|
|
# Liste triée des chansons |
|
|
self.songs = [] |
|
|
self.songs = [] |
|
@ -124,6 +125,7 @@ class SongsList: |
|
|
"""Renvoie le code LaTeX nécessaire pour intégrer la liste de chansons. |
|
|
"""Renvoie le code LaTeX nécessaire pour intégrer la liste de chansons. |
|
|
""" |
|
|
""" |
|
|
result = [ '\\input{{{0}}}'.format(song.path.replace("\\","/").strip()) for song in self.songs] |
|
|
result = [ '\\input{{{0}}}'.format(song.path.replace("\\","/").strip()) for song in self.songs] |
|
|
|
|
|
result.append('\\selectlanguage{%s}' % self._language) |
|
|
return '\n'.join(result) |
|
|
return '\n'.join(result) |
|
|
|
|
|
|
|
|
def languages(self): |
|
|
def languages(self): |
|
@ -195,6 +197,8 @@ def makeTexFile(sb, library, output): |
|
|
for prefix in sb["titleprefixwords"]: |
|
|
for prefix in sb["titleprefixwords"]: |
|
|
titleprefixwords += "\\titleprefixword{%s}\n" % prefix |
|
|
titleprefixwords += "\\titleprefixword{%s}\n" % prefix |
|
|
sb["titleprefixwords"] = titleprefixwords |
|
|
sb["titleprefixwords"] = titleprefixwords |
|
|
|
|
|
if "lang" not in sb: |
|
|
|
|
|
sb["lang"] = "french" |
|
|
if "sort" in sb: |
|
|
if "sort" in sb: |
|
|
sort = sb["sort"] |
|
|
sort = sb["sort"] |
|
|
del sb["sort"] |
|
|
del sb["sort"] |
|
@ -208,7 +212,7 @@ def makeTexFile(sb, library, output): |
|
|
# compute songslist |
|
|
# compute songslist |
|
|
if songs == "all": |
|
|
if songs == "all": |
|
|
songs = map(lambda x: x[len(library) + 6:], recursiveFind(os.path.join(library, 'songs'), '*.sg')) |
|
|
songs = map(lambda x: x[len(library) + 6:], recursiveFind(os.path.join(library, 'songs'), '*.sg')) |
|
|
songslist = SongsList(library, prefixes) |
|
|
songslist = SongsList(library, prefixes, sb["lang"]) |
|
|
songslist.append_list(songs) |
|
|
songslist.append_list(songs) |
|
|
|
|
|
|
|
|
sb["languages"] = ",".join(songslist.languages()) |
|
|
sb["languages"] = ",".join(songslist.languages()) |
|
|