def __init__(self, outfp, mangle_from_=True, maxheaderlen=78, write_headers=True): self.write_headers = write_headers Generator.__init__(self, outfp, mangle_from_, maxheaderlen)
def __init__(self, outfp, headers=False): """ This is a special purpose message generator. We need a generator that can be used to represent the 'TEXT' fetch attribute. When used on a multipart message it does not render the headers of the message, but renders the headers of every sub-part. When used on a message that is not a multipart it just renders the body. We do this by having the 'clone()' method basically reverse whether or not we should print the headers, and the _write() method looks at that instance variable to decide if it should print the headers or not. outfp is the output file-like object for writing the message to. It must have a write() method. """ Generator.__init__(self, outfp) self._headers = headers
def __init__(self, fp, root=True): Generator.__init__(self, fp, mangle_from_=False, maxheaderlen=0) self.root = root
def __init__(self, outfp, headers=[], skip=True): self.log = logging.getLogger("%s.%s" % (__name__, self.__class__.__name__)) Generator.__init__(self, outfp) self._headers = [x.lower() for x in headers] self._skip = skip
def __init__(self, outfp, mangle_from_=True, maxheaderlen=78, charset=None): Generator.__init__(self, outfp, mangle_from_, maxheaderlen) self.charset = charset