From 0feae45802d97ca2c1ec2fae8457e8e73e47f006 Mon Sep 17 00:00:00 2001 From: schlatterbeck Date: Mon, 10 Jan 2011 16:04:09 +0000 Subject: [PATCH] Add the parsedMessage class as class variable to MailGW to allow easier override git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4578 57a73879-2fb5-44c3-a270-3262357dd7e2 --- roundup/mailgw.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/roundup/mailgw.py b/roundup/mailgw.py index b67c5c9..cd06889 100644 --- a/roundup/mailgw.py +++ b/roundup/mailgw.py @@ -1151,6 +1151,11 @@ There was a problem with the message you sent: class MailGW: + # To override the message parsing, derive your own class from + # parsedMessage and assign to parsed_message_class in a derived + # class of MailGW + parsed_message_class = parsedMessage + def __init__(self, instance, arguments=()): self.instance = instance self.arguments = arguments @@ -1446,7 +1451,7 @@ class MailGW: The following code expects an opened database and a try/finally that closes the database. ''' - parsed_message = parsedMessage(self, message) + parsed_message = self.parsed_message_class(self, message) # Filter out messages to ignore parsed_message.handle_ignore() -- 2.30.2