From 8a26259cee6789b6244e2368a47722ef4a27e8c8 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Mon, 4 Jan 2016 15:58:57 +0100 Subject: [PATCH 1/2] Tex input requires posix path --- patacrep/content/tex.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patacrep/content/tex.py b/patacrep/content/tex.py index f32880cf..2f20f70b 100755 --- a/patacrep/content/tex.py +++ b/patacrep/content/tex.py @@ -16,10 +16,10 @@ class LaTeX(ContentItem): self.filename = filename def render(self, context): - return r'\input{{{}}}'.format(files.relpath( + return r'\input{{{}}}'.format(files.path2posix(files.relpath( self.filename, os.path.dirname(context['filename']), - )) + ))) #pylint: disable=unused-argument def parse(keyword, argument, contentlist, config): From b3d11140c1dd9ff9dc3ec899c2fb9b07bb252d42 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Mon, 4 Jan 2016 21:47:44 +0100 Subject: [PATCH 2/2] Correct sorted normalization --- patacrep/content/sorted.py | 5 ++--- test/test_songbook/content.tex.control | 10 +++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/patacrep/content/sorted.py b/patacrep/content/sorted.py index 9f9fded9..c14cc732 100755 --- a/patacrep/content/sorted.py +++ b/patacrep/content/sorted.py @@ -4,7 +4,6 @@ This plugin provides keyword 'sorted', used to include a sorted list of songs to a songbook. """ -import locale import logging import unidecode @@ -23,9 +22,9 @@ def normalize_string(string): Normalized means: - no surrounding spaces; - lower case; - - passed through locale.strxfrm(). + - passed through unidecode.unidecode(). """ - return locale.strxfrm(unidecode.unidecode(string.lower().strip())) + return unidecode.unidecode(string.lower().strip()) def normalize_field(field): """Return a normalized field, it being a string or a list of strings.""" diff --git a/test/test_songbook/content.tex.control b/test/test_songbook/content.tex.control index 9dfa5b64..02606184 100644 --- a/test/test_songbook/content.tex.control +++ b/test/test_songbook/content.tex.control @@ -91,11 +91,6 @@ guitar, \section{Test of section} \begin{songs}{titleidx,authidx} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% songs/./song.tsg - -\import{@TEST_FOLDER@/content_datadir/songs/}{song.tsg} - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% songs/./song.csg @@ -115,6 +110,11 @@ guitar, \endsong +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% songs/./song.tsg + +\import{@TEST_FOLDER@/content_datadir/songs/}{song.tsg} + \end{songs} \songsection{Test of song section}