files.py 文件源码

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

项目:SuperOcto 作者: mcecchi 项目源码 文件源码
def copy_file(self, fsrc, fdst, progress_callback=None, complete_callback = None, length=16*1024, **kwargs):

        self.copied = 0
        self.file_size = 0
        self.length = length
        self.p_callback = progress_callback
        self.c_callback = complete_callback
        if not os.path.isfile(fsrc):
            Logger.info("Will not copy")
            return False

        else:
            self.file_size = float(os.path.getsize(fsrc))
        #make the new file
        self.src_obj = open(fsrc, 'rb')
        self.dst_obj = open(fdst, 'wb')
        #Do the copy as fast as possible without blocking the UI thread
        Clock.schedule_interval(self.copy_object, 0)
        return True

    #doing it this way with a clock object does not block the UI
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号