• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

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
        


src/l/i/liegkat-archiv-HEAD/trunk/src/pyliegkat/parser/base/katcs2cs.py   liegkat-archiv(Download)
def wrapper_usable():
    """ Prüft, ob Proj Wrapper KatCs2CS benutzt werden kann. 
        Dies erfolgt durch Test, ob dProgrammaufruf PROJ funktioniert. 
    """
    check = True 
    try:
        subprocess.check_call(["cs2cs", "-ld"], shell=True, 

src/l/i/liegkat-archiv-HEAD/src/pyliegkat/parser/base/katcs2cs.py   liegkat-archiv(Download)
def wrapper_usable():
    """ Prüft, ob Proj Wrapper KatCs2CS benutzt werden kann. 
        Dies erfolgt durch Test, ob dProgrammaufruf PROJ funktioniert. 
    """
    check = True 
    try:
        subprocess.check_call(["cs2cs", "-ld"], shell=True, 

src/k/o/kokki-0.2/kokki/providers/package/apt.py   kokki(Download)
 
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/c/m/cmd2-0.6.1/cmd2.py   cmd2(Download)
else:
    can_clip = False
    try:
        subprocess.check_call('xclip -o -sel clip', shell=True, stdout=subprocess.PIPE, stdin=subprocess.PIPE)
        can_clip = True
    except AttributeError:  # check_call not defined, Python < 2.5
        teststring = 'Testing for presence of xclip.'

src/n/u/numpy-refactor-HEAD/tools/win32build/build.py   numpy-refactor(Download)
 
    try:
        try:
            subprocess.check_call(cmd, shell = True, stderr = subprocess.STDOUT, stdout = f)
        finally:
            f.close()
    except subprocess.CalledProcessError, e:

src/n/u/numpy3k-HEAD/tools/win32build/build.py   numpy3k(Download)
 
    try:
        try:
            subprocess.check_call(cmd, shell = True, stderr = subprocess.STDOUT, stdout = f)
        finally:
            f.close()
    except subprocess.CalledProcessError, e:

src/n/u/numpy-HEAD/tools/win32build/build.py   numpy(Download)
 
    try:
        try:
            subprocess.check_call(cmd, shell = True, stderr = subprocess.STDOUT, stdout = f)
        finally:
            f.close()
    except subprocess.CalledProcessError, e:

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/m/a/matplotlib-HEAD/matplotlib/examples/animation/old_animation/movie_demo.py   matplotlib(Download)
"""
 
try:
    subprocess.check_call(['mencoder'])
except subprocess.CalledProcessError:
    print "mencoder command was found"
    pass # mencoder is found, but returns non-zero exit as expected
#os.spawnvp(os.P_WAIT, 'mencoder', command)
 
print "\n\nabout to execute:\n%s\n\n" % ' '.join(command)
subprocess.check_call(command)
 
print "\n\n The movie was written to 'output.avi'"
 

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']:

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next