annotate unixSoft/bin/epylint @ 266:93a8f55a4e30

xmonad: add takeTopFocus logHook This is required to make IntelliJ (and supposedly all other Swing applications) properly notice that they've recieved the focus. According to [0], the problem is that "xmonad does not follow ICCCM and ignores WM_TAKE_FOCUS protocol", but the patches on that ticket haven't yet been accepted, so the function was added to xmonad-contrib as a workaround until something happens in xmonad proper. [0]: http://code.google.com/p/xmonad/issues/detail?id=177
author Augie Fackler <durin42@gmail.com>
date Wed, 02 Nov 2011 09:53:57 -0500
parents 7f67cf332537
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
93
7f67cf332537 Started using pylint.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
1 #!/usr/bin/env python
7f67cf332537 Started using pylint.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
2 import re
7f67cf332537 Started using pylint.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
3 import sys
7f67cf332537 Started using pylint.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
4
7f67cf332537 Started using pylint.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
5 from subprocess import Popen, PIPE
7f67cf332537 Started using pylint.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
6
7f67cf332537 Started using pylint.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
7 p = Popen("pylint -f parseable -r n --disable-msg-cat=C,R %s" %
7f67cf332537 Started using pylint.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
8 sys.argv[1], shell = True, stdout = PIPE).stdout
7f67cf332537 Started using pylint.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
9
7f67cf332537 Started using pylint.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
10 for line in p.readlines():
7f67cf332537 Started using pylint.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
11 match = re.search("\\[([WE])(, (.+?))?\\]", line)
7f67cf332537 Started using pylint.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
12 if match:
7f67cf332537 Started using pylint.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
13 kind = match.group(1)
7f67cf332537 Started using pylint.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
14 func = match.group(3)
7f67cf332537 Started using pylint.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
15 if kind == "W":
7f67cf332537 Started using pylint.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
16 msg = "Warning"
7f67cf332537 Started using pylint.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
17 else:
7f67cf332537 Started using pylint.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
18 msg = "Error"
7f67cf332537 Started using pylint.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
19
7f67cf332537 Started using pylint.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
20 if func:
7f67cf332537 Started using pylint.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
21 line = re.sub("\\[([WE])(, (.+?))?\\]",
7f67cf332537 Started using pylint.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
22 "%s (%s):" % (msg, func), line)
7f67cf332537 Started using pylint.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
23 else:
7f67cf332537 Started using pylint.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
24 line = re.sub("\\[([WE])?\\]", "%s:" % msg, line)
7f67cf332537 Started using pylint.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
25 print line,
7f67cf332537 Started using pylint.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
26
7f67cf332537 Started using pylint.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
27 p.close()