|
|
@ -25,20 +25,16 @@ def parse(keyword, config, argument): |
|
|
|
This function adds 'path' to the directories where songs are searched |
|
|
|
for, and then processes the content. |
|
|
|
|
|
|
|
The 'path' is added: |
|
|
|
- first as a relative path to the *.yaml file directory; |
|
|
|
- then as a relative path to every path already present in |
|
|
|
config['songdir'] (which are 'song' dir inside the datadirs). |
|
|
|
The 'path' is added as a relative path to every path already present in |
|
|
|
config['songdir'] (which are 'songs' dir inside the datadirs). |
|
|
|
""" |
|
|
|
subpath = argument['path'] |
|
|
|
old_songdir = config['_songdir'] |
|
|
|
|
|
|
|
config['_songdir'] = [path.clone().join(subpath) for path in config['_songdir']] |
|
|
|
if '_songbookfile_dir' in config: |
|
|
|
config['_songdir'].insert(0, DataSubpath(config['_songbookfile_dir'], subpath)) |
|
|
|
|
|
|
|
processed_content = process_content(argument.get('content'), config) |
|
|
|
config['_songdir'] = old_songdir |
|
|
|
return processed_content |
|
|
|
|
|
|
|
CONTENT_PLUGINS = {'cwd': parse} |
|
|
|
CONTENT_PLUGINS = {'cd': parse} |