From: schlatterbeck Date: Mon, 10 Jan 2011 16:04:09 +0000 (+0000) Subject: Add the parsedMessage class as class variable to MailGW to allow easier X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0feae45802d97ca2c1ec2fae8457e8e73e47f006;p=roundup.git 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 --- 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()