mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-24 21:55:29 +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>
|
||||
|
||||
* LyX.py (LyX_Base):
|
||||
|
@ -112,6 +112,7 @@ class LyX_Base:
|
||||
self.textclass = "article"
|
||||
self.header = []
|
||||
self.body = []
|
||||
self.status = 0
|
||||
|
||||
|
||||
def warning(self, message, debug_level= default_debug_level):
|
||||
@ -121,10 +122,13 @@ class LyX_Base:
|
||||
|
||||
|
||||
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("Quiting.")
|
||||
sys.exit(1)
|
||||
if not self.try_hard:
|
||||
self.warning("Quiting.")
|
||||
sys.exit(1)
|
||||
|
||||
self.status = 2
|
||||
|
||||
|
||||
def read(self):
|
||||
@ -290,6 +294,7 @@ class LyX_Base:
|
||||
default_debug_level)
|
||||
if not self.try_hard:
|
||||
raise
|
||||
self.status = 2
|
||||
else:
|
||||
self.warning("%lf: Elapsed time on %s" % (time.time() - init_t, str(conv)),
|
||||
default_debug_level + 1)
|
||||
|
@ -84,5 +84,8 @@ def main(argv):
|
||||
file.convert()
|
||||
file.write()
|
||||
|
||||
return file.status
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main(sys.argv)
|
||||
sys.exit(main(sys.argv))
|
||||
|
Loading…
Reference in New Issue
Block a user