From a26e4da56923553a2f9e4da4db3b92bdb75479c8 Mon Sep 17 00:00:00 2001 From: mickeyl Date: Mon, 26 Apr 2004 12:25:42 +0000 Subject: update --- (limited to 'scripts') diff --git a/scripts/qdebug-odebug.py b/scripts/qdebug-odebug.py index 636c1b2..7a417e1 100755 --- a/scripts/qdebug-odebug.py +++ b/scripts/qdebug-odebug.py @@ -9,11 +9,11 @@ manual work may be needed after applying the script. import sys, sre -qDebugExpression = sre.compile( '(.*)(qDebug)\(\s*(.*)\s*\);(.*)' ) -qWarningExpression = sre.compile( '(.*)(qWarning)\(\s*(.*)\s*\);(.*)' ) -qErrorExpression = sre.compile( '(.*)(qError)\(\s*(.*)\s*\);(.*)' ) -qFatalExpression = sre.compile( '(.*)(qFatal)\(\s*(.*)\s*\);(.*)' ) -printfExpression = sre.compile( '(.*)(printf)\(\s*(.*)\s*\);(.*)' ) +qDebugExpression = sre.compile( '(?P.*)(?PqDebug)\(\s*(?P.*)\s*\);(?P.*)' ) +qWarningExpression = sre.compile( '(?P.*)(?PqWarning)\(\s*(?P.*)\s*\);(?P.*)' ) +qErrorExpression = sre.compile( '(?P.*)(?PqError)\(\s*(?P.*)\s*\);(?P.*)' ) +qFatalExpression = sre.compile( '(?P.*)(?PqFatal)\(\s*(?P.*)\s*\);(?P.*)' ) +#printfExpression = sre.compile( '(?P.*)(?![s\.])(?Pprintf)\(\s*(?P.*)\s*\);(?P.*)' ) debugTable = { "qDebug" : "odebug", "qWarning" : "owarn", @@ -21,7 +21,7 @@ debugTable = { "qDebug" : "odebug", "qFatal" : "ofatal", "printf" : "odebug" } -allExpressions = ( qDebugExpression, qWarningExpression, qErrorExpression, qFatalExpression, printfExpression ) +allExpressions = ( qDebugExpression, qWarningExpression, qErrorExpression, qFatalExpression ) #, printfExpression ) #################################################################################################### @@ -36,7 +36,12 @@ def convert( fname ): continue else: match = True - head, debug, content, tail = m.groups() + + head = m.groupdict()["head"] + debug = m.groupdict()["statement"] + content = m.groupdict()["content"] + tail = m.groupdict()["tail"] + print >>sys.stderr, ": Groups = ", m.groups() sys.stdout.write( head ) # don't strip() here, because we want to keep indentation sys.stdout.write( debugTable[debug.strip()] ) @@ -95,7 +100,7 @@ def transform( s ): else: # % in formatstring indirective = True i += 1 - while i < len( formatstring ) and formatstring[i] not in "%dDiouxXfegEscpn": + while i < len( formatstring ) and formatstring[i] not in "%dDiouxXfFegEscpn": i += 1 if formatstring[i] == "%": result += "%" -- cgit v0.9.0.2