traildb.py 文件源码

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

项目:traildb-python 作者: traildb 项目源码 文件源码
def next(self):
        """Return the next event in the trail."""
        event = lib.tdb_cursor_next(self.cursor)
        if not event:
            raise StopIteration()

        address = addressof(event.contents.items)
        items = (tdb_item*event.contents.num_items).from_address(address)

        timestamp = event.contents.timestamp
        if self.parsetime:
            timestamp = datetime.fromtimestamp(event.contents.timestamp)
        if self.only_timestamp:
            return timestamp
        elif self.valuefun:
            return self.cls(timestamp, *(self.valuefun(item) for item in items))
        else:
            return self.cls(timestamp, *items)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号