Commits

Robert Mařík  committed fa1f484

New option allows to shorten error messages into three lines, like in the Sage notebook (default is on).

  • Participants
  • Parent commits cdeed59

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").
         #    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 = ""
                       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: