Roundup Tracker - Issues

Message4221

Author schlatterbeck
Recipients jerrykan, schlatterbeck
Date 2011-01-10.16:07:46
Message-id <1294675667.17.0.662123232115.issue2550576@psf.upfronthosting.co.za>
In-reply-to
John,
First a good new year to you.
Thanks for the feedback.

You are raising a valid point here, one of the goals of the refactoring
is easier override of the message parsing and that isn't achieved with
my change.

I still think that it's a good idea to put all the state during message
parsing into a separate object for maintainability reasons.

I've now introduced in r4578 a class variable of MailGW named
parsed_message_class that by default points to the parsedMessage in
mailgw.py, you still have to override both classes but the code will not
duplicate existing long methods. With that change your use-case becomes:

 # import roundup stuff here
 class OurParsedMessage(parsedMessage):
   def handle_help(self):
       return

 class OurMailGW(MailGW):
   parsed_message_class = OurParsedMessage
 
 # define 'instance' and 'mailbox' here
 gw = OurMailGW(instance, {})
 gw.do_mailbox(mailbox)

Can you live with that?

Ralf
History
Date User Action Args
2011-01-10 16:07:47schlatterbecksetmessageid: <1294675667.17.0.662123232115.issue2550576@psf.upfronthosting.co.za>
2011-01-10 16:07:47schlatterbecksetrecipients: + schlatterbeck, jerrykan
2011-01-10 16:07:47schlatterbecklinkissue2550576 messages
2011-01-10 16:07:46schlatterbeckcreate