mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-25 22:06:15 +00:00
Implement return codes consistently.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10132 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
9b4136de38
commit
fb1e227a93
@ -1,3 +1,13 @@
|
|||||||
|
2005-07-05 José Matos <jamatos@lyx.org>
|
||||||
|
|
||||||
|
* LyX.py (LyX_Base):
|
||||||
|
* LyX.py (error):
|
||||||
|
* LyX.py (convert):
|
||||||
|
* lyx2lyx: Implement return codes consistently:
|
||||||
|
0 - OK.
|
||||||
|
1 - Irrecoverable error.
|
||||||
|
2 - Recovered from error(s).
|
||||||
|
|
||||||
2005-07-05 José Matos <jamatos@lyx.org>
|
2005-07-05 José Matos <jamatos@lyx.org>
|
||||||
|
|
||||||
* LyX.py (LyX_Base):
|
* LyX.py (LyX_Base):
|
||||||
|
@ -112,6 +112,7 @@ class LyX_Base:
|
|||||||
self.textclass = "article"
|
self.textclass = "article"
|
||||||
self.header = []
|
self.header = []
|
||||||
self.body = []
|
self.body = []
|
||||||
|
self.status = 0
|
||||||
|
|
||||||
|
|
||||||
def warning(self, message, debug_level= default_debug_level):
|
def warning(self, message, debug_level= default_debug_level):
|
||||||
@ -121,11 +122,14 @@ class LyX_Base:
|
|||||||
|
|
||||||
|
|
||||||
def error(self, message):
|
def error(self, message):
|
||||||
" Emits a warning and exist incondicionally."
|
" Emits a warning and exits if not in try_hard mode."
|
||||||
self.warning(message)
|
self.warning(message)
|
||||||
|
if not self.try_hard:
|
||||||
self.warning("Quiting.")
|
self.warning("Quiting.")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
self.status = 2
|
||||||
|
|
||||||
|
|
||||||
def read(self):
|
def read(self):
|
||||||
"""Reads a file into the self.header and self.body parts, from self.input."""
|
"""Reads a file into the self.header and self.body parts, from self.input."""
|
||||||
@ -290,6 +294,7 @@ class LyX_Base:
|
|||||||
default_debug_level)
|
default_debug_level)
|
||||||
if not self.try_hard:
|
if not self.try_hard:
|
||||||
raise
|
raise
|
||||||
|
self.status = 2
|
||||||
else:
|
else:
|
||||||
self.warning("%lf: Elapsed time on %s" % (time.time() - init_t, str(conv)),
|
self.warning("%lf: Elapsed time on %s" % (time.time() - init_t, str(conv)),
|
||||||
default_debug_level + 1)
|
default_debug_level + 1)
|
||||||
|
@ -84,5 +84,8 @@ def main(argv):
|
|||||||
file.convert()
|
file.convert()
|
||||||
file.write()
|
file.write()
|
||||||
|
|
||||||
|
return file.status
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main(sys.argv)
|
sys.exit(main(sys.argv))
|
||||||
|
Loading…
Reference in New Issue
Block a user