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)
评论列表
文章目录