Commits

Anonymous committed 7f29d48 Merge

merge with upstream

Comments (0)

Files changed (2)

 
 Acknowledgment
 --------------
-The second author (Robert Marik) s supported by the grant 18/2006 of
+The second author (Robert Marik) s supported by the grant 131/2010 of
 the Fund for Development of Czech Universities (FRVS, project "Using
 open source software in teaching mathematics").
 
     def __init__(self, text, cell_id, options=None):
         Cell.__init__(self, text, cell_id, options)
+        self.language=""
         self.html2latex = Html2Latex(options)
 
     def latex(self):
         #    return "\n\n"
 
         output_list = self.parse_output()
+        
+        if not options.full_errors and re.match('(Traceback.*:)',output_list[0]) is not None:
+            temp_output = output_list[0].split("\n")
+            temp_output = [temp_output[0], '...', temp_output[-2]]
+            output_list = ["\n".join(temp_output)]
 
         verbatim = True
         latex_str = ""
 usage = r"""
 usage: %prog [options] input [output]
 
-You may want to set your defaulot LaTeX preamble, author, language and
+You may want to set your default LaTeX preamble, author, language and
 word_wrap in .sws2tex config file in current directory or in your home
 directory (see .sws2tex_example). Command line options override this
 settings.
                       action = "store", type = 'int', dest = "word_wrap", default = None,
                       help = "select method for word wrap: 0 (no wrapping), 1 (textwraper, default), 2 (fixed line length)")
 
+opt_parser.add_option("-e", "--full_errors",
+                      action = "store_true", dest = "full_errors", default = False,
+                      help = "do not shorten error messages")
+
 (options, args) = opt_parser.parse_args()
 
 if len(args) < 2: