Roundup Tracker - Issues

Message4215

Author jerrykan
Recipients jerrykan, schlatterbeck
Date 2010-12-24.01:14:12
Message-id <1293153252.92.0.418372342121.issue2550576@psf.upfronthosting.co.za>
In-reply-to
Hello Ralf,

I was hoping to have another look at the patch and provide some
additional feedback about the patch before anything was committed
(unfortunately holiday session has already kicked in though).

I have some reservations about about the 're-factoring into a separate
class'. The initial aim of this patch (for me at least) was so that it
would make it easier to alter parts of the MailGW for specific cases
user may have.

A simple example might be that I don't want to send a help message back
to the user. Using my initial patch I could achieve this by having my
own script that would be something like:

 # import roundup stuff here
 class OurMailGW(MailGW):
   def _handle_message_help(self, message):
       return
 
 # define 'instance' and 'mailbox' here
 gw = OurMailGW(instance, {})
 gw.do_mailbox(mailbox)

But with the approach of using a separate class, I would need to:
 * create my own parsedMessage class (OurParsedMessage)
 * override the 'handle_help' function in OurParsedMessage
 * create my own MailGW class (OurMailGW)
 * override the '_handle_message' and duplicate the entire contents just
so I can change the following line:
     parsed_message = OurParsedMessage(self, message)

This second approach seems a lot less maintainable, and less intuitive.
The size of the MailGW class may be reduced a bit by moving the code out
of it, but I'm not sure it introduces some significant drawbacks.
History
Date User Action Args
2010-12-24 01:14:12jerrykansetmessageid: <1293153252.92.0.418372342121.issue2550576@psf.upfronthosting.co.za>
2010-12-24 01:14:12jerrykansetrecipients: + jerrykan, schlatterbeck
2010-12-24 01:14:12jerrykanlinkissue2550576 messages
2010-12-24 01:14:12jerrykancreate