author | mickeyl <mickeyl> | 2004-04-26 12:25:42 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-26 12:25:42 (UTC) |
commit | a26e4da56923553a2f9e4da4db3b92bdb75479c8 (patch) (side-by-side diff) | |
tree | e936f193364176109edc0ae4cc05678a2549ca78 | |
parent | caf74b437544a95410bbd030045e15e4dcaa91f0 (diff) | |
download | opie-a26e4da56923553a2f9e4da4db3b92bdb75479c8.zip opie-a26e4da56923553a2f9e4da4db3b92bdb75479c8.tar.gz opie-a26e4da56923553a2f9e4da4db3b92bdb75479c8.tar.bz2 |
update
-rwxr-xr-x | scripts/qdebug-odebug.py | 21 |
1 files changed, 13 insertions, 8 deletions
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 @@ -11,7 +11,7 @@ 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<head>.*)(?P<statement>qDebug)\(\s*(?P<content>.*)\s*\);(?P<tail>.*)' ) +qWarningExpression = sre.compile( '(?P<head>.*)(?P<statement>qWarning)\(\s*(?P<content>.*)\s*\);(?P<tail>.*)' ) +qErrorExpression = sre.compile( '(?P<head>.*)(?P<statement>qError)\(\s*(?P<content>.*)\s*\);(?P<tail>.*)' ) +qFatalExpression = sre.compile( '(?P<head>.*)(?P<statement>qFatal)\(\s*(?P<content>.*)\s*\);(?P<tail>.*)' ) +#printfExpression = sre.compile( '(?P<head>.*)(?![s\.])(?P<statement>printf)\(\s*(?P<content>.*)\s*\);(?P<tail>.*)' ) @@ -23,3 +23,3 @@ debugTable = { "qDebug" : "odebug", -allExpressions = ( qDebugExpression, qWarningExpression, qErrorExpression, qFatalExpression, printfExpression ) +allExpressions = ( qDebugExpression, qWarningExpression, qErrorExpression, qFatalExpression ) #, printfExpression ) @@ -38,3 +38,8 @@ def convert( fname ): 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, "<NOTE>: Groups = ", m.groups() @@ -97,3 +102,3 @@ def transform( s ): i += 1 - while i < len( formatstring ) and formatstring[i] not in "%dDiouxXfegEscpn": + while i < len( formatstring ) and formatstring[i] not in "%dDiouxXfFegEscpn": i += 1 |