From e835beedb5b27d234086dde712ce1d9b3c52ab1b Mon Sep 17 00:00:00 2001 From: Louis Date: Thu, 5 Nov 2015 13:38:27 +0100 Subject: [PATCH] Move templates used ir chordpro conversion Closer #150 --- .../chordpro/chordpro/content_chord | 0 .../chordpro/chordpro/content_chordlist | 0 .../chordpro/chordpro/content_comment | 0 .../chordpro/chordpro/content_define | 0 .../chordpro/chordpro/content_endofline | 0 .../chordpro/chordpro/content_error | 0 .../chordpro/chordpro/content_guitar_comment | 0 .../chordpro/chordpro/content_image | 0 .../chordpro/chordpro/content_line | 0 .../chordpro/chordpro/content_newline | 0 .../chordpro/chordpro/content_partition | 0 .../chordpro/chordpro/content_space | 0 .../chordpro/chordpro/content_tablature | 0 .../chordpro/chordpro/content_verse | 0 .../chordpro/chordpro/content_word | 0 .../data/{ast_templates => }/chordpro/chordpro/song | 0 .../{ast_templates => }/chordpro/chordpro/song_body | 0 .../{ast_templates => }/chordpro/chordpro/song_header | 0 .../{ast_templates => }/chordpro/html/content_chord | 0 .../chordpro/html/content_chordlist | 0 .../{ast_templates => }/chordpro/html/content_comment | 0 .../{ast_templates => }/chordpro/html/content_define | 0 .../chordpro/html/content_define_list | 0 .../chordpro/html/content_endofline | 0 .../{ast_templates => }/chordpro/html/content_error | 0 .../chordpro/html/content_guitar_comment | 0 .../{ast_templates => }/chordpro/html/content_image | 0 .../{ast_templates => }/chordpro/html/content_line | 0 .../chordpro/html/content_metadata_cover | 0 .../{ast_templates => }/chordpro/html/content_newline | 0 .../chordpro/html/content_partition | 0 .../{ast_templates => }/chordpro/html/content_space | 0 .../chordpro/html/content_tablature | 0 .../{ast_templates => }/chordpro/html/content_verse | 0 .../{ast_templates => }/chordpro/html/content_word | 0 patacrep/data/{ast_templates => }/chordpro/html/song | 0 .../data/{ast_templates => }/chordpro/html/song_body | 0 .../{ast_templates => }/chordpro/html/song_header | 0 .../{ast_templates => }/chordpro/latex/content_chord | 0 .../chordpro/latex/content_chordlist | 0 .../chordpro/latex/content_comment | 0 .../{ast_templates => }/chordpro/latex/content_define | 0 .../chordpro/latex/content_endofline | 0 .../{ast_templates => }/chordpro/latex/content_error | 0 .../chordpro/latex/content_guitar_comment | 0 .../{ast_templates => }/chordpro/latex/content_image | 0 .../{ast_templates => }/chordpro/latex/content_line | 0 .../chordpro/latex/content_newline | 0 .../chordpro/latex/content_partition | 0 .../{ast_templates => }/chordpro/latex/content_space | 0 .../chordpro/latex/content_tablature | 0 .../{ast_templates => }/chordpro/latex/content_verse | 0 .../{ast_templates => }/chordpro/latex/content_word | 0 patacrep/data/{ast_templates => }/chordpro/latex/song | 0 .../data/{ast_templates => }/chordpro/latex/song_body | 0 patacrep/songs/chordpro/__init__.py | 11 +++-------- test/test_chordpro/test_parser.py | 3 ++- 57 files changed, 5 insertions(+), 9 deletions(-) rename patacrep/data/{ast_templates => }/chordpro/chordpro/content_chord (100%) rename patacrep/data/{ast_templates => }/chordpro/chordpro/content_chordlist (100%) rename patacrep/data/{ast_templates => }/chordpro/chordpro/content_comment (100%) rename patacrep/data/{ast_templates => }/chordpro/chordpro/content_define (100%) rename patacrep/data/{ast_templates => }/chordpro/chordpro/content_endofline (100%) rename patacrep/data/{ast_templates => }/chordpro/chordpro/content_error (100%) rename patacrep/data/{ast_templates => }/chordpro/chordpro/content_guitar_comment (100%) rename patacrep/data/{ast_templates => }/chordpro/chordpro/content_image (100%) rename patacrep/data/{ast_templates => }/chordpro/chordpro/content_line (100%) rename patacrep/data/{ast_templates => }/chordpro/chordpro/content_newline (100%) rename patacrep/data/{ast_templates => }/chordpro/chordpro/content_partition (100%) rename patacrep/data/{ast_templates => }/chordpro/chordpro/content_space (100%) rename patacrep/data/{ast_templates => }/chordpro/chordpro/content_tablature (100%) rename patacrep/data/{ast_templates => }/chordpro/chordpro/content_verse (100%) rename patacrep/data/{ast_templates => }/chordpro/chordpro/content_word (100%) rename patacrep/data/{ast_templates => }/chordpro/chordpro/song (100%) rename patacrep/data/{ast_templates => }/chordpro/chordpro/song_body (100%) rename patacrep/data/{ast_templates => }/chordpro/chordpro/song_header (100%) rename patacrep/data/{ast_templates => }/chordpro/html/content_chord (100%) rename patacrep/data/{ast_templates => }/chordpro/html/content_chordlist (100%) rename patacrep/data/{ast_templates => }/chordpro/html/content_comment (100%) rename patacrep/data/{ast_templates => }/chordpro/html/content_define (100%) rename patacrep/data/{ast_templates => }/chordpro/html/content_define_list (100%) rename patacrep/data/{ast_templates => }/chordpro/html/content_endofline (100%) rename patacrep/data/{ast_templates => }/chordpro/html/content_error (100%) rename patacrep/data/{ast_templates => }/chordpro/html/content_guitar_comment (100%) rename patacrep/data/{ast_templates => }/chordpro/html/content_image (100%) rename patacrep/data/{ast_templates => }/chordpro/html/content_line (100%) rename patacrep/data/{ast_templates => }/chordpro/html/content_metadata_cover (100%) rename patacrep/data/{ast_templates => }/chordpro/html/content_newline (100%) rename patacrep/data/{ast_templates => }/chordpro/html/content_partition (100%) rename patacrep/data/{ast_templates => }/chordpro/html/content_space (100%) rename patacrep/data/{ast_templates => }/chordpro/html/content_tablature (100%) rename patacrep/data/{ast_templates => }/chordpro/html/content_verse (100%) rename patacrep/data/{ast_templates => }/chordpro/html/content_word (100%) rename patacrep/data/{ast_templates => }/chordpro/html/song (100%) rename patacrep/data/{ast_templates => }/chordpro/html/song_body (100%) rename patacrep/data/{ast_templates => }/chordpro/html/song_header (100%) rename patacrep/data/{ast_templates => }/chordpro/latex/content_chord (100%) rename patacrep/data/{ast_templates => }/chordpro/latex/content_chordlist (100%) rename patacrep/data/{ast_templates => }/chordpro/latex/content_comment (100%) rename patacrep/data/{ast_templates => }/chordpro/latex/content_define (100%) rename patacrep/data/{ast_templates => }/chordpro/latex/content_endofline (100%) rename patacrep/data/{ast_templates => }/chordpro/latex/content_error (100%) rename patacrep/data/{ast_templates => }/chordpro/latex/content_guitar_comment (100%) rename patacrep/data/{ast_templates => }/chordpro/latex/content_image (100%) rename patacrep/data/{ast_templates => }/chordpro/latex/content_line (100%) rename patacrep/data/{ast_templates => }/chordpro/latex/content_newline (100%) rename patacrep/data/{ast_templates => }/chordpro/latex/content_partition (100%) rename patacrep/data/{ast_templates => }/chordpro/latex/content_space (100%) rename patacrep/data/{ast_templates => }/chordpro/latex/content_tablature (100%) rename patacrep/data/{ast_templates => }/chordpro/latex/content_verse (100%) rename patacrep/data/{ast_templates => }/chordpro/latex/content_word (100%) rename patacrep/data/{ast_templates => }/chordpro/latex/song (100%) rename patacrep/data/{ast_templates => }/chordpro/latex/song_body (100%) diff --git a/patacrep/data/ast_templates/chordpro/chordpro/content_chord b/patacrep/data/chordpro/chordpro/content_chord similarity index 100% rename from patacrep/data/ast_templates/chordpro/chordpro/content_chord rename to patacrep/data/chordpro/chordpro/content_chord diff --git a/patacrep/data/ast_templates/chordpro/chordpro/content_chordlist b/patacrep/data/chordpro/chordpro/content_chordlist similarity index 100% rename from patacrep/data/ast_templates/chordpro/chordpro/content_chordlist rename to patacrep/data/chordpro/chordpro/content_chordlist diff --git a/patacrep/data/ast_templates/chordpro/chordpro/content_comment b/patacrep/data/chordpro/chordpro/content_comment similarity index 100% rename from patacrep/data/ast_templates/chordpro/chordpro/content_comment rename to patacrep/data/chordpro/chordpro/content_comment diff --git a/patacrep/data/ast_templates/chordpro/chordpro/content_define b/patacrep/data/chordpro/chordpro/content_define similarity index 100% rename from patacrep/data/ast_templates/chordpro/chordpro/content_define rename to patacrep/data/chordpro/chordpro/content_define diff --git a/patacrep/data/ast_templates/chordpro/chordpro/content_endofline b/patacrep/data/chordpro/chordpro/content_endofline similarity index 100% rename from patacrep/data/ast_templates/chordpro/chordpro/content_endofline rename to patacrep/data/chordpro/chordpro/content_endofline diff --git a/patacrep/data/ast_templates/chordpro/chordpro/content_error b/patacrep/data/chordpro/chordpro/content_error similarity index 100% rename from patacrep/data/ast_templates/chordpro/chordpro/content_error rename to patacrep/data/chordpro/chordpro/content_error diff --git a/patacrep/data/ast_templates/chordpro/chordpro/content_guitar_comment b/patacrep/data/chordpro/chordpro/content_guitar_comment similarity index 100% rename from patacrep/data/ast_templates/chordpro/chordpro/content_guitar_comment rename to patacrep/data/chordpro/chordpro/content_guitar_comment diff --git a/patacrep/data/ast_templates/chordpro/chordpro/content_image b/patacrep/data/chordpro/chordpro/content_image similarity index 100% rename from patacrep/data/ast_templates/chordpro/chordpro/content_image rename to patacrep/data/chordpro/chordpro/content_image diff --git a/patacrep/data/ast_templates/chordpro/chordpro/content_line b/patacrep/data/chordpro/chordpro/content_line similarity index 100% rename from patacrep/data/ast_templates/chordpro/chordpro/content_line rename to patacrep/data/chordpro/chordpro/content_line diff --git a/patacrep/data/ast_templates/chordpro/chordpro/content_newline b/patacrep/data/chordpro/chordpro/content_newline similarity index 100% rename from patacrep/data/ast_templates/chordpro/chordpro/content_newline rename to patacrep/data/chordpro/chordpro/content_newline diff --git a/patacrep/data/ast_templates/chordpro/chordpro/content_partition b/patacrep/data/chordpro/chordpro/content_partition similarity index 100% rename from patacrep/data/ast_templates/chordpro/chordpro/content_partition rename to patacrep/data/chordpro/chordpro/content_partition diff --git a/patacrep/data/ast_templates/chordpro/chordpro/content_space b/patacrep/data/chordpro/chordpro/content_space similarity index 100% rename from patacrep/data/ast_templates/chordpro/chordpro/content_space rename to patacrep/data/chordpro/chordpro/content_space diff --git a/patacrep/data/ast_templates/chordpro/chordpro/content_tablature b/patacrep/data/chordpro/chordpro/content_tablature similarity index 100% rename from patacrep/data/ast_templates/chordpro/chordpro/content_tablature rename to patacrep/data/chordpro/chordpro/content_tablature diff --git a/patacrep/data/ast_templates/chordpro/chordpro/content_verse b/patacrep/data/chordpro/chordpro/content_verse similarity index 100% rename from patacrep/data/ast_templates/chordpro/chordpro/content_verse rename to patacrep/data/chordpro/chordpro/content_verse diff --git a/patacrep/data/ast_templates/chordpro/chordpro/content_word b/patacrep/data/chordpro/chordpro/content_word similarity index 100% rename from patacrep/data/ast_templates/chordpro/chordpro/content_word rename to patacrep/data/chordpro/chordpro/content_word diff --git a/patacrep/data/ast_templates/chordpro/chordpro/song b/patacrep/data/chordpro/chordpro/song similarity index 100% rename from patacrep/data/ast_templates/chordpro/chordpro/song rename to patacrep/data/chordpro/chordpro/song diff --git a/patacrep/data/ast_templates/chordpro/chordpro/song_body b/patacrep/data/chordpro/chordpro/song_body similarity index 100% rename from patacrep/data/ast_templates/chordpro/chordpro/song_body rename to patacrep/data/chordpro/chordpro/song_body diff --git a/patacrep/data/ast_templates/chordpro/chordpro/song_header b/patacrep/data/chordpro/chordpro/song_header similarity index 100% rename from patacrep/data/ast_templates/chordpro/chordpro/song_header rename to patacrep/data/chordpro/chordpro/song_header diff --git a/patacrep/data/ast_templates/chordpro/html/content_chord b/patacrep/data/chordpro/html/content_chord similarity index 100% rename from patacrep/data/ast_templates/chordpro/html/content_chord rename to patacrep/data/chordpro/html/content_chord diff --git a/patacrep/data/ast_templates/chordpro/html/content_chordlist b/patacrep/data/chordpro/html/content_chordlist similarity index 100% rename from patacrep/data/ast_templates/chordpro/html/content_chordlist rename to patacrep/data/chordpro/html/content_chordlist diff --git a/patacrep/data/ast_templates/chordpro/html/content_comment b/patacrep/data/chordpro/html/content_comment similarity index 100% rename from patacrep/data/ast_templates/chordpro/html/content_comment rename to patacrep/data/chordpro/html/content_comment diff --git a/patacrep/data/ast_templates/chordpro/html/content_define b/patacrep/data/chordpro/html/content_define similarity index 100% rename from patacrep/data/ast_templates/chordpro/html/content_define rename to patacrep/data/chordpro/html/content_define diff --git a/patacrep/data/ast_templates/chordpro/html/content_define_list b/patacrep/data/chordpro/html/content_define_list similarity index 100% rename from patacrep/data/ast_templates/chordpro/html/content_define_list rename to patacrep/data/chordpro/html/content_define_list diff --git a/patacrep/data/ast_templates/chordpro/html/content_endofline b/patacrep/data/chordpro/html/content_endofline similarity index 100% rename from patacrep/data/ast_templates/chordpro/html/content_endofline rename to patacrep/data/chordpro/html/content_endofline diff --git a/patacrep/data/ast_templates/chordpro/html/content_error b/patacrep/data/chordpro/html/content_error similarity index 100% rename from patacrep/data/ast_templates/chordpro/html/content_error rename to patacrep/data/chordpro/html/content_error diff --git a/patacrep/data/ast_templates/chordpro/html/content_guitar_comment b/patacrep/data/chordpro/html/content_guitar_comment similarity index 100% rename from patacrep/data/ast_templates/chordpro/html/content_guitar_comment rename to patacrep/data/chordpro/html/content_guitar_comment diff --git a/patacrep/data/ast_templates/chordpro/html/content_image b/patacrep/data/chordpro/html/content_image similarity index 100% rename from patacrep/data/ast_templates/chordpro/html/content_image rename to patacrep/data/chordpro/html/content_image diff --git a/patacrep/data/ast_templates/chordpro/html/content_line b/patacrep/data/chordpro/html/content_line similarity index 100% rename from patacrep/data/ast_templates/chordpro/html/content_line rename to patacrep/data/chordpro/html/content_line diff --git a/patacrep/data/ast_templates/chordpro/html/content_metadata_cover b/patacrep/data/chordpro/html/content_metadata_cover similarity index 100% rename from patacrep/data/ast_templates/chordpro/html/content_metadata_cover rename to patacrep/data/chordpro/html/content_metadata_cover diff --git a/patacrep/data/ast_templates/chordpro/html/content_newline b/patacrep/data/chordpro/html/content_newline similarity index 100% rename from patacrep/data/ast_templates/chordpro/html/content_newline rename to patacrep/data/chordpro/html/content_newline diff --git a/patacrep/data/ast_templates/chordpro/html/content_partition b/patacrep/data/chordpro/html/content_partition similarity index 100% rename from patacrep/data/ast_templates/chordpro/html/content_partition rename to patacrep/data/chordpro/html/content_partition diff --git a/patacrep/data/ast_templates/chordpro/html/content_space b/patacrep/data/chordpro/html/content_space similarity index 100% rename from patacrep/data/ast_templates/chordpro/html/content_space rename to patacrep/data/chordpro/html/content_space diff --git a/patacrep/data/ast_templates/chordpro/html/content_tablature b/patacrep/data/chordpro/html/content_tablature similarity index 100% rename from patacrep/data/ast_templates/chordpro/html/content_tablature rename to patacrep/data/chordpro/html/content_tablature diff --git a/patacrep/data/ast_templates/chordpro/html/content_verse b/patacrep/data/chordpro/html/content_verse similarity index 100% rename from patacrep/data/ast_templates/chordpro/html/content_verse rename to patacrep/data/chordpro/html/content_verse diff --git a/patacrep/data/ast_templates/chordpro/html/content_word b/patacrep/data/chordpro/html/content_word similarity index 100% rename from patacrep/data/ast_templates/chordpro/html/content_word rename to patacrep/data/chordpro/html/content_word diff --git a/patacrep/data/ast_templates/chordpro/html/song b/patacrep/data/chordpro/html/song similarity index 100% rename from patacrep/data/ast_templates/chordpro/html/song rename to patacrep/data/chordpro/html/song diff --git a/patacrep/data/ast_templates/chordpro/html/song_body b/patacrep/data/chordpro/html/song_body similarity index 100% rename from patacrep/data/ast_templates/chordpro/html/song_body rename to patacrep/data/chordpro/html/song_body diff --git a/patacrep/data/ast_templates/chordpro/html/song_header b/patacrep/data/chordpro/html/song_header similarity index 100% rename from patacrep/data/ast_templates/chordpro/html/song_header rename to patacrep/data/chordpro/html/song_header diff --git a/patacrep/data/ast_templates/chordpro/latex/content_chord b/patacrep/data/chordpro/latex/content_chord similarity index 100% rename from patacrep/data/ast_templates/chordpro/latex/content_chord rename to patacrep/data/chordpro/latex/content_chord diff --git a/patacrep/data/ast_templates/chordpro/latex/content_chordlist b/patacrep/data/chordpro/latex/content_chordlist similarity index 100% rename from patacrep/data/ast_templates/chordpro/latex/content_chordlist rename to patacrep/data/chordpro/latex/content_chordlist diff --git a/patacrep/data/ast_templates/chordpro/latex/content_comment b/patacrep/data/chordpro/latex/content_comment similarity index 100% rename from patacrep/data/ast_templates/chordpro/latex/content_comment rename to patacrep/data/chordpro/latex/content_comment diff --git a/patacrep/data/ast_templates/chordpro/latex/content_define b/patacrep/data/chordpro/latex/content_define similarity index 100% rename from patacrep/data/ast_templates/chordpro/latex/content_define rename to patacrep/data/chordpro/latex/content_define diff --git a/patacrep/data/ast_templates/chordpro/latex/content_endofline b/patacrep/data/chordpro/latex/content_endofline similarity index 100% rename from patacrep/data/ast_templates/chordpro/latex/content_endofline rename to patacrep/data/chordpro/latex/content_endofline diff --git a/patacrep/data/ast_templates/chordpro/latex/content_error b/patacrep/data/chordpro/latex/content_error similarity index 100% rename from patacrep/data/ast_templates/chordpro/latex/content_error rename to patacrep/data/chordpro/latex/content_error diff --git a/patacrep/data/ast_templates/chordpro/latex/content_guitar_comment b/patacrep/data/chordpro/latex/content_guitar_comment similarity index 100% rename from patacrep/data/ast_templates/chordpro/latex/content_guitar_comment rename to patacrep/data/chordpro/latex/content_guitar_comment diff --git a/patacrep/data/ast_templates/chordpro/latex/content_image b/patacrep/data/chordpro/latex/content_image similarity index 100% rename from patacrep/data/ast_templates/chordpro/latex/content_image rename to patacrep/data/chordpro/latex/content_image diff --git a/patacrep/data/ast_templates/chordpro/latex/content_line b/patacrep/data/chordpro/latex/content_line similarity index 100% rename from patacrep/data/ast_templates/chordpro/latex/content_line rename to patacrep/data/chordpro/latex/content_line diff --git a/patacrep/data/ast_templates/chordpro/latex/content_newline b/patacrep/data/chordpro/latex/content_newline similarity index 100% rename from patacrep/data/ast_templates/chordpro/latex/content_newline rename to patacrep/data/chordpro/latex/content_newline diff --git a/patacrep/data/ast_templates/chordpro/latex/content_partition b/patacrep/data/chordpro/latex/content_partition similarity index 100% rename from patacrep/data/ast_templates/chordpro/latex/content_partition rename to patacrep/data/chordpro/latex/content_partition diff --git a/patacrep/data/ast_templates/chordpro/latex/content_space b/patacrep/data/chordpro/latex/content_space similarity index 100% rename from patacrep/data/ast_templates/chordpro/latex/content_space rename to patacrep/data/chordpro/latex/content_space diff --git a/patacrep/data/ast_templates/chordpro/latex/content_tablature b/patacrep/data/chordpro/latex/content_tablature similarity index 100% rename from patacrep/data/ast_templates/chordpro/latex/content_tablature rename to patacrep/data/chordpro/latex/content_tablature diff --git a/patacrep/data/ast_templates/chordpro/latex/content_verse b/patacrep/data/chordpro/latex/content_verse similarity index 100% rename from patacrep/data/ast_templates/chordpro/latex/content_verse rename to patacrep/data/chordpro/latex/content_verse diff --git a/patacrep/data/ast_templates/chordpro/latex/content_word b/patacrep/data/chordpro/latex/content_word similarity index 100% rename from patacrep/data/ast_templates/chordpro/latex/content_word rename to patacrep/data/chordpro/latex/content_word diff --git a/patacrep/data/ast_templates/chordpro/latex/song b/patacrep/data/chordpro/latex/song similarity index 100% rename from patacrep/data/ast_templates/chordpro/latex/song rename to patacrep/data/chordpro/latex/song diff --git a/patacrep/data/ast_templates/chordpro/latex/song_body b/patacrep/data/chordpro/latex/song_body similarity index 100% rename from patacrep/data/ast_templates/chordpro/latex/song_body rename to patacrep/data/chordpro/latex/song_body diff --git a/patacrep/songs/chordpro/__init__.py b/patacrep/songs/chordpro/__init__.py index ce688379..fa05b3dd 100644 --- a/patacrep/songs/chordpro/__init__.py +++ b/patacrep/songs/chordpro/__init__.py @@ -48,14 +48,9 @@ class ChordproSong(Song): "content": self.cached['song'].content, } - jinjaenv = Environment(loader=ChoiceLoader([ - FileSystemLoader( - self.iter_datadirs("templates", self.output_language) - ), - FileSystemLoader( - pkg_datapath('ast_templates', 'chordpro', self.output_language) - ), - ])) + jinjaenv = Environment(loader=FileSystemLoader( + self.iter_datadirs("chordpro", self.output_language) + )) jinjaenv.filters['search_image'] = self.search_image jinjaenv.filters['search_partition'] = self.search_partition jinjaenv.filters['lang2babel'] = lang2babel diff --git a/test/test_chordpro/test_parser.py b/test/test_chordpro/test_parser.py index f0e94290..f542a203 100644 --- a/test/test_chordpro/test_parser.py +++ b/test/test_chordpro/test_parser.py @@ -7,7 +7,7 @@ import os import unittest from pkg_resources import resource_filename -from patacrep import files +from patacrep import files, __DATADIR__ from patacrep.build import DEFAULT_CONFIG from patacrep.encoding import open_read @@ -41,6 +41,7 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): if 'datadir' not in cls.config: cls.config['datadir'] = [] cls.config['datadir'].append(resource_filename(__name__, 'datadir')) + cls.config['datadir'].append(__DATADIR__) cls.song_plugins = files.load_plugins( datadirs=cls.config['datadir'],