Пример #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
Пример #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
Пример #3
0
    def next(self):
        if self.cnt == self.end:
            raise StopIteration
        try:
            k = self.kind()
            tp = self.entry_type()
            if cglb.__TTY__:
                print "\n", tp
            tag = self.tag()
            sz = self.size()
            data = self.read(sz)
            rev = False
            if (cc.is_reversible(k, tp)):
                self.cnt += 1
                if cglb.__TTY__:
                    print "RVS -- %s" % self.cnt
                if self.cnt == self.end:
                    rev = True

            json_data = json.loads(data)
            return tp, tag, json_data, rev
        except BinaryEOF:
            raise StopIteration
Пример #4
0
 def next(self):
   if self.cnt == self.end:
     raise StopIteration
   try:
     k = self.kind()
     tp = self.entry_type()
     if cglb.__TTY__:
       print "\n", tp
     tag = self.tag()
     sz = self.size()
     data = self.read(sz)
     rev = False
     if (cc.is_reversible(k, tp)):
       self.cnt += 1
       if cglb.__TTY__:
         print "RVS -- %s" % self.cnt
       if self.cnt == self.end:
         rev = True
     
     json_data = json.loads(data)
     return tp, tag, json_data, rev
   except BinaryEOF:
     raise StopIteration