[Eric] Eric4 path for work with pylint in win32
Tonal
tonal at promsoft.ru
Wed Feb 7 05:28:09 GMT 2007
I create path for correct work latest snapshot with PyLint in Win32.
My environment:
OS WinXp Home Rus + sp2
Python 2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)]
pylint.bat 0.12.1,
astng 0.16.1, common 0.19.2
eric4-snapshot-20070204
-------------- next part --------------
diff U3 __init__.py __init__.py
--- __init__.py Sun Dec 31 18:37:19 2006
+++ __init__.py Tue Feb 06 17:06:37 2007
@@ -7,7 +7,7 @@
Package implementing the interface to the PyLint source code checker.
"""
-import os
+import os, os.path
import sys
import copy
@@ -85,7 +85,10 @@
exe = 'pylint'
if sys.platform == "win32":
exe += '.bat'
- self.pylintAct.setEnabled(Utilities.isinpath(exe))
+ lint = os.path.join(sys.exec_prefix, "Scripts", exe)
+
+ self.pylintAct.setEnabled(
+ Utilities.isinpath(lint) or Utilities.isinpath(exe))
def getActions(self):
"""
diff U3 PyLintConfigDialog.py PyLintConfigDialog.py
--- PyLintConfigDialog.py Thu Feb 01 17:36:16 2007
+++ PyLintConfigDialog.py Tue Feb 06 22:20:45 2007
@@ -123,24 +123,26 @@
args = QStringList()
# 1. the program name
- if sys.platform == "win32":
- args.append(sys.executable)
+ #if sys.platform == "win32":
+ # args.append(sys.executable)
args.append(self.lint)
# 2. the commandline options
# 2.1 general options
if self.parameters['configFile'] != self.defaults['configFile']:
parms['configFile'] = self.parameters['configFile']
-## args.append('--rcfile=%s' % self.parameters['configFile'])
- args.append('--rcfile')
- args.append(self.parameters['configFile'])
+ args.append('--rcfile=%s' % self.parameters['configFile'])
+ #args.append('--rcfile')
+ #args.append(self.parameters['configFile'])
parms['txtReport'] = self.parameters['txtReport']
parms['htmlReport'] = self.parameters['htmlReport']
parms['dialogReport'] = self.parameters['dialogReport']
if self.parameters['htmlReport']:
- args.append('--html=y')
+ #args.append('--html=y')
+ args.append('--output-format=html')
elif self.parameters['dialogReport']:
- args.append('--parseable=y')
+ #args.append('--parseable=y')
+ args.append('--output-format=parseable')
args.append('--report=n')
if self.parameters['reportFile'] != self.defaults['reportFile']:
parms['reportFile'] = self.parameters['reportFile']
@@ -157,27 +159,37 @@
parms['enableSimilarities'] = self.parameters['enableSimilarities']
parms['enableVariables'] = self.parameters['enableVariables']
- args.append('--disable-all')
+ #args.append('--disable-all')
if self.parameters['enableBasic']:
- args.append('--enable-basic=y')
+ #args.append('--enable-basic=y')
+ args.append('--enable-checker=basic')
if self.parameters['enableClasses']:
- args.append('--enable-classes=y')
+ #args.append('--enable-classes=y')
+ args.append('--enable-checker=classes')
if self.parameters['enableDesign']:
- args.append('--enable-design=y')
+ #args.append('--enable-design=y')
+ args.append('--enable-checker=design')
if self.parameters['enableExceptions']:
- args.append('--enable-exceptions=y')
+ #args.append('--enable-exceptions=y')
+ args.append('--enable-checker=exceptions')
if self.parameters['enableFormat']:
- args.append('--enable-format=y')
+ #args.append('--enable-format=y')
+ args.append('--enable-checker=format')
if self.parameters['enableImports']:
- args.append('--enable-imports=y')
+ #args.append('--enable-imports=y')
+ args.append('--enable-checker=imports')
if self.parameters['enableMetrics']:
- args.append('--enable-metrics=y')
+ #args.append('--enable-metrics=y')
+ args.append('--enable-checker=metrics')
if self.parameters['enableMiscellaneous']:
- args.append('--enable-miscellaneous=y')
+ #args.append('--enable-miscellaneous=y')
+ args.append('--enable-checker=miscellaneous')
if self.parameters['enableSimilarities']:
- args.append('--enable-similarities=y')
+ #args.append('--enable-similarities=y')
+ args.append('--enable-checker=similarities')
if self.parameters['enableVariables']:
- args.append('--enable-variables=y')
+ #args.append('--enable-variables=y')
+ args.append('--enable-checker=variables')
return (args, parms)
diff U3 PyLintExecDialog.py PyLintExecDialog.py
--- PyLintExecDialog.py Sat Feb 03 18:44:06 2007
+++ PyLintExecDialog.py Wed Feb 07 00:27:00 2007
@@ -93,7 +93,8 @@
self.connect(self.process, SIGNAL('finished(int, QProcess::ExitStatus)'),
self.__finish)
- if args.contains("--parseable=y"):
+# if args.contains("--parseable=y"):
+ if args.contains("--output-format=parseable"):
self.reportFile = None
self.contents.hide()
self.connect(self.process, SIGNAL('readyReadStandardOutput()'),
@@ -104,7 +105,8 @@
self.connect(self.process, SIGNAL('readyReadStandardOutput()'),
self.__readStdout)
self.messageList.hide()
- if args.contains("--html=y"):
+# if args.contains("--html=y"):
+ if args.contains("--output-format=html"):
self.contents.setAcceptRichText(True)
self.contents.setHtml('<b>Processing your request...</b>')
self.htmlOutput = True
@@ -117,7 +119,7 @@
self.noResults = True
self.buf = QString("")
-
+
self.process.start(program, args)
procStarted = self.process.waitForStarted()
if not procStarted:
@@ -267,8 +269,12 @@
if self.noResults:
return
- fn = Utilities.normabspath(unicode(itm.text(0)))
+ dname = os.path.dirname(self.filename)
+ fn = Utilities.normabspath(u'%s/%s' % (dname, unicode(itm.text(0))))
lineno = int(str(itm.text(1)))
+
+ #self.errors.insertPlainText('%s: %d' %(fn, lineno))
+ #self.errors.ensureCursorVisible()
e4App().getObject("ViewManager").openSourceFile(fn, lineno)
More information about the Eric
mailing list