yaourt.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:dotbot-yaourt 作者: niklas-heer 项目源码 文件源码
def _install(self, pkg):
        # to have a unified string which we can query
        # we need to execute the command with LANG=en_US.UTF-8
        cmd = 'LANG=en_US.UTF-8 yaourt --needed --noconfirm -S {}'.format(pkg)

        self._log.info("Installing \"{}\". Please wait...".format(pkg))

        # needed to avoid conflicts due to locking
        time.sleep(1)

        proc = subprocess.Popen(cmd, shell=True,
                stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
        out = proc.stdout.read()
        proc.stdout.close()

        for item in self._strings.keys():
            if out.decode("utf-8").find(self._strings[item]) >= 0:
                return item

        self._log.warning("Could not determine what happened with package {}".format(pkg))
        return PkgStatus.NOT_SURE
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号