def writeGenerator(self, gen):
        n = getattr(gen, 'next')

        while True:
            try:
                self.writeElement(n())
            except StopIteration:
                break
Iterates over a generator object and encodes all that is returned.
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/PyAMF-0.6.1/pyamf/codec.py/Encoder.writeGenerator