Browse Source

tex is now in yaml

pull/190/head
Oliverpool 9 years ago
parent
commit
566b2ee019
  1. 18
      patacrep/content/tex.py
  2. 2
      test/test_content/tex.control
  3. 5
      test/test_content/tex.source
  4. 2
      test/test_songbook/content.sb

18
patacrep/content/tex.py

@ -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)):

2
test/test_content/tex.control

@ -1 +1 @@
["test/test_content/datadir/songs/texfile.tex"] ["test/test_content/datadir/songs/texfile.tex", "test/test_content/datadir/songs/texfile.tex"]

5
test/test_content/tex.source

@ -1 +1,4 @@
[["tex", "texfile.tex", "chordpro.csg"]] - tex:
- texfile.tex
- chordpro.csg
- tex: texfile.tex

2
test/test_songbook/content.sb

@ -15,5 +15,5 @@ content:
content: content:
- "song.csg" - "song.csg"
- "song.tsg" - "song.tsg"
- ["tex", "foo.tex"] - tex: foo.tex
- include: include.sbc - include: include.sbc
Loading…
Cancel
Save