* configure.py:

- when a layout file has no valid \Declare line, issue a warning and skip this file
	  instead of aborting the whole configuration process.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37807 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2011-02-28 16:15:03 +00:00
parent 306cb190c8
commit 594179f330

View File

@ -1068,17 +1068,21 @@ def checkLatexConfig(check_config, bool_docbook):
testclasses = list()
for file in glob.glob( os.path.join('layouts', '*.layout') ) + \
glob.glob( os.path.join(srcdir, 'layouts', '*.layout' ) ) :
nodeclaration = False
if not os.path.isfile(file):
continue
classname = file.split(os.sep)[-1].split('.')[0]
for line in open(file).readlines():
if not empty.match(line) and line[0] != '#':
logger.error("Failed to find \Declare line for layout file `" + file + "'")
sys.exit(3)
logger.warning("Failed to find valid \Declare line for layout file `" + file + "'.\n\t=> Skipping this file!")
nodeclaration = True
break
if declare.search(line) == None:
continue
testclasses.append("\\TestDocClass{%s}{%s}" % (classname, line[1:].strip()))
break
if nodeclaration:
continue
testclasses.sort()
cl = open('chklayouts.tex', 'w')
for line in testclasses: