Mercurial > dotfiles
view unixSoft/bin/epylint @ 491:4b2472372fad
mcfly: move binding to ^T instead of ^R
I've found some bugs in mcfly's handling of multi-line history
entries. I still think it's a useful tool, just maybe less than I was
hoping for now...
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Wed, 01 Jul 2020 13:33:46 -0400 |
parents | 7f67cf332537 |
children |
line wrap: on
line source
#!/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()