Browse Source

Merge pull request #188 from patacrep/windows_fix

Fix windows rendering after content update
pull/184/merge
Louis 9 years ago
parent
commit
a86f39c9b5
  1. 5
      patacrep/content/sorted.py
  2. 4
      patacrep/content/tex.py
  3. 10
      test/test_songbook/content.tex.control

5
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."""

4
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):

10
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}

Loading…
Cancel
Save