Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(14)  |  Call(7)  |  Derive(0)  |  Import(7)
Execute subprocesses.

        def run_command(
        command,
        split=False,
        ignore_error=False,
        include_errors=True):
    """
    Execute subprocesses.
    """
    log.debug('Running %s', ' '.join(command))

    env = os.environ.copy()

    if include_errors:
        error_pipe = subprocess.STDOUT
    else:
        error_pipe = subprocess.PIPE

    process = subprocess.Popen(
        command,
        stdin=subprocess.PIPE,
        stdout=subprocess.PIPE,
        stderr=error_pipe,
        shell=False,
        universal_newlines=True,
        env=env)
    if split:
        data = process.stdout.readlines()
    else:
        data = process.stdout.read()
    return_code = process.wait()
    if return_code and not ignore_error:
        raise Exception('Failed to execute %s', command)
    return data
        


src/l/i/lint-review-HEAD/lintreview/tools/rubocop.py   lint-review(Download)
import os
import logging
from lintreview.tools import Tool
from lintreview.tools import run_command
from lintreview.utils import in_path
        command += files
        output = run_command(
            command,
            split=True,
            ignore_error=True,

src/l/i/lint-review-HEAD/lintreview/tools/puppet.py   lint-review(Download)
import os
import logging
from lintreview.tools import Tool
from lintreview.tools import run_command
from lintreview.utils import in_path
        command += files
        output = run_command(
            command,
            split=True,
            ignore_error=True,

src/l/i/lint-review-HEAD/lintreview/tools/pep8.py   lint-review(Download)
import os
import logging
from lintreview.tools import Tool
from lintreview.tools import run_command
from lintreview.utils import in_path
            command += ['--ignore', self.options.get('ignore')]
        command += files
        output = run_command(command, split=True, ignore_error=True)
        if not output:
            log.debug('No pep8 errors found.')

src/l/i/lint-review-HEAD/lintreview/tools/flake8.py   lint-review(Download)
import os
import logging
from lintreview.tools import Tool
from lintreview.tools import run_command
from lintreview.utils import in_path
 
        command += files
        output = run_command(command, split=True, ignore_error=True)
        if not output:
            log.debug('No flake8 errors found.')

src/l/i/lint-review-HEAD/lintreview/tools/phpcs.py   lint-review(Download)
import logging
import os
import functools
from lintreview.tools import Tool
from lintreview.tools import run_command
        command = self.create_command(files)
        output = run_command(
            command,
            ignore_error=True)
        filename_converter = functools.partial(

src/l/i/lint-review-HEAD/lintreview/tools/jshint.py   lint-review(Download)
import logging
import os
from lintreview.tools import Tool
from lintreview.tools import run_command
from lintreview.utils import in_path
        command = self.create_command(files)
        output = run_command(
            command,
            ignore_error=True)
        self._process_checkstyle(output)

src/l/i/lint-review-HEAD/lintreview/tools/csslint.py   lint-review(Download)
import functools
import logging
import os
from lintreview.tools import Tool
from lintreview.tools import run_command
        command += files
        output = run_command(
            command,
            ignore_error=True)
        filename_converter = functools.partial(