archivebot.py 文件源码

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

项目:abusehelper 作者: Exploit-install 项目源码 文件源码
def _collect(self, room_name, compress):
        event = yield idiokit.next()

        while True:
            current = datetime.utcnow().day

            with _open_archive(self.archive_dir, time.time(), room_name) as archive:
                self.log.info("Opened archive {0!r}".format(archive.name))

                while current == datetime.utcnow().day:
                    json_dict = dict((key, event.values(key)) for key in event.keys())
                    archive.write(json.dumps(json_dict) + os.linesep)

                    event = yield idiokit.next()

            yield compress.queue(0.0, _rename(archive.name))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号