Trashcan.py 文件源码

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

项目:enigma2-openpli-fulan 作者: Taapat 项目源码 文件源码
def cleanIfIdle(self, path=None):
        # RecordTimer calls this when preparing a recording. That is a
        # nice moment to clean up. It also mentions the path, so mark
        # it as dirty.
        self.markDirty(path)
        if not self.dirty:
            return
        if self.isCleaning:
            print "[Trashcan] Cleanup already running"
            return
        if (self.session is not None) and self.session.nav.getRecordings():
            return
        self.isCleaning = True
        ctimeLimit = time.time() - (config.usage.movielist_trashcan_days.value * 3600 * 24)
        reserveBytes = 1024*1024*1024 * int(config.usage.movielist_trashcan_reserve.value)
        cleanset = self.dirty
        self.dirty = set()
        threads.deferToThread(purge, cleanset, ctimeLimit, reserveBytes).addCallbacks(self.cleanReady, self.cleanFail)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号