Exemplo n.º 1
0
 def _build(self, obj, stream, context):
     if "<unnested>" in context:
         del context["<unnested>"]
     elif self.nested:
         context = Container(_ = context)
     objiter = iter(obj)
     for sc in self.subcons:
         if sc.conflags & self.FLAG_EMBED:
             context["<unnested>"] = True
             subobj = objiter
         elif sc.name is None:
             subobj = None
         else:
             subobj = advance_iterator(objiter)
             context[sc.name] = subobj
         sc._build(subobj, stream, context)
Exemplo n.º 2
0
 def _build(self, obj, stream, context):
     if "<unnested>" in context:
         del context["<unnested>"]
     elif self.nested:
         context = Container(_ = context)
     objiter = iter(obj)
     for sc in self.subcons:
         if sc.conflags & self.FLAG_EMBED:
             context["<unnested>"] = True
             subobj = objiter
         elif sc.name is None:
             subobj = None
         else:
             subobj = advance_iterator(objiter)
             context[sc.name] = subobj
         sc._build(subobj, stream, context)