Browse Source

More search path for tex plugin

pull/58/head
Luthaf 11 years ago
parent
commit
7e6fd4ef06
  1. 11
      patacrep/content/tex.py

11
patacrep/content/tex.py

@ -38,19 +38,22 @@ 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']] +\
config['datadir'] + \
[ os.path.join(path, "latex") for path in config['datadir']]
for filename in contentlist: for filename in contentlist:
checked_file = None checked_file = None
for path in config['_songdir']: for path in basefolders:
if os.path.exists(os.path.join(path.fullpath, filename)): if os.path.exists(os.path.join(path, filename)):
checked_file = os.path.relpath(os.path.join( checked_file = os.path.relpath(os.path.join(
path.fullpath, path,
filename, filename,
)) ))
break break
if not checked_file: if not checked_file:
LOGGER.warning( LOGGER.warning(
("Cannot find file '{}' in '{}'. Compilation may fail " ("Cannot find file '{}' in '{}'. Compilation may fail "
"later.").format(filename, [str(i) for i in config['_songdir']]) "later.").format(filename, [str(i) for i in basefolders])
) )
continue continue
filelist.append(LaTeX(checked_file)) filelist.append(LaTeX(checked_file))

Loading…
Cancel
Save