diff --git a/songbook_core/build.py b/songbook_core/build.py index 5e26a720..6a2a01e6 100755 --- a/songbook_core/build.py +++ b/songbook_core/build.py @@ -75,7 +75,7 @@ class Songbook(object): abs_datadir.append(__DATADIR__) self.config['datadir'] = abs_datadir - self.config['songdir'] = [os.path.join(path, 'songs') for path in self.config['datadir']] + self.config['_songdir'] = [os.path.join(path, 'songs') for path in self.config['datadir']] def build_config(self, from_templates): config = DEFAULT_CONFIG diff --git a/songbook_core/content/cwd.py b/songbook_core/content/cwd.py index 6c76d8c2..a9c5053e 100644 --- a/songbook_core/content/cwd.py +++ b/songbook_core/content/cwd.py @@ -6,10 +6,10 @@ import os from songbook_core.content import process_content def parse(keyword, config, argument, contentlist): - config['songdir'] = ( + config['_songdir'] = ( [os.path.relpath(argument)] + - [os.path.join(path, argument) for path in config['songdir']] + - config['songdir'] + [os.path.join(path, argument) for path in config['_songdir']] + + config['_songdir'] ) return process_content(contentlist, config) diff --git a/songbook_core/content/song.py b/songbook_core/content/song.py index 38948e28..fbaae8d7 100644 --- a/songbook_core/content/song.py +++ b/songbook_core/content/song.py @@ -35,9 +35,9 @@ class SongRenderer(Content, Song): def parse(keyword, argument, contentlist, config): if 'languages' not in config: - config['languages'] = set() + config['_languages'] = set() songlist = [] - for songdir in config['songdir']: + for songdir in config['_songdir']: if contentlist: break contentlist = [ @@ -47,12 +47,12 @@ def parse(keyword, argument, contentlist, config): ] for elem in contentlist: before = len(songlist) - for songdir in config['songdir']: + for songdir in config['_songdir']: for filename in glob.iglob(os.path.join(songdir, elem)): LOGGER.debug('Parsing file "{}"…'.format(filename)) song = SongRenderer(filename, config) songlist.append(song) - config["languages"].update(song.languages) + config["_languages"].update(song.languages) if len(songlist) > before: break if len(songlist) == before: diff --git a/songbook_core/data/templates/songs.tex b/songbook_core/data/templates/songs.tex index f81db077..7e51e0bb 100644 --- a/songbook_core/data/templates/songs.tex +++ b/songbook_core/data/templates/songs.tex @@ -70,7 +70,7 @@ (* block songbookpreambule *) (( super() )) - (* for lang in languages *) + (* for lang in _languages *) \PassOptionsToPackage{((lang))}{babel} (* endfor *) \usepackage[((lang))]{babel}