I've managed to do the basics, but it just dumps into the 'Unix Script
Output' window. It's usable, but not great. I haven't made the time to look
into AppleScript, but imagine that that's where I'll have to turn next. Can
I create and populate the 'Find Results' window via AppleScript? That's what
I really want. I basically want what the current 'Check Syntax' command does
for Python, but with the couple of minor additions that PyFlakes adds
(which, for me, is basically 'unused import', 'unknown name' reports).
Unless I can get the results to show up in a tooltip, I wouldn't want this
running on every save - sometimes there are small issues that PyFlakes
reports which need to be left in a source file for legacy reasons. But I
would want to be able to save the current document before running the
checker.
For anyone interested, here's my script as it stands right now. It's really
basic.
#!/usr/bin/env python
import os
import sys
from subprocess import Popen, PIPE
doc_file = os.environ['BB_DOC_PATH']
pyflakes = "/usr/local/bin/pyflakes"
out, err = Popen([pyflakes, doc_file], stdout=PIPE,
stderr=PIPE).communicate()
if out:
output = ''.join(out)
else:
output = ''.join(err)
output = output.replace('%s:' % doc_file, '')
sys.stderr.write(output)
--
You received this message because you are subscribed to the
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem,
please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>