Browse Source

Replace list of lists of iterators by `itertools.chain`

pull/175/head
Louis 9 years ago
parent
commit
48fae04d85
  1. 9
      patacrep/content/tex.py

9
patacrep/content/tex.py

@ -1,5 +1,6 @@
"""Include LaTeX raw code in the songbook.""" """Include LaTeX raw code in the songbook."""
import itertools
import logging import logging
import os import os
@ -35,9 +36,11 @@ def parse(keyword, argument, contentlist, config):
"Useless 'tex' content: list of files to include is empty." "Useless 'tex' content: list of files to include is empty."
) )
filelist = [] filelist = []
basefolders = [path.fullpath for path in config['_songdir']] +\ basefolders = itertools.chain(
list(files.iter_datadirs(config['datadir'])) + \ [path.fullpath for path in config['_songdir']],
list(files.iter_datadirs(config['datadir'], 'latex')) files.iter_datadirs(config['datadir']),
files.iter_datadirs(config['datadir'], 'latex'),
)
for filename in contentlist: for filename in contentlist:
checked_file = None checked_file = None
for path in basefolders: for path in basefolders:

Loading…
Cancel
Save