PluginPyLint.py

changeset 8
b126b60ac32a
parent 7
cda98d0e93e7
child 10
398979610d9b
equal deleted inserted replaced
7:cda98d0e93e7 8:b126b60ac32a
26 # Start-of-Header 26 # Start-of-Header
27 name = "PyLint Plugin" 27 name = "PyLint Plugin"
28 author = "Detlev Offenbach <detlev@die-offenbachs.de>" 28 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
29 autoactivate = True 29 autoactivate = True
30 deactivateable = True 30 deactivateable = True
31 version = "5.0.1" 31 version = "5.0.2"
32 className = "PyLintPlugin" 32 className = "PyLintPlugin"
33 packageName = "PyLint" 33 packageName = "PyLint"
34 shortDescription = "Show the PyLint dialogs." 34 shortDescription = "Show the PyLint dialogs."
35 longDescription = """This plug-in implements the PyLint dialogs.""" \ 35 longDescription = """This plug-in implements the PyLint dialogs.""" \
36 """ PyLint is used to check Python source files according to various rules.""" 36 """ PyLint is used to check Python source files according to various rules."""
111 return exePath 111 return exePath
112 else: 112 else:
113 # 113 #
114 # Linux, Unix ... 114 # Linux, Unix ...
115 pylintScript = 'pylint' 115 pylintScript = 'pylint'
116 scriptSuffixes = ["",
117 "-python{0}".format(sys.version[:1]),
118 "-python{0}".format(sys.version[:3])]
116 # There could be multiple pylint executables in the path 119 # There could be multiple pylint executables in the path
117 # e.g. for different python variants 120 # e.g. for different python variants
118 path = Utilities.getEnvironmentEntry('PATH') 121 path = Utilities.getEnvironmentEntry('PATH')
119 # environment variable not defined 122 # environment variable not defined
120 if path is None: 123 if path is None:
122 125
123 # step 1: determine possible candidates 126 # step 1: determine possible candidates
124 exes = [] 127 exes = []
125 dirs = path.split(os.pathsep) 128 dirs = path.split(os.pathsep)
126 for dir in dirs: 129 for dir in dirs:
127 exe = os.path.join(dir, pylintScript) 130 for suffix in scriptSuffixes:
128 if os.access(exe, os.X_OK): 131 exe = os.path.join(dir, pylintScript + suffix)
129 exes.append(exe) 132 if os.access(exe, os.X_OK):
133 exes.append(exe)
130 134
131 # step 2: determine the Python 3 variant 135 # step 2: determine the Python 3 variant
132 found = False 136 found = False
133 if Utilities.isMacPlatform(): 137 if Utilities.isMacPlatform():
134 checkStr = "Python.framework/Versions/3".lower() 138 checkStr = "Python.framework/Versions/3".lower()

eric ide

mercurial