Re: [Mailman-Developers] Implementing the IArchiver

Hi George,
On Jul 20, 2012, at 02:45 PM, George Chatzisofroniou wrote:
There isn't too much boilerplate you need to write in order to implement IArchiver, or any interface. You can look at the existing implementations in src/mailman/archiving/*.py for examples, but I'll briefly outline what you need here.
from zope.interface import implementer from mailman.interfaces.archiver import IArchiver
@implementer(IArchiver) class MyArchiver: """This is the docstring."""
name = 'myarchiver'
@staticmethod
def list_url(mlist):
"""See `IArchiver`."""
# do something
@staticmethod
def permalink(mlist, msg):
"""See `IArchiver`."""
# do something
@staticmethod
def archive_message(mlist, message):
"""See `IArchiver`."""
# do something
You probably only care about archive_message(). For methods list_url() and
permalink() which you don't care about, you can just raise NotImplemented
.
That's about it! Of course the details of archive_message() are up to you.
Cheers, -Barry

Hi,
I was wondering what is the best way to test an IArchive implementation. Are there any built in test modes that will allow me to send sample messages? I only care about the processing of the messages through my IArchive implementation rather than actually sending them out.
Thanks again,
-- George Chatzisofroniou sophron.latthi.com

Hi,
I was wondering what is the best way to test an IArchive implementation. Are there any built in test modes that will allow me to send sample messages? I only care about the processing of the messages through my IArchive implementation rather than actually sending them out.
Thanks again,
-- George Chatzisofroniou sophron.latthi.com
participants (2)
-
Barry Warsaw
-
George Chatzisofroniou