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'],