On Thu, 04 Mar 2010 06:49:54 -0800 Mark Sapiro <m...@msapiro.net> wrote:
> On 3/4/2010 4:23 AM, Cedric Jeanneret wrote: > > > > I think I found what's the problem is : the script works now, but as > > I write my own archiver, it doesn't do the pipermail part (i.e. > > update mails in archive)... I thought that this code : > > > > mlist = MailList.MailList(maillist, lock=False) > > msg = email.message_from_file(sys.stdin, Message.Message) > > f = StringIO(str(sys.stdin)) > > h = HyperArch.HyperArchive(mlist) > > h.processUnixMailbox(f) > > f.close() > > > > did all, but after reading a bit of code, it doesn't exactly. It > > saves to .mbox file, right ? > > > No. It doesn't save to the .mbox file. If you look at the ArchiveMail() > method in Mailman/Archivers/Archiver.py. it first saves to the .mbox by > doing > > if mm_cfg.ARCHIVE_TO_MBOX in (1, 2): > self.__archive_to_mbox(msg) > > Then it either calls the external archiver or executes essentially the > above to archive the mail in the pipermail archive. > > What you are missing is > > h.close() > > and that's why it doesn't work. > > > > I tried to find where it does the pipermail stuff, but it's a bit > > complicated [I'm not so at ease with Python]. > > > Yes, the archiver is very convoluted because classes are subclassed and > methods overridden all over. Don't feel bad. I've been looking at it for > years and still only barely understand it. > hmmm, I use the h.close() a bit after (I catche its latest ID so that I ca build the direct URL for my indexer). But for now, I guess I'm done. I've opened a bug (didn't figure where I could put my stuff) on launchpad: https://bugs.launchpad.net/mailman/+bug/531942 It contains my scripts, and some informations on how to use them. Indeed, "arch" script uses locks. I copied it, removed the lock stuff, and used this version. All work fine now. I'm happy I could understand a bit (well... very little bit) how mailman works. Thanks again ! -- Cédric Jeanneret | System Administrator 021 619 10 32 | Camptocamp SA cedric.jeanne...@camptocamp.com | PSE-A / EPFL
signature.asc
Description: PGP signature
------------------------------------------------------ Mailman-Users mailing list Mailman-Users@python.org http://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://wiki.list.org/x/AgA3 Security Policy: http://wiki.list.org/x/QIA9 Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: http://mail.python.org/mailman/options/mailman-users/archive%40jab.org