Menu

#29 Integration with pychecker

open
nobody
pythonwin (20)
5
2005-01-26
2005-01-26
No

Hi --

It would be nice to include integration with PyChecker
(http://sourceforge.net/projects/pychecker) in the same
way there is TabNanny integration. A Google search
comes up with the cfg below to do it yourself by adding
a new pywin editor configuration (slightly modified below
to handle pathnames with spaces and to add messaging
to the status bar). It would be nice to ship this out-of-
the-box to encourage adoption. Barring that, maybe add
a pointer / reference to these instructions in the FAQ?

Thanks!

Ramon

[General]
# place this in <pythondir>\Lib\site-
packages\Pythonwin\pywin\ Based On = Default

[Keys:Editor]
Shift+Ctrl+v = checksource

[Extensions]
def checksource(editor_window, event):
import pywin.framework.scriptutils
import os
import re
import win32ui

filename =
pywin.framework.scriptutils.GetActiveFileName()
win32ui.SetStatusText("PyChecker is checking your
source..." , True)
messages = os.popen(r'<pythondir>\pychecker.bat "%
s"' % filename)
for message in messages.xreadlines():
print re.sub(r"(.*):(\d+):(.*)", r'File "\1", line \2,
\3', message.strip())
messages.close()
win32ui.SetStatusText("PyChecker is done checking
your source." , True)

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.