autolint/runners.py
def _execute(self, cmd, files, cb=None):
        """Execute and collect the results of the linter execution on the files.

        There is no timeout here, the method will wait till the execution of
        cmd returns.

        :param cmd, list of str as Popen receives to run a program. The path to
                    the file will be replaced in the list if the keyword
                    '%file_path%' appears, otherwise the path will be append to
                    the list.
        :param files, list of str with the path to the files to be linted.
        :param cb: If not None, will call the callback for each tuple
                   (returncode, stdout, stderr).

        :return an ordered dict with one entry for each file in the files list,
                as value it will contain the exit code of the linter, the
                stdout and the stderr."""

        ret = collections.OrderedDict()
        need_replace = False
        for c in cmd:
            if '%file_path%' in c:
                need_replace = True
                break

        for f in files:
            if need_replace:
                command = [s.replace('%file_path%', f) for s in cmd]
            else:
                command = list(cmd)
                command.append(f)

            p = subprocess.Popen(command, stdout=subprocess.PIPE,
                                 stderr=subprocess.PIPE)
            stdout, stderr = p.communicate()
            result = (p.returncode, stdout, stderr)
            if cb is not None:
                cb(*result)
            ret[f] = result

        return ret
Execute and collect the results of the linter execution on the files.

        There is no timeout here, the method will wait till the execution of
        cmd returns.

        :param cmd, list of str as Popen receives to run a program. The path to
                    the file will be replaced in the list if the keyword
                    '%file_path%' appears, otherwise the path will be append to
                    the list.
        :param files, list of str with the path to the files to be linted.
        :param cb: If not None, will call the callback for each tuple
                   (returncode, stdout, stderr).

        :return an ordered dict with one entry for each file in the files list,
                as value it will contain the exit code of the linter, the
                stdout and the stderr.
Execute and collect the results of the linter execution on the files.
There is no timeout here, the method will wait till the execution of
cmd returns.

:param cmd, list of str as Popen receives to run a program. The path to
the file will be replaced in the list if the keyword
'%file_path%' appears, otherwise the path will be append to
the list.
:param files, list of str with the path to the files to be linted.
:param cb: If not None, will call the callback for each tuple
(returncode, stdout, stderr).

:return an ordered dict with one entry for each file in the files list,
as value it will contain the exit code of the linter, the
stdout and the stderr.
Execute and collect the results of the linter execution on the files . There is no timeout here the method will wait till the execution of cmd returns . : param cmd list of str as Popen receives to run a program . The path to the file will be replaced in the list if the keyword ' %file_path% ' appears otherwise the path will be append to the list . : param files list of str with the path to the files to be linted . : param cb : If not None will call the callback for each tuple ( returncode stdout stderr ) . : return an ordered dict with one entry for each file in the files list as value it will contain the exit code of the linter the stdout and the stderr .
def _execute(self, cmd, files, cb=None):
        ret = collections.OrderedDict()
        need_replace = False
        for c in cmd:
            if '%file_path%' in c:
                need_replace = True
                break
        for f in files:
            if need_replace:
                command = [s.replace('%file_path%', f) for s in cmd]
            else:
                command = list(cmd)
                command.append(f)
            p = subprocess.Popen(command, stdout=subprocess.PIPE,
                                 stderr=subprocess.PIPE)
            stdout, stderr = p.communicate()
            result = (p.returncode, stdout, stderr)
            if cb is not None:
                cb(*result)
            ret[f] = result
        return ret
def _execute ( self , cmd , files , cb = None ) : ret = collections . OrderedDict ( ) need_replace = False for c in cmd : if '%file_path%' in c : need_replace = True break for f in files : if need_replace : command = [ s . replace ( '%file_path%' , f ) for s in cmd ] else : command = list ( cmd ) command . append ( f ) p = subprocess . Popen ( command , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) stdout , stderr = p . communicate ( ) result = ( p . returncode , stdout , stderr ) if cb is not None : cb ( * result ) ret [ f ] = result return ret
Execute and collect the results of the linter execution on the files.
Execute and collect the results of the linter execution on the files .
"""Execute and collect the results of the linter execution on the files.

        There is no timeout here, the method will wait till the execution of
        cmd returns.

        :param cmd, list of str as Popen receives to run a program. The path to
                    the file will be replaced in the list if the keyword
                    '%file_path%' appears, otherwise the path will be append to
                    the list.
        :param files, list of str with the path to the files to be linted.
        :param cb: If not None, will call the callback for each tuple
                   (returncode, stdout, stderr).

        :return an ordered dict with one entry for each file in the files list,
                as value it will contain the exit code of the linter, the
                stdout and the stderr."""
self
cmd
files
cb