mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-25 22:06:15 +00:00
* layout2layout.py : Don't choke on empty input file.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39665 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
82edf5907a
commit
454598b928
@ -152,7 +152,7 @@ def trim_bom(line):
|
|||||||
|
|
||||||
def read(source):
|
def read(source):
|
||||||
" Read input file and strip lineendings."
|
" Read input file and strip lineendings."
|
||||||
lines = source.read().splitlines()
|
lines = source.read().splitlines() or ['']
|
||||||
lines[0] = trim_bom(lines[0])
|
lines[0] = trim_bom(lines[0])
|
||||||
return lines
|
return lines
|
||||||
|
|
||||||
@ -753,6 +753,8 @@ def convert(lines):
|
|||||||
|
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
|
if only_comment:
|
||||||
|
lines.insert(i, "Format 2")
|
||||||
if usemodules:
|
if usemodules:
|
||||||
i = formatline + 1
|
i = formatline + 1
|
||||||
for mod in usemodules:
|
for mod in usemodules:
|
||||||
|
Loading…
Reference in New Issue
Block a user