validity_thorough_unused.py 文件源码

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

项目:civet 作者: TheJacksonLaboratory 项目源码 文件源码
def getDLLs(self):
        if not self.effectivelyReadable():
            return []
        # Uses the system's ldd command to get all the supporting libraries.
        # Note: This uses a deprecated interface, but boy is it handy.
        (status, result) = subprocess.getstatusoutput('ldd ' + self.name)
        if status != 0:
            return []

        parts = result.split('\n')
        processed = []
        for n in range(len(parts)):
            # One dll at a time. Prune the address from the right.
            # If there is a path, it is the second element, use it.
            # If that's empty, use the first element.
            if 'ldd: warning:' in parts[n]:
                continue
            names = parts[n].split(' (')[0]
            names = names.split('=>')
            if len(names) > 1:
                name = names[1].strip()
            else:
                name = ''
            if name == '':
                name = names[0].strip()
            processed.append(name)
        return processed
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号