Sfoglia il codice sorgente

Abort requirement document creation on error

master
Dirk Alders 3 anni fa
parent
commit
ed0d9da243
2 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  1. 2
    1
      __init__.py
  2. 2
    0
      reqif_conv.py

+ 2
- 1
__init__.py Vedi File

@@ -1,5 +1,6 @@
1 1
 import optparse
2 2
 import os
3
+import sys
3 4
 
4 5
 import xml_parser
5 6
 import reqif_conv
@@ -83,4 +84,4 @@ if __name__ == '__main__':
83 84
         tex_path = os.path.abspath(os.path.splitext(reqif_path)[0] + '.tex')
84 85
         reqif_data = reqif_dict(reqif_path, 'Heading', 'Software Specification')
85 86
         reqif_conv.tex_gen(reqif_data, tex_path)
86
-        reqif_conv.pdf_gen(tex_path)
87
+        sys.exit(reqif_conv.pdf_gen(tex_path))

+ 2
- 0
reqif_conv.py Vedi File

@@ -30,6 +30,8 @@ def pdf_gen(tex_path):
30 30
         exit_value = os.system("pdflatex -interaction nonstopmode %s 1> /dev/null" % tex_path)
31 31
         if exit_value != 0:
32 32
             print('FAILED')
33
+            return -1
33 34
             break
34 35
         else:
35 36
             print('SUCCESS')
37
+    return 0

Loading…
Annulla
Salva