view roundup/anypy/email_.py @ 4547:d9d7319afffa

Add config-option "nosy" to messages_to_author setting in [nosy] section... ...of config: This will send a message to the author only in the case where the author is on the nosy-list (either added earlier or via the add_author setting). Current config-options for this setting will send / not send to author without considering the nosy list. [[Posted on behalf of Dr. Schlatterbeck during the git conversion.]] committer: Eric S. Raymond <esr@thyrsus.com>
author Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
date Wed, 19 Oct 2011 11:32:20 -0400
parents 9d37875416c3
children c426cb251bc7
line wrap: on
line source

try:
    # Python 2.5+
    from email.parser import FeedParser
except ImportError:
    # Python 2.4
    try :
        from email.Parser import FeedParser
    except ImportError:
        from email.Parser import Parser
        class FeedParser:
            def __init__(self):
                self.content = []

            def feed(self, s):
                self.content.append(s)

            def close(self):
                p = Parser()
                return p.parsestr(''.join(self.content))

Roundup Issue Tracker: http://roundup-tracker.org/