Did I find the right examples for you? yes no

All Samples(57)  |  Call(47)  |  Derive(0)  |  Import(10)

        def call_subprocess(cmd, show_stdout=True,
                    filter_stdout=None, cwd=None,
                    raise_on_returncode=True,
                    command_level=logger.DEBUG, command_desc=None,
                    extra_environ=None):
    if command_desc is None:
        cmd_parts = []
        for part in cmd:
            if ' ' in part or '\n' in part or '"' in part or "'" in part:
                part = '"%s"' % part.replace('"', '\\"')
            cmd_parts.append(part)
        command_desc = ' '.join(cmd_parts)
    if show_stdout:
        stdout = None
    else:
        stdout = subprocess.PIPE
    logger.log(command_level, "Running command %s" % command_desc)
    env = os.environ.copy()
    if extra_environ:
        env.update(extra_environ)
    try:
        proc = subprocess.Popen(
            cmd, stderr=subprocess.STDOUT, stdin=None, stdout=stdout,
            cwd=cwd, env=env)
    except Exception:
        e = sys.exc_info()[1]
        logger.fatal(
            "Error %s while executing command %s" % (e, command_desc))
        raise
    all_output = []
    if stdout is not None:
        stdout = proc.stdout
        while 1:
            line = console_to_str(stdout.readline())
            if not line:
                break
            line = line.rstrip()
            all_output.append(line + '\n')
            if filter_stdout:
                level = filter_stdout(line)
                if isinstance(level, tuple):
                    level, line = level
                logger.log(level, line)
                if not logger.stdout_level_matches(level):
                    logger.show_progress()
            else:
                logger.info(line)
    else:
        returned_stdout, returned_stderr = proc.communicate()
        all_output = [returned_stdout or '']
    proc.wait()
    if proc.returncode:
        if raise_on_returncode:
            if all_output:
                logger.notify('Complete output from command %s:' % command_desc)
                logger.notify('\n'.join(all_output) + '\n----------------------------------------')
            raise InstallationError(
                "Command %s failed with error code %s in %s"
                % (command_desc, proc.returncode, cwd))
        else:
            logger.warn(
                "Command %s had error code %s in %s"
                % (command_desc, proc.returncode, cwd))
    if stdout is not None:
        return ''.join(all_output)
        


src/p/i/pip-HEAD/pip/req.py   pip(Download)
from pip.util import renames, normalize_path, egg_link_path
from pip.util import make_path_relative
from pip import call_subprocess
from pip.backwardcompat import (any, copytree, urlparse, urllib,
                                ConfigParser, string_types, HTTPError,
                egg_base_option = ['--egg-base', 'pip-egg-info']
            call_subprocess(
                [sys.executable, '-c', script, 'egg_info'] + egg_base_option,
                cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False,
                command_level=logger.VERBOSE_DEBUG,
            logger.indent += 2
            try:
                call_subprocess(install_args + install_options,
                    cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
            finally:
            ## FIXME: should we do --install-headers here too?
            call_subprocess(
                [sys.executable, '-c',
                 "import setuptools; __file__=%r; exec(compile(open(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))" % self.setup_py]
                + list(global_options) + ['develop', '--no-deps'] + list(install_options),
        dest = os.path.join(target_dir, req_to_install.name)
        copytree(req_to_install.source_dir, dest)
        call_subprocess(["python", "%s/setup.py" % dest, "clean"], cwd=dest,
                        command_desc='python setup.py clean')
 

src/p/i/pippy-0.1.0/pippy/req.py   pippy(Download)
from pip.util import renames, normalize_path, egg_link_path
from pip.util import make_path_relative
from pip import call_subprocess
from pip.backwardcompat import (any, copytree, urlparse, urllib,
                                ConfigParser, string_types, HTTPError,
        try:
            call_subprocess(
                [sys.executable, 'setup.py', 'build'],
                cwd=location, show_stdout=False,
                command_level=logger.VERBOSE_DEBUG,

src/p/i/pip-HEAD/pip/vcs/git.py   pip(Download)
import tempfile
import re
from pip import call_subprocess
from pip.util import display_path, rmtree
from pip.vcs import vcs, VersionControl
                location = location + '/'
            call_subprocess(
                [self.cmd, 'checkout-index', '-a', '-f', '--prefix', location],
                filter_stdout=self._filter, show_stdout=False, cwd=temp_dir)
        finally:
    def switch(self, dest, url, rev_options):
        call_subprocess(
            [self.cmd, 'config', 'remote.origin.url', url], cwd=dest)
        call_subprocess(
            [self.cmd, 'checkout', '-q'] + rev_options, cwd=dest)
 
    def update(self, dest, rev_options):
        # First fetch changes from the default remote
        call_subprocess([self.cmd, 'fetch', '-q'], cwd=dest)

src/p/i/pip-HEAD/pip/vcs/bazaar.py   pip(Download)
import os
import tempfile
import re
from pip import call_subprocess
from pip.backwardcompat import urlparse
            rmtree(location)
        try:
            call_subprocess([self.cmd, 'export', location], cwd=temp_dir,
                            filter_stdout=self._filter, show_stdout=False)
        finally:
            rmtree(temp_dir)
 
    def switch(self, dest, url, rev_options):
        call_subprocess([self.cmd, 'switch', url], cwd=dest)
    def update(self, dest, rev_options):
        call_subprocess(
            [self.cmd, 'pull', '-q'] + rev_options, cwd=dest)
 
    def obtain(self, dest):
                          % (url, rev_display, display_path(dest)))
            call_subprocess(
                [self.cmd, 'branch', '-q'] + rev_options + [url, dest])
 
    def get_url_rev(self):

src/p/i/pip-HEAD/pip/vcs/mercurial.py   pip(Download)
import os
import tempfile
import re
import sys
from pip import call_subprocess
        try:
            call_subprocess(
                [self.cmd, 'archive', location],
                filter_stdout=self._filter, show_stdout=False, cwd=temp_dir)
        finally:
                % (url, e))
        else:
            call_subprocess([self.cmd, 'update', '-q'] + rev_options, cwd=dest)
 
    def update(self, dest, rev_options):
        call_subprocess([self.cmd, 'pull', '-q'], cwd=dest)
        call_subprocess(
            [self.cmd, 'update', '-q'] + rev_options, cwd=dest)

src/p/i/pip-HEAD/pip/vcs/subversion.py   pip(Download)
import os
import re
from pip.backwardcompat import urlparse
from pip import call_subprocess, InstallationError
from pip.index import Link
    def get_info(self, location):
        """Returns (url, revision), where both are strings"""
        assert not location.rstrip('/').endswith(self.dirname), 'Bad directory: %s' % location
        output = call_subprocess(
            [self.cmd, 'info', location], show_stdout=False, extra_environ={'LANG': 'C'})
                rmtree(location)
            call_subprocess(
                [self.cmd, 'export'] + rev_options + [url, location],
                filter_stdout=self._filter, show_stdout=False)
        finally:
            logger.indent -= 2
 
    def switch(self, dest, url, rev_options):
        call_subprocess(
            [self.cmd, 'switch'] + rev_options + [url, dest])
    def update(self, dest, rev_options):
        call_subprocess(
            [self.cmd, 'update'] + rev_options + [dest])
 
    def obtain(self, dest):

src/s/n/snakebasket-HEAD/snakebasket/patches.py   snakebasket(Download)
def patched_git_get_revision_from_rev_parse(s, name, location):
    from pip import call_subprocess
    ret = call_subprocess([s.cmd, 'show-ref', '--dereference', name],
        show_stdout=False, cwd=location)
    ret = ret.splitlines()[-1].split(" ")[0]

src/p/i/Pinax-0.9a2/pinax/core/management/commands/setup_project.py   Pinax(Download)
            environ["PIP_REQUIRE_VIRTUALENV"] = "true"
 
        pip.call_subprocess([
            pip_cmd,
            "install",

src/c/h/Chipy-HEAD/pinax/core/management/commands/setup_project.py   Chipy(Download)
            environ["PIP_REQUIRE_VIRTUALENV"] = "true"
 
        pip.call_subprocess([
            pip_cmd,
            "install",

src/m/a/manabi-HEAD/pinax/core/management/commands/setup_project.py   manabi(Download)
            environ["PIP_REQUIRE_VIRTUALENV"] = "true"
 
        pip.call_subprocess([
            pip_cmd,
            "install",

  1 | 2  Next