From 48fae04d85cd53ada135c3dec68df0b463a4a0b0 Mon Sep 17 00:00:00 2001 From: Louis Date: Tue, 10 Nov 2015 11:53:50 +0100 Subject: [PATCH] Replace list of lists of iterators by `itertools.chain` --- patacrep/content/tex.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/patacrep/content/tex.py b/patacrep/content/tex.py index 5c9f7425..c115ed9e 100755 --- a/patacrep/content/tex.py +++ b/patacrep/content/tex.py @@ -1,5 +1,6 @@ """Include LaTeX raw code in the songbook.""" +import itertools import logging import os @@ -35,9 +36,11 @@ def parse(keyword, argument, contentlist, config): "Useless 'tex' content: list of files to include is empty." ) filelist = [] - basefolders = [path.fullpath for path in config['_songdir']] +\ - list(files.iter_datadirs(config['datadir'])) + \ - list(files.iter_datadirs(config['datadir'], 'latex')) + basefolders = itertools.chain( + [path.fullpath for path in config['_songdir']], + files.iter_datadirs(config['datadir']), + files.iter_datadirs(config['datadir'], 'latex'), + ) for filename in contentlist: checked_file = None for path in basefolders: