summaryrefslogtreecommitdiff
path: root/Mailman/Archiver/Archiver.py
Commit message (Collapse)AuthorAgeFilesLines
...
* __archive_to_mbox(): Wrap the code after the munge of the Date: headerbwarsaw2000-04-091-13/+15
| | | | | | | in a try/finally so we guarantee we de-munge the header. ArchiveMail(): Undo the previous change (test for mlist.archive). This is redundant given the test in ToArchive.py.
* __archive_to_mbox(): Message objects does not have any "SetHeader"hmeland2000-04-091-3/+3
| | | | | method, use their mapping type interface instead. ArchiveMail(): Don't do any archiving unless self.archive is true.
* makelink(), breaklink(), Archiver.InitVars(),bwarsaw2000-04-031-17/+11
| | | | | | | | Archiver.__archive_to_mbox(): Since Python 1.5.2 is now required, we can get rid of the Utils.reraise() hack. Also, use import statements which are more consistent with the rest of Mailman.
* Update the copyright lines to include the years 1999 & 2000.bwarsaw2000-03-211-1/+1
|
* ArchiveMail(): the message's body could be the empty string. Checkbwarsaw1999-12-251-1/+1
| | | | for this before indexing msg.body[0]
* ExternalArchive(): Fixes proposed by Bernhard Reiter, specifically:bwarsaw1999-12-111-2/+6
| | | | | | use the lower cased list name (i.e. the internal name) as the %(listname)s expansion; log a message when the external archivers exits with a non-zero status.
* Use convenience StringIO modulebwarsaw1999-11-101-5/+1
|
* ArchiveMail(): When public archiving is turned on andbwarsaw1999-09-041-7/+22
| | | | | | | | | PUBLIC_EXTERNAL_ARCHIVER is true, the variable contains a shell command string for os.popen() to invoke the external archiver. Similar for PRIVATE_EXTERNAL_ARCHIVER and private archiving. Patch submitted by Paul Hebble <hebble@ncsa.uiuc.edu>, modified by myself (I couldn't resist!)
* ArchiveMail(): it's still possible that the archiver takes a long timebwarsaw1999-08-221-3/+7
| | | | | | to run (thus breaking the lock). Two changes: crank the lock lifetime up to 5 minutes, and catch any possible NotLockedErrors that might occur.
* Extensive changes based on Jeremy Hylton's investigations. Thesebwarsaw1999-08-211-6/+16
| | | | | | | | | | | | | | should considerably help the performance of the archiver. Specifically: ArchiveMail(): Create a lock file (and lock it), just after the fork. Jeremy observes that there is a race condition when many posts show up in a short amount of time. By creating a lock file we make sure that the separate archiver processes won't clobber each other. Use the new LockFile module. Move the (c)StringIO import to the top of the file.
* Archiver.ArchiveMail(): As this method always is called with onehmeland1999-07-011-1/+5
| | | | | | | single message, we must quote any lines beginning with "From " -- the message will be interpreted by the general HyperArch.HyperArchive.processUnixMailbox() as a (possibly multi-message) mbox file on it's way into the archive.
* GetBaseArchiveURL(): tack the new CGI extension onto the privatebwarsaw1999-02-281-1/+3
| | | | script.
* Use the default argument to the reraise() functionbwarsaw1998-12-291-4/+4
|
* changed to use %s/%s instead of os.path.join,cotton1998-11-091-6/+2
| | | | | added trailing '/' to public archive url (it always points to a directory). scott
* ArchiveMail(): in the finally, be sure to flush stderr or we'll neverbwarsaw1998-11-061-0/+2
| | | | see the exception traceback!
* Makefile.in: added arch script to integrate an mboxcotton1998-11-051-1/+0
| | | | | | | bin/arch: script to integrate an mbox intove html archives. I'm hoping to extend the functionality of this script one day, hence the general name. scott
* .ArchiveMail(): Finally doing the right thing regarding exceptionsklm1998-11-051-23/+33
| | | | | | | | | | | | | | | | | | | | | | | occurring within the child process. We need a 'finally: os._exit()' to ensure that we don't return twice to parent processes that happen to handle exceptions (like the post script does), but we also need to do something to report the exception, since the 'finally: os._exit()' will prevent getting back to the top level, where uncaught exceptions would be printed to stdout. The answer is to wrap a 'try...finally' around a 'try...except' that uses traceback.print_exc() to print the traceback to stderr. Now we won't get mutiple returns from the script in case of exceptions, but the exception will be reported. .ArchiveMail(), .CheckHTMLArchiveDir(): Respect new -1 value for ARCHIVE_TO_MBOX, meaning disable all archiving (for those who, eg, don't want to expend the disk space - or those who can't get it to work without errors;-). Yes, the '-1' value is bogus - but the consolidation of html vs mbox saving using a single var, and without an option to disable completely, is more bogus:-) I'll suggest an alternative in my checkin of Defaults.py.in. .__archive_to_mbox(): the message being logged in the IOError exception case had a bad index, causing another exception.
* Archiver.InitVars(): Use the default perms for mkdir() -- reallybwarsaw1998-11-041-6/+4
| | | | | | | | | | | Mailman.Utils.mkdir() which are now 02775 by default. Archiver.__archive_file(): Use Mailman.Utils.open_ex() to open the mailbox file. Archiver.__archive_to_mbox(): In the except IOError clause, reraise the exception instead of just logging the error message. Turns out to be useful for debugging.
* Significantly rewritten to use a new model for private/public archivebwarsaw1998-11-031-113/+92
| | | | | | | | | | | | | handling. See the comment embedded in InitVars() for details. makelink(), breaklink(): Two new helper functions Archiver.archive_dir(): Public interface to other modules for getting the archive directory. Use this instead of accessing the attribute directly. (In general a good coding style to adhere to anyway). Archiver.ArchiveFile() => Archiver.__archive_file() since no other module uses this method.
* .ArchiveToMbox(): Remove gratuitous self.Save() - particularlyklm1998-11-031-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | problematic in a forked image of the list - both the parent and the child have the lock, and they're both going to use it! .ArchiveMail(): Do an os._exit() instead of a return in the case where ARCHIVE_TO_MBOX is 1 (mbox only). Otherwise we were returning to a second version of the caller, and havoc ensued...-) There is still a problem with not having the final os._exit() ensured as part of a "try:...finally:" clause, which actually causes redundancy in the operation of the post script. The problem is: - the post script, for example, calls ArchiveMail() within the try section of a try...finally - ArchiveMail() may encounter an exception before it hits the os._exit() - and thus, the stack frame will be popped back to post(), hitting the finally which gets executed. I'd like to just put the ArchiveMail()'s os._exit() in a finally clause, to make sure it always happens, but for some reason that is preventing tracebacks from making their way to the error log. We need to determine why that's happening, and do the right thing, otherwise we *are* getting multiple returns from routine when an exception occurs.
* changed the syntax ofcotton1998-10-261-9/+3
| | | | | | | | | import Mailman.<module> <module> = Mailman.<module> to from Mailman import <module> I didn't realize you could do this, thanx for letting me know, Barry scott
* code cleanup: put all the web archive related stuff into it's own subcotton1998-10-221-0/+265
package. Details: changed Makefile to add the sub package as a directory to make recursively in changed configure to make the replacements to Mailman/Archiver/Makefile.in changed Mailman/Makefile.in to add Archiver as a sub package moved Mailman/Archiver.py to Mailman/Archiver/Archiver.py and Mailman/Hyper* to Mailman/Archiver Mailman/pipermail.py to Mailman/Archiver/ created Mailman/Archiver/__init__.py to do a "from Archiver import *" in order to make it's interface identical to previously. import change: changed imports to import Mailman.<module> from import <module> in order to accomodate the package import semantics, also localized <module> by calling <module> = Mailman.<module>. see diffs for details if this sounds confusing, it's not. this change was applied to all of the moved files except pipermail, which didn't need it. did a basic new installation test to make sure all the Makefile/configure changes took place atleast basically correctly. scott