|
@ -22,26 +22,26 @@ class LaTeX(ContentItem): |
|
|
))) |
|
|
))) |
|
|
|
|
|
|
|
|
#pylint: disable=unused-argument |
|
|
#pylint: disable=unused-argument |
|
|
def parse(keyword, argument, contentlist, config): |
|
|
def parse(keyword, argument, config): |
|
|
"""Parse the contentlist. |
|
|
"""Parse the tex files. |
|
|
|
|
|
|
|
|
Arguments: |
|
|
Arguments: |
|
|
- keyword: unused; |
|
|
- keyword: unused; |
|
|
- argument: unused; |
|
|
- argument: |
|
|
- contentlist: a list of name of tex files; |
|
|
a list of tex files to include |
|
|
|
|
|
or a string of the tex file to include; |
|
|
- config: configuration dictionary of the current songbook. |
|
|
- config: configuration dictionary of the current songbook. |
|
|
""" |
|
|
""" |
|
|
if not contentlist: |
|
|
if isinstance(argument, str): |
|
|
LOGGER.warning( |
|
|
argument = [argument] |
|
|
"Useless 'tex' content: list of files to include is empty." |
|
|
|
|
|
) |
|
|
|
|
|
filelist = ContentList() |
|
|
filelist = ContentList() |
|
|
basefolders = itertools.chain( |
|
|
basefolders = itertools.chain( |
|
|
(path.fullpath for path in config['_songdir']), |
|
|
(path.fullpath for path in config['_songdir']), |
|
|
files.iter_datadirs(config['_datadir']), |
|
|
files.iter_datadirs(config['_datadir']), |
|
|
files.iter_datadirs(config['_datadir'], 'latex'), |
|
|
files.iter_datadirs(config['_datadir'], 'latex'), |
|
|
) |
|
|
) |
|
|
for filename in contentlist: |
|
|
for filename in argument: |
|
|
checked_file = None |
|
|
checked_file = None |
|
|
for path in basefolders: |
|
|
for path in basefolders: |
|
|
if os.path.exists(os.path.join(path, filename)): |
|
|
if os.path.exists(os.path.join(path, filename)): |
|
|