changeset 93:7f67cf332537

Started using pylint.
author Augie Fackler <durin42@gmail.com>
date Wed, 22 Apr 2009 11:10:06 -0500
parents 2563edf11e59
children 9052c3801744
files .hgignore unixSoft/bin/epylint
diffstat 2 files changed, 30 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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
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()