From 6dd81e9aa57cb8a902357d23241f1bcf9ebae836 Mon Sep 17 00:00:00 2001 From: Louis Date: Mon, 25 Mar 2013 20:55:46 +0100 Subject: [PATCH] Ajout automatique des langues dans Babel --- parse.py | 16 ---------------- songbook.py | 19 ++++++++++++++++--- templates/ancient.tmpl | 7 +++++-- templates/minimal.tmpl | 7 +++++-- templates/patacrep.tmpl | 8 ++++++-- utils/plastex.py | 31 +++++++++++++++++++++++++++++++ 6 files changed, 63 insertions(+), 25 deletions(-) delete mode 100755 parse.py create mode 100755 utils/plastex.py diff --git a/parse.py b/parse.py deleted file mode 100755 index de007762..00000000 --- a/parse.py +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -FILENAME = "naheulbeuk.tex" - -import plasTeX -from plasTeX.TeX import TeX - -doc = TeX(file = FILENAME).parse() - -language_list = set() -for node in doc.allChildNodes: - if node.nodeName == "selectlanguage": - language_list.add(node.argSource) - -print language_list diff --git a/songbook.py b/songbook.py index 1a96d00b..8851509a 100755 --- a/songbook.py +++ b/songbook.py @@ -12,17 +12,20 @@ import locale import platform from utils.utils import recursiveFind +from utils.plastex import parsetex reTitle = re.compile('(?<=beginsong\\{)(.(?