# HG changeset patch # User Augie Fackler # Date 1240416606 18000 # Node ID 7f67cf3325374f501a994617fc516b616e5976ac # Parent 2563edf11e59950f13e20a49ec5d520dd10e9e5f Started using pylint. diff --git a/.hgignore b/.hgignore --- a/.hgignore +++ b/.hgignore @@ -35,7 +35,10 @@ hgwebdir.conf .macports .post-review-cookies.txt .profile +.private +.python/python_history .python-eggs +.pylint.d .reviewboardrc .ropeproject .rnd @@ -66,5 +69,3 @@ Public Sites durin42_html public_html -.private -.python/python_history diff --git a/unixSoft/bin/epylint b/unixSoft/bin/epylint new file mode 100644 --- /dev/null +++ b/unixSoft/bin/epylint @@ -0,0 +1,27 @@ +#!/usr/bin/env python +import re +import sys + +from subprocess import Popen, PIPE + +p = Popen("pylint -f parseable -r n --disable-msg-cat=C,R %s" % + sys.argv[1], shell = True, stdout = PIPE).stdout + +for line in p.readlines(): + match = re.search("\\[([WE])(, (.+?))?\\]", line) + if match: + kind = match.group(1) + func = match.group(3) + if kind == "W": + msg = "Warning" + else: + msg = "Error" + + if func: + line = re.sub("\\[([WE])(, (.+?))?\\]", + "%s (%s):" % (msg, func), line) + else: + line = re.sub("\\[([WE])?\\]", "%s:" % msg, line) + print line, + + p.close()