@@ -139,8 +139,9 @@ def readErrorCodes( callback, replaceZero = False ):
139
139
# re.compile( "((DB|User|Msg|MsgAssertion)Exceptio(n))\(( *)(\d+)" ),
140
140
# re.compile( "((fassertFailed)()) *\(( *)(\d+)" )
141
141
# ]
142
- ps = [ re .compile ( "(([wum]asser(t|ted))) *\(( *)(\d+) *,? *(\S+.+\S) *,?" ) ,
143
- re .compile ( "((msgasser(t|ted))) *\(( *)(\d+) *,? *(\S+.+\S) *,?" ) ,
142
+ ps = [ re .compile ( "(([wum]asser(t|ted))) *\(( *)(\d+) *,\s*(\" \S[^\" ]+\S\" )\s*,?.*" ) ,
143
+ re .compile ( "(([wum]asser(t|ted))) *\(( *)(\d+) *,\s*([\S\s+<\(\)\" ]+) *,?.*" ) ,
144
+ re .compile ( '((msgasser(t|ted))) *\(( *)(\d+) *, *(\" \S[^,^\" ]+\S\" ) *,?' ) ,
144
145
re .compile ( "((fasser(t|ted))) *\(( *)(\d+)()" ) ,
145
146
re .compile ( "((DB|User|Msg|MsgAssertion)Exceptio(n))\(( *)(\d+) *,? *(\S+.+\S) *,?" ),
146
147
re .compile ( "((fassertFailed)()) *\(( *)(\d+)()" )
@@ -155,6 +156,8 @@ def readErrorCodes( callback, replaceZero = False ):
155
156
lastCodes = [0 ]
156
157
lineNum = 1
157
158
159
+ stripChars = " " + "\n "
160
+
158
161
for line in open ( x ):
159
162
160
163
found = False
@@ -191,7 +194,7 @@ def repl( m ):
191
194
#
192
195
# else :
193
196
codes .append ( ( x , lineNum , line , code , message , severity ) )
194
- print ("x(" + x + ") lineNum(" + str (lineNum ) + ") line(" + line + ") spaces(" + spaces + ") code(" + code + ")" )
197
+ print ("x(" + x + ") lineNum(" + str (lineNum ) + ") line(" + line . strip ( stripChars ) + ") spaces(" + spaces + ") code(" + code + ")" )
195
198
callback ( x , lineNum , line , code )
196
199
197
200
return start + "(" + spaces + code
@@ -265,8 +268,10 @@ def genErrorOutput():
265
268
seen = {}
266
269
267
270
sourcerootOffset = len (sourceroot )
271
+ stripChars = " " + "\n "
268
272
269
- codes .sort ( key = lambda x : x [0 ]+ "-" + x [3 ] )
273
+ # codes.sort( key=lambda x: x[0]+"-"+x[3] )
274
+ codes .sort ( key = lambda x : x [3 ]+ "-" + x [0 ] )
270
275
for f ,l ,line ,num ,message ,severity in codes :
271
276
if num in seen :
272
277
continue
@@ -278,24 +283,16 @@ def genErrorOutput():
278
283
279
284
fn = f .rpartition ("/" )[2 ]
280
285
281
- # if f != prev:
282
- # out.write( "\n\n" )
283
- # out.write( f + "\n----\n" )
284
- # prev = f
285
-
286
286
url = ":source:`" + f + "#L" + str (l ) + "`"
287
-
288
- # out.write("\n.. error:: {}\n\n Text: {}\n\n".format(num,getBestMessage( line , str(num))))
289
- # out.write(" Module: {}\n\n".format(f))
290
- # out.write(" :module: `{}:{} <{}>`_\n".format(fn,l,url))
291
- # out.write(" .. seealso:: `{}:{} <{}>`_\n".format(f,l, url))
292
- # out.write( "* " + str(num) + " [code](" + url + ") " + getBestMessage( line , str(num) ) + "\n" )
293
287
288
+
289
+ out .write (".. line: {}\n \n " .format (line .strip (stripChars )))
290
+
294
291
out .write (".. error:: {}\n \n " .format (num ))
295
292
if message :
296
- out .write (" :message: {}\n " .format (message ))
293
+ out .write (" :message: {}\n " .format (message . strip ( stripChars ) ))
297
294
else :
298
- out .write (" :message: {}\n " .format (getBestMessage ( line , str (num ))))
295
+ out .write (" :message: {}\n " .format (getBestMessage ( line , str (num )). strip ( stripChars ) ))
299
296
if severity :
300
297
if severity in severityTexts :
301
298
out .write (" :severity: {}\n " .format (severityTexts [severity ]))
@@ -320,6 +317,9 @@ def genErrorOutputCSV():
320
317
prev = ""
321
318
seen = {}
322
319
320
+ stripChars = " " + "\n "
321
+
322
+
323
323
codes .sort ( key = lambda x : x [0 ]+ "-" + x [3 ] )
324
324
for f ,l ,line ,num ,message ,severity in codes :
325
325
if num in seen :
@@ -330,7 +330,7 @@ def genErrorOutputCSV():
330
330
f = f [2 :]
331
331
fn = f .rpartition ("/" )[2 ]
332
332
333
- out .write ('"{}","{}","{}","{}","{}","{}"' .format (num , getBestMessage (line , str (num )),f ,l ,message ,severity ))
333
+ out .write ('"{}","{}","{}","{}","{}","{}"' .format (num , getBestMessage (line , str (num )). strip ( stripChars ) ,f ,l ,message ,severity ))
334
334
335
335
out .write ("\n " )
336
336
0 commit comments