33 # Start-of-Header |
33 # Start-of-Header |
34 name = "PyLint Plugin" |
34 name = "PyLint Plugin" |
35 author = "Detlev Offenbach <detlev@die-offenbachs.de>" |
35 author = "Detlev Offenbach <detlev@die-offenbachs.de>" |
36 autoactivate = True |
36 autoactivate = True |
37 deactivateable = True |
37 deactivateable = True |
38 version = "6.1.11" |
38 version = "6.2.0" |
39 className = "PyLintPlugin" |
39 className = "PyLintPlugin" |
40 packageName = "PyLint" |
40 packageName = "PyLint" |
41 shortDescription = "Show the PyLint dialogs." |
41 shortDescription = "Show the PyLint dialogs." |
42 longDescription = """This plug-in implements the PyLint dialogs.""" \ |
42 longDescription = """This plug-in implements the PyLint dialogs.""" \ |
43 """ PyLint is used to check Python source files according to various""" \ |
43 """ PyLint is used to check Python source files according to various""" \ |
68 "exe": 'dummypylint', |
68 "exe": 'dummypylint', |
69 "versionCommand": '--version', |
69 "versionCommand": '--version', |
70 "versionStartsWith": 'dummypylint', |
70 "versionStartsWith": 'dummypylint', |
71 "versionPosition": -1, |
71 "versionPosition": -1, |
72 "version": "", |
72 "version": "", |
73 "versionCleanup": (0, -1), |
73 "versionCleanup": None, |
74 } |
74 } |
75 if _checkProgram(): |
75 if _checkProgram(): |
76 for exePath in (exePy2[0], exePy3[0]): |
76 for exePath in (exePy2[0], exePy3[0]): |
77 if exePath: |
77 if exePath: |
78 data["exe"] = exePath |
78 data["exe"] = exePath |
101 'replace') |
101 'replace') |
102 versionRe = re.compile('^pylint', re.UNICODE) |
102 versionRe = re.compile('^pylint', re.UNICODE) |
103 for line in output.splitlines(): |
103 for line in output.splitlines(): |
104 if versionRe.search(line): |
104 if versionRe.search(line): |
105 version = line.split()[-1] |
105 version = line.split()[-1] |
106 version = version[:-1] |
|
107 break |
106 break |
108 return version |
107 return version |
109 |
108 |
110 |
109 |
111 def _findExecutable(majorVersion): |
110 def _findExecutable(majorVersion): |
185 winreg.HKEY_LOCAL_MACHINE, |
184 winreg.HKEY_LOCAL_MACHINE, |
186 winreg.KEY_WOW64_64KEY | winreg.KEY_READ, versionStr) |
185 winreg.KEY_WOW64_64KEY | winreg.KEY_READ, versionStr) |
187 if exePaths: |
186 if exePaths: |
188 for exePath in exePaths: |
187 for exePath in exePaths: |
189 executables.add(exePath) |
188 executables.add(exePath) |
|
189 |
|
190 if not executables and majorVersion >= 3: |
|
191 # check the PATH environment variable if nothing was found |
|
192 # Python 3 only |
|
193 path = Utilities.getEnvironmentEntry('PATH') |
|
194 if path: |
|
195 dirs = path.split(os.pathsep) |
|
196 for directory in dirs: |
|
197 for suffix in (".bat", ".exe"): |
|
198 exe = os.path.join(directory, "pylint" + suffix) |
|
199 if os.access(exe, os.X_OK): |
|
200 executables.add(exe) |
190 else: |
201 else: |
191 # |
202 # |
192 # Linux, Unix ... |
203 # Linux, Unix ... |
193 pylintScript = 'pylint' |
204 pylintScript = 'pylint' |
194 scriptSuffixes = ["", |
205 scriptSuffixes = ["", |