annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4447
9d37875416c3 python2.3 compatibility fixes
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents:
diff changeset
1 try:
9d37875416c3 python2.3 compatibility fixes
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents:
diff changeset
2 # Python 2.5+
9d37875416c3 python2.3 compatibility fixes
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents:
diff changeset
3 from email.parser import FeedParser
9d37875416c3 python2.3 compatibility fixes
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents:
diff changeset
4 except ImportError:
9d37875416c3 python2.3 compatibility fixes
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents:
diff changeset
5 # Python 2.4
9d37875416c3 python2.3 compatibility fixes
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents:
diff changeset
6 try :
9d37875416c3 python2.3 compatibility fixes
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents:
diff changeset
7 from email.Parser import FeedParser
9d37875416c3 python2.3 compatibility fixes
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents:
diff changeset
8 except ImportError:
9d37875416c3 python2.3 compatibility fixes
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents:
diff changeset
9 from email.Parser import Parser
9d37875416c3 python2.3 compatibility fixes
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents:
diff changeset
10 class FeedParser:
9d37875416c3 python2.3 compatibility fixes
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents:
diff changeset
11 def __init__(self):
9d37875416c3 python2.3 compatibility fixes
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents:
diff changeset
12 self.content = []
9d37875416c3 python2.3 compatibility fixes
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents:
diff changeset
13
9d37875416c3 python2.3 compatibility fixes
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents:
diff changeset
14 def feed(self, s):
9d37875416c3 python2.3 compatibility fixes
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents:
diff changeset
15 self.content.append(s)
9d37875416c3 python2.3 compatibility fixes
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents:
diff changeset
16
9d37875416c3 python2.3 compatibility fixes
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents:
diff changeset
17 def close(self):
9d37875416c3 python2.3 compatibility fixes
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents:
diff changeset
18 p = Parser()
9d37875416c3 python2.3 compatibility fixes
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents:
diff changeset
19 return p.parsestr(''.join(self.content))

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