utils.py 文件源码

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

项目:meta-swupd 作者: pohly 项目源码 文件源码
def delta_contents(difflist):
    """
    Generate a list of files which exist in the bundle image but not the base
    image

    '- ' - line unique to lhs
    '+ ' - line unique to rhs
    '  ' - line common
    '? ' - line not present in either

    returns a list containing the items which are unique in the rhs

    difflist --- a list containing the output of difflib.Differ.compare
          where the lhs (left-hand-side) was the base image and the rhs
          (right-hand-side) was base image + extras (the bundle image).
    """
    cont = []
    for ln in difflist:
        if ln[0] == '+':
            cont.append(ln[3:])
    return cont
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号