Beispiel #1
0
 def next(self):
     if self.cnt == self.end:
         raise StopIteration
     try:
         sz = self.size()
         data = self.read(sz)
         entry = LogEntry()
         entry.ParseFromString(data)
         rev = False
         if cc.is_reversible(entry):
             self.cnt += 1
             if self.cnt == self.end:
                 rev = True
         clg.json_loaded(self.cnt, entry, rev)
         return entry, rev
     except BinaryEOF:
         raise StopIteration
Beispiel #2
0
 def next(self):
   if self.cnt == self.end:
     raise StopIteration
   try:
     k = self.kind()
     tp = self.entry_type()
     tag = self.tag()
     sz = self.size()
     data = self.read(sz)
     rev = False
     if (cc.is_reversible(k, tp)):
       self.cnt += 1
       if self.cnt == self.end:
         rev = True
     json_data = json.loads(data)
     clg.json_loaded(self.cnt, k, tp, tag, json_data, rev)
     return tp, tag, json_data, rev
   except BinaryEOF:
     raise StopIteration