compression.py 文件源码

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

项目:chirribackup 作者: killabytenow 项目源码 文件源码
def __init__(self, algorithm, target_file = None):
        self.algorithm = algorithm
        self.bytes_in  = 0
        self.bytes_out = 0
        if self.algorithm is None:
            self.compressor = None
        elif self.algorithm == "lzma":
            if not lzma_available:
                raise BadCompressionException("LZMA (xz) compressor not available.")
            self.compressor = lzma.LZMACompressor()
        else:
            raise BadCompressionException("Uknown compression algorithm '%s'." % self.algorithm)

        self.out_file = open(target_file, "wb") \
                            if target_file is not None else None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号