All Samples(487) | Call(428) | Derive(0) | Import(59)
Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the Popen constructor. Example: check_call(["ls", "-l"])
def check_call(*popenargs, **kwargs):
"""Run command with arguments. Wait for command to complete. If
the exit code was zero then return, otherwise raise
CalledProcessError. The CalledProcessError object will have the
return code in the returncode attribute.
The arguments are the same as for the Popen constructor. Example:
check_call(["ls", "-l"])
"""
retcode = call(*popenargs, **kwargs)
if retcode:
cmd = kwargs.get("args")
if cmd is None:
cmd = popenargs[0]
raise CalledProcessError(retcode, cmd)
return 0
import re from subprocess import Popen, STDOUT, PIPE, check_call from kokki.base import Fail from kokki.providers.package import PackageProvider class DebianAptProvider(PackageProvider):
def install_package(self, name, version):
return 0 == check_call("DEBIAN_FRONTEND=noninteractive apt-get -q -y install %s=%s" % (name, version),
shell=True, stdout=PIPE, stderr=STDOUT)
def upgrade_package(self, name, version):
return self.install_package(name, version)
src/p/y/PyBayes-HEAD/examples/install_test_stress.py PyBayes(Download)
import os import shutil from string import join from subprocess import call, check_call def parse_options():
cmdargs = args[:]
cmdargs.append(command)
print(join(cmdargs, ' '))
check_call(cmdargs)
os.chdir(orig_dir)
def run_tests(options):
src/p/y/pyxc-pj-HEAD/pj-examples/colorflash/make.py pyxc-pj(Download)
import os, sys, time from subprocess import check_call import pj.api from pyxc.util import parentOf
def main():
check_call(['mkdir', '-p', 'build'])
js = None
for closureMode in ['', 'pretty', 'simple']:
src/k/o/kokki-0.2/kokki/providers/package/easy_install.py kokki(Download)
import re from subprocess import check_call, Popen, PIPE, STDOUT from kokki.providers.package import PackageProvider version_re = re.compile(r'\S\S(.*)\/(.*)-(.*)-py(.*).egg\S') best_match_re = re.compile(r'Best match: (.*) (.*)\n')
def install_package(self, name, version):
check_call([self.easy_install_binary_path, "%s==%s" % (name, version)], stdout=PIPE, stderr=STDOUT)
def update_package(self, name, version):
self.install_package(name, version)
def remove_package(self, name, version):
check_call([self.easy_install_binary_path, "-m", name])
src/c/u/cubicweb-3.9.8/devtools/qunit.py cubicweb(Download)
import os, os.path as osp import signal from tempfile import mkdtemp, NamedTemporaryFile, TemporaryFile import tempfile from Queue import Queue, Empty from subprocess import Popen, check_call, CalledProcessError from shutil import rmtree, copy as copyfile
stdout = TemporaryFile()
stderr = TemporaryFile()
try:
check_call(['firefox', '-no-remote', '-CreateProfile',
'%s %s' % (self._profile_name, self._tmp_dir)],
stdout=stdout, stderr=stderr)
except CalledProcessError, cpe:
src/l/o/logilab-devtools-0.15.0/lgp/setupinfo.py logilab-devtools(Download)
from distutils.core import run_setup #from pkg_resources import FileMetadata from subprocess import Popen, PIPE from subprocess import check_call, CalledProcessError from logilab.common.configuration import Configuration from logilab.common.logging_ext import ColorFormatter
# test and extracting the .orig.tar.gz
try:
cmd = 'tar xzf %s -C %s' % (tarball, self._tmpdir)
check_call(cmd.split(), stdout=sys.stdout,
stderr=sys.stderr)
except CalledProcessError, err:
raise LGPCommandException('an error occured while extracting the '
src/d/a/DataGrid-0.1.1/datagrid/distutils.py DataGrid(Download)
"""DataGrid install/dist utils"""
from os import tmpfile
from subprocess import check_call, CalledProcessError
def phpdir():
"""Locate PHP's include-dir"""
with tmpfile() as phpinfo:
try:
check_call(['php -r "echo get_include_path();"'], stdout=phpinfo,
src/l/o/logilab-devtools-0.15.0/lgp/build.py logilab-devtools(Download)
import pprint import warnings import os.path as osp from subprocess import check_call, CalledProcessError from debian_bundle import deb822
os.chdir(origpath)
try:
cmd = 'debuild --no-tgz-check --no-lintian --clear-hooks -uc -us'
check_call(cmd.split(), stdout=sys.stdout, stderr=sys.stderr)
except CalledProcessError, err:
msg = "error with your package"
raise LGPCommandException(msg, err)
# FIXME use one copy of the upstream tarball
#if self.config.orig_tarball:
# cmd += ' %s' % self.config.orig_tarball
check_call(cmd.split(), stdout=sys.stdout, stderr=sys.stderr)
except CalledProcessError, err:
msg = "cannot build valid dsc file '%s' with command %s" % (dscfile, cmd)
raise LGPCommandException(msg, err)
cmd = ['sed', '-i', '/^[[:alpha:]]/s/\([[:alpha:]]\+\);/%s;/' % distrib,
osp.join(origpath, 'debian', 'changelog')]
try:
check_call(cmd, stdout=sys.stdout) #, stderr=sys.stderr)
except CalledProcessError, err:
raise LGPCommandException("bad substitution for distribution field", err)
logging.info("run build command: %s" % cmd)
try:
check_call(cmd.split(), env={'DIST': distrib, 'ARCH': arch}, stdout=sys.stdout) #, stderr=sys.stderr)
except CalledProcessError, err:
raise LGPCommandException("failed autobuilding of package", err)
src/b/p/bpt-0.5.2/bpt/autobuild.py bpt(Download)
import sys import re from tempfile import mkdtemp from subprocess import check_call from shutil import rmtree from bpt import log, UserError
log.info('Building and installing as package %s', pkg.name)
for cmd in cmd_list:
check_call(['bash', '-e', box.env_script, cmd], cwd=source_dir, stdout=stdout)
box.enable_package(pkg)
basename, unpack_cmd = guess_unpack_cmd(filename)
log.info('Unpacking the file...')
check_call(unpack_cmd, cwd=build_dir)
unpacked_files = [os.path.join(build_dir, f)
for f in os.listdir(build_dir)]
src/p/y/pyev-0.5.3-3.8/setup.py pyev(Download)
from os.path import abspath, join from re import findall, search from sys import argv from subprocess import check_call from distutils.command.build_ext import build_ext as _build_ext from distutils.core import setup, Extension
def finalize_options(self):
_build_ext.finalize_options(self)
if "sdist" not in argv:
check_call(join(libev_dir, "configure"), cwd=libev_dir, shell=True)
libev_config = open(join(libev_dir, "config.h"), "r").read()
self.libraries = [l.lower() for l in
set(findall("#define HAVE_LIB(\S+) 1",
1 | 2 | 3 | 4 | 5 | 6 Next