Handle truncated files.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10140 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
José Matox 2005-07-06 17:40:38 +00:00
parent 38801aed7f
commit 178897b091
3 changed files with 13 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2005-07-06 José Matos <jamatos@lyx.org>
* LyX.py (warning): Prefix warnings with label "Warning: ".
* lyx_1_4.lyx (add_end_layout): Handle truncated files.
2005-07-06 José Matos <jamatos@lyx.org>
* lyx_1_4.lyx (convert_paperpackage): older tex2lyx generated files

View File

@ -118,7 +118,7 @@ class LyX_Base:
def warning(self, message, debug_level= default_debug_level):
" Emits warning to self.error, if the debug_level is less than the self.debug."
if debug_level <= self.debug:
self.err.write(message + "\n")
self.err.write("Warning: " + message + "\n")
def error(self, message):

View File

@ -304,7 +304,13 @@ def add_end_layout(file):
i = find_tokens(file.body, ["\\begin_inset", "\\end_inset", "\\layout",
"\\begin_deeper", "\\end_deeper", "\\the_end"], i)
if i != -1:
token = split(file.body[i])[0]
else:
file.warning("Truncated file.")
i = len(file.body)
file.body.insert(i, '\\the_end')
token = ""
if token == "\\begin_inset":
struct_stack.append(token)