Esempio n. 1
0
 def process(self, *args, **kwargs):
     assert(self._source is not None)
     for frame in self._source:
         if isinstance(frame, struct):
             it = frame
             self._send_dict(it.as_dict(without_meta = True))
         else:
             it = struct(frame)
             self._send_dict(it.as_dict(without_meta = True))
         yield frame
Esempio n. 2
0
 def read(self, *args, **kwargs):
     while True:
         kind, payload = self._next_frame()
         if kind==KIND_DATA:
             yield struct(payload, meta=self.provides)
         elif kind==KIND_META:
             self._set_meta(payload)
         elif kind==None:
             raise StopIteration()
         else:
             LOG.warning('unknown kind: %s, ignoring' % kind)
Esempio n. 3
0
 def struct_maker(source):
     for f in source:
         yield struct(f)
Esempio n. 4
0
 def struct_maker(source):
     for f in source:
         yield struct(f)