X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=lib%2Fscripts%2Flisterrors;h=7d6995c5f51affada41b29dc1eac97ba8004f33c;hb=92c4bb46828941a36cb464bb2202607fe2abb934;hp=473f7ff003d95ae3a6267fe2380b5272e5b81a2a;hpb=5d94d1b3bf435b9a6d75f9e084d15b0d6da9b244;p=lyx.git diff --git a/lib/scripts/listerrors b/lib/scripts/listerrors index 473f7ff003..7d6995c5f5 100755 --- a/lib/scripts/listerrors +++ b/lib/scripts/listerrors @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/python3 # file listerrors # This file is part of LyX, the document processor. @@ -22,20 +22,21 @@ Bernard Michael Hurley modifications to original listerrors.""" __copyright__ = "Copyright 2002 - Kayvan A. Sylvan." +from __future__ import print_function import sys, string def write_error(msg, tool = "noweb", line_number = 1): """Write out the given message in TeX error style. called like: write_error(msg, tool, line_number).""" - print "! Build Error: ==> %s ==>\n" % (tool), - print " ...\n\nl.%d ...\n" % (line_number), + print ("! Build Error: ==> %s ==>" % tool) + print (" ...\n\nl.%d ..." % line_number) if type(msg) == type("str"): # simple string - print msg + print (msg) else: # some kind of list (sequence or tuple) for m in msg: - if m != "": print m, - print + if m != "": print (m, end=" ") + print () __lines = [] # lines pushed back @@ -62,12 +63,13 @@ def main(): Reads stdin and writes to stdout. Filter errors""" - while 1: + while True: line = getline() if line == "": break try_patterns_dispatch = [ noweb_try, gcc_try, xlc_try ] for predicate in try_patterns_dispatch: if predicate(line): break + def noweb_try(line): """see if line is a noweb error.