parent
32580a8458
commit
eefc8c6086
|
@ -212,7 +212,13 @@ class PythonSetLib(method.Method):
|
|||
class PythonCheckSyntax(method.Method):
|
||||
'''Check the syntax of the current python file'''
|
||||
def _execute(self, w, **vargs):
|
||||
mod = os.path.splitext(os.path.basename(w.buffer.path))[0]
|
||||
mod = os.path.splitext(w.buffer.path)[0]
|
||||
cwd = os.getcwd() + '/'
|
||||
if mod.startswith(cwd):
|
||||
mod = mod.replace(cwd, '', 1)
|
||||
else:
|
||||
mod = os.path.basename(mod)
|
||||
mod = mod.replace('/', '.')
|
||||
cmd = "PYTHONPATH=%s python -c 'import %s'" % (w.mode.pythonlib, mod)
|
||||
(status, output) = commands.getstatusoutput(cmd)
|
||||
if status == 0:
|
||||
|
|
Loading…
Reference in New Issue