files.py 文件源码

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

项目:SuperOcto 作者: mcecchi 项目源码 文件源码
def _create_etag(path, recursive, lm=None):
    if lm is None:
        lm = _create_lastmodified(path, recursive)

    if lm is None:
        return None

    hash = hashlib.sha1()
    hash.update(str(lm))
    hash.update(str(recursive))

    if path.endswith("/files") or path.endswith("/files/sdcard"):
        # include sd data in etag
        hash.update(repr(sorted(printer.get_sd_files(), key=lambda x: x[0])))

    return hash.hexdigest()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号