python类list2cmdline()的实例源码

easy_install.py 文件源码 项目:zanph 作者: zanph 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def install_options(self, script_text):
        self.options = shlex.split(self._extract_options(script_text))
        cmdline = subprocess.list2cmdline(self)
        if not isascii(cmdline):
            self.options[:0] = ['-x']
easy_install.py 文件源码 项目:zanph 作者: zanph 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def _render(items):
        cmdline = subprocess.list2cmdline(items)
        return '#!' + cmdline + '\n'

# For pbr compat; will be removed in a future version.
_version.py 文件源码 项目:glog-cli 作者: globocom 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def __call__(self, *args):
        command = "{cmd} {args}".format(cmd=self._command,
                                        args=subprocess.list2cmdline(args))
        output = subprocess.check_output(command,
                                         shell=self._shell,
                                         cwd=self._cwd,
                                         stderr=subprocess.STDOUT,
                                         universal_newlines=True)
        return self._yield_output(output)
easy_install.py 文件源码 项目:Sci-Finder 作者: snverse 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def nt_quote_arg(arg):
    """Quote a command line argument according to Windows parsing rules"""
    return subprocess.list2cmdline([arg])
easy_install.py 文件源码 项目:Sci-Finder 作者: snverse 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def install_options(self, script_text):
        self.options = shlex.split(self._extract_options(script_text))
        cmdline = subprocess.list2cmdline(self)
        if not isascii(cmdline):
            self.options[:0] = ['-x']
easy_install.py 文件源码 项目:Sci-Finder 作者: snverse 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def _render(items):
        cmdline = subprocess.list2cmdline(
            CommandSpec._strip_quotes(item.strip()) for item in items)
        return '#!' + cmdline + '\n'


# For pbr compat; will be removed in a future version.
easy_install.py 文件源码 项目:Sci-Finder 作者: snverse 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def nt_quote_arg(arg):
    """Quote a command line argument according to Windows parsing rules"""
    return subprocess.list2cmdline([arg])
easy_install.py 文件源码 项目:Sci-Finder 作者: snverse 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def install_options(self, script_text):
        self.options = shlex.split(self._extract_options(script_text))
        cmdline = subprocess.list2cmdline(self)
        if not isascii(cmdline):
            self.options[:0] = ['-x']
setupbase.py 文件源码 项目:widget-ts-cookiecutter 作者: jupyter-widgets 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def list2cmdline(cmd_list):
        return ' '.join(map(pipes.quote, cmd_list))
setupbase.py 文件源码 项目:widget-ts-cookiecutter 作者: jupyter-widgets 项目源码 文件源码 阅读 33 收藏 0 点赞 0 评论 0
def run(cmd, **kwargs):
    """Echo a command before running it.  Defaults to repo as cwd"""
    log.info('> ' + list2cmdline(cmd))
    kwargs.setdefault('cwd', HERE)
    kwargs.setdefault('shell', os.name == 'nt')
    if not isinstance(cmd, (list, tuple)) and os.name != 'nt':
        cmd = shlex.split(cmd)
    cmd[0] = which(cmd[0])
    return subprocess.check_call(cmd, **kwargs)
afl-cmin.py 文件源码 项目:afl-kit 作者: kcwu 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def afl_showmap(input_path, first=False):
    cmd = [
            'afl-showmap',
            '-m', str(args.memory_limit),
            '-t', str(args.time_limit),
            '-o', '-',
            '-Z']

    if args.qemu_mode:
        cmd += ['-Q']
    if args.edge_mode:
        cmd += ['-e']
    cmd += ['--', args.exe] + args.args

    input_from_file = False
    if args.stdin_file:
        input_from_file = True
        shutil.copy(input_path, args.stdin_file)
        input_path = args.stdin_file
    for i in range(len(cmd)):
        if '@@' in cmd[i]:
            input_from_file = True
            cmd[i] = cmd[i].replace('@@', input_path)

    if first:
        logger.debug('run command line: %s', subprocess.list2cmdline(cmd))
    if input_from_file:
        p = subprocess.Popen(cmd, stdout=subprocess.PIPE, bufsize=1048576)
    else:
        p = subprocess.Popen(cmd, stdin=file(input_path), stdout=subprocess.PIPE, bufsize=1048576)
    out = p.stdout.read()
    p.wait()
    #out = p.communicate()[0]

    a = array.array('l', map(int, out.split()))
    return a
easy_install.py 文件源码 项目:ascii-art-py 作者: blinglnav 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def nt_quote_arg(arg):
    """Quote a command line argument according to Windows parsing rules"""
    return subprocess.list2cmdline([arg])
easy_install.py 文件源码 项目:ascii-art-py 作者: blinglnav 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def install_options(self, script_text):
        self.options = shlex.split(self._extract_options(script_text))
        cmdline = subprocess.list2cmdline(self)
        if not isascii(cmdline):
            self.options[:0] = ['-x']
easy_install.py 文件源码 项目:ascii-art-py 作者: blinglnav 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def _render(items):
        cmdline = subprocess.list2cmdline(
            CommandSpec._strip_quotes(item.strip()) for item in items)
        return '#!' + cmdline + '\n'


# For pbr compat; will be removed in a future version.
docker.py 文件源码 项目:dockwrkr 作者: turbulent 项目源码 文件源码 阅读 31 收藏 0 点赞 0 评论 0
def run(container, containerArgs, config, basePath=None, networks=None):
    params = readCreateParameters(
        container, config, basePath=basePath, networks=networks, asList=True)
    if params.isFail():
        return params
    try:
        cmd = [DOCKER_CLIENT, "run", "--rm", "--interactive", "--tty"] + params.getOK() + containerArgs
        logger.debug("EXECVP - %s" % subprocess.list2cmdline(cmd))
        os.execvp(DOCKER_CLIENT, cmd)
    except Exception as ex:
        return Fail(ex)
easy_install.py 文件源码 项目:ivaochdoc 作者: ivaoch 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def nt_quote_arg(arg):
    """Quote a command line argument according to Windows parsing rules"""
    return subprocess.list2cmdline([arg])
easy_install.py 文件源码 项目:ivaochdoc 作者: ivaoch 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def install_options(self, script_text):
        self.options = shlex.split(self._extract_options(script_text))
        cmdline = subprocess.list2cmdline(self)
        if not isascii(cmdline):
            self.options[:0] = ['-x']
easy_install.py 文件源码 项目:ivaochdoc 作者: ivaoch 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def _render(items):
        cmdline = subprocess.list2cmdline(
            CommandSpec._strip_quotes(item.strip()) for item in items)
        return '#!' + cmdline + '\n'


# For pbr compat; will be removed in a future version.
easy_install.py 文件源码 项目:aws-cfn-plex 作者: lordmuffin 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def nt_quote_arg(arg):
    """Quote a command line argument according to Windows parsing rules"""
    return subprocess.list2cmdline([arg])
easy_install.py 文件源码 项目:aws-cfn-plex 作者: lordmuffin 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def install_options(self, script_text):
        self.options = shlex.split(self._extract_options(script_text))
        cmdline = subprocess.list2cmdline(self)
        if not isascii(cmdline):
            self.options[:0] = ['-x']


问题


面经


文章

微信
公众号

扫码关注公众号