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

All Samples(6)  |  Call(5)  |  Derive(0)  |  Import(1)

        def execute(commandAndArgsList, **kwargs):
    wait = not kwargs.get('noWait', False)

    if 'noWait' in kwargs:
        del kwargs['noWait']

    output = kwargs.get('withOutput', False)
    if output:
        kwargs['stdout'] = subprocess.PIPE
        kwargs['stderr'] = subprocess.STDOUT
        kwargs['close_fds'] = True
    if 'withOutput' in kwargs:
        del kwargs['withOutput']

    if isinstance(commandAndArgsList, list):
        _cmd = ' '.join(commandAndArgsList)
    else:
        _cmd = commandAndArgsList

    _printDetail('Calling: %s' % _cmd, kwargs)

    if isinstance(commandAndArgsList, list) and kwargs.get('shell', False) is True:
        commandAndArgsList = ' '.join(commandAndArgsList)

    process = subprocess.Popen(commandAndArgsList, **kwargs)

    if wait:
        process.wait()

    if output:
        return process.returncode, process.stdout.read()
    else:
        return process.returncode
        


src/s/t/stratuslab-client-14.03.0/stratuslab/image/Uploader.py   stratuslab-client(Download)
    def _execute(self, command):
        if self.verboseLevel <= Util.VERBOSE_LEVEL_NORMAL:
            devNull = open(os.path.devnull, 'w')
            ret = Util.execute(command, stdout=devNull, stderr=devNull)
            devNull.close()
        else:
            ret = Util.execute(command)

src/s/t/stratuslab-client-14.03.0/stratuslab/Signator.py   stratuslab-client(Download)
        cmd += javaMainArgs
        self._printCalling(cmd)
        return Util.execute(cmd.split(' '),withOutput=True)
 
    def _findJar(self):
        cmd += javaMainArgs
        self._printCalling(cmd)
        return Util.execute(cmd.split(' '))
 
    def _printCalling(self, cmd):

src/s/t/stratuslab-client-14.03.0/stratuslab/Creator.py   stratuslab-client(Download)
    def _localCleanUp(self):
        Util.execute(['rm', '-rf', self.manifestLocalFileName])
 
    def _scp(self, src, dst, **kwargs):
        return Util.scp(src, dst, self.userPrivateKeyFile,

src/s/t/stratuslab-client-14.03.0/stratuslab/system/BaseSystem.py   stratuslab-client(Download)
from stratuslab import Exceptions
from stratuslab import Defaults
from stratuslab.Util import appendOrReplaceInFile, execute, fileAppendContent, \
    fileGetContent, filePutContent, scp, sshCmd
import stratuslab.Util as Util