summaryrefslogtreecommitdiff
path: root/Mailman/pipeline/tagger.py
diff options
context:
space:
mode:
authorBarry Warsaw2008-02-17 17:34:21 -0500
committerBarry Warsaw2008-02-17 17:34:21 -0500
commit69d158b13ae9cfa37040c2e7a664ca266b42050b (patch)
tree07f48ee990b6bab514f86199eaa250a04280120c /Mailman/pipeline/tagger.py
parentb36de8a6a5b84021c003b728274f7e9e95861c9d (diff)
downloadmailman-69d158b13ae9cfa37040c2e7a664ca266b42050b.tar.gz
mailman-69d158b13ae9cfa37040c2e7a664ca266b42050b.tar.zst
mailman-69d158b13ae9cfa37040c2e7a664ca266b42050b.zip
Diffstat (limited to 'Mailman/pipeline/tagger.py')
-rw-r--r--Mailman/pipeline/tagger.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/Mailman/pipeline/tagger.py b/Mailman/pipeline/tagger.py
index 0a87d8407..cde8547df 100644
--- a/Mailman/pipeline/tagger.py
+++ b/Mailman/pipeline/tagger.py
@@ -17,12 +17,22 @@
"""Extract topics from the original mail message."""
+__metaclass__ = type
+__all__ = ['Tagger']
+
+
import re
import email
import email.Errors
import email.Iterators
import email.Parser
+from zope.interface import implements
+
+from Mailman.i18n import _
+from Mailman.interfaces import IHandler
+
+
OR = '|'
CRNL = '\r\n'
EMPTYSTRING = ''
@@ -155,3 +165,17 @@ class _ForgivingParser(email.Parser.HeaderParser):
# Make sure we retain the last header
if lastheader:
container[lastheader] = NLTAB.join(lastvalue)
+
+
+
+class Tagger:
+ """Tag messages with topic matches."""
+
+ implements(IHandler)
+
+ name = 'tagger'
+ description = _('Tag messages with topic matches.')
+
+ def process(self, mlist, msg, msgdata):
+ """See `IHandler`."""
+ process(mlist, msg, msgdata)