summaryrefslogtreecommitdiff
path: root/Mailman/Archiver (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* TOC_entry_template: generate the entire "Text" table cell (see below).bwarsaw1998-11-061-13/+48
| | | | | | | | | | | | | | | | | | html_TOC(): We're even more sophisticated when generating the Text cell. We first look for the .txt.gz file and then the .txt file, plunking in the link and some extra explanatory text depending on what we find. If we find nothing, we suppress the entire cell. Also, we calculate the size (approximately) and give an indication in the cell text. ALSO: it is realized that nothing special has to be handled to promote .txt to .txt.gz when gzip `suddenly appears'. The current algorithm already handles this. Note there's not much we can do if it suddenly disappears (since we can't un-gzip it if the module's not available!). import sys at top of file instead of multiple places where used. also convert all sys.stderr.write()'s to self.message() so they'll honor the VERBOSE flag.
* ArchiveMail(): in the finally, be sure to flush stderr or we'll neverbwarsaw1998-11-061-0/+2
| | | | see the exception traceback!
* removed the os.umask in HyperArchive.__init__, as this is now taken carecotton1998-11-051-6/+0
| | | | | | of with the integration of all open's and mkdir's with the corresponding functions in Utils. scott
* added a snippet to T.__init__ to make it possible to move archivescotton1998-11-051-0/+8
| | | | | | | | | | | from one place to another. simply take the basedir argument as precedent over the saved state version of basedir. I initially considered doing this for the purpose of upgrading list html archives from cvs sources between b5 and b6. Seems as though anyone who set up pipermail archiving previously will benefit from the change, and that it's a good thing for the pipermail module to. scott
* 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
* gzip'ing of the raw text file is only enabled when gzip, and thusbwarsaw1998-11-051-15/+25
| | | | | | | | | | | | | | | | | | | zlib, can be imported. However zlib is not a standard Python module so it may not exist. In that case, use the raw text file. Specific changes: Try to import gzip globally. If this fails, set gzip=None for test down below. TOC_entry_template, use %(gzip)s to conditionalize htmlToc(): set the key 'gzip' to '.gz' or '' depending on the value of gzip update_dirty_archives(): factor out file names so 1) they don't have to be recalculated more than once, and 2) so the lines are < 80 chars wide! Also execute gzip algorithm only if gzip is true, and thus the gzip module successfully imported.
* TOC_entry_template: The raw text file is stored on disk as a txt.gz file.bwarsaw1998-11-051-1/+1
|
* .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.
* Changes to avoid having to chmod files, which may fail.bwarsaw1998-11-041-15/+14
| | | | | | | | | | | | | | Import open_ex() from Mailman.Utils and assign it to open in the module's globals, so this gets picked up before builtin open. Saves rewriting lots of occurances of open(), but could be confusing when reading a method. Hmmm... __version__ is appended to indicate that this is a Mailman-hacked versio of Pipermail. Use Mailman.Utils.mkdir() instead of os.mkdir(). All chmod()s are commented out, they are obsolete.
* Changes to avoid having to chmod files, which may fail.bwarsaw1998-11-041-2/+5
| | | | | | | | | | | | | | Import open_ex() from Mailman.Utils and assign it to open in the module's globals, so this gets picked up before builtin open. Saves rewriting lots of occurances of open(), but could be confusing when reading a method. Hmmm... __openIndices(): If the `database' directory does not exist, create it specifically with mode = 02770. We want o-rx so this directory is not accessible when the archive is public. But we must have g+wxs or the competing processes (mail and web) that try to update these files (when a message is posted, or web approved after being held), can get to and write the files.
* Changes to avoid having to chmod files, which may fail.bwarsaw1998-11-041-3/+9
| | | | | | | | | | | Import open_ex() from Mailman.Utils and assign it to open in the module's globals, so this gets picked up before builtin open. Saves rewriting lots of occurances of open(), but could be confusing when reading a method. Hmmm... Changes to the default values for DIRMODE and FILEMODE. HyperArchive.add_article(): use mkdir() from Mailman.Utils
* 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.
* __openIndices(): Wrap the os.mkdir() call in a umask setting of 0 andbwarsaw1998-11-031-2/+8
| | | | | don't set the mod of the directory to 700. (permissions on the parent directory are sufficient).
* TQS (triple quoted strings) formatting mods for more Emacs friendlybwarsaw1998-11-031-19/+21
| | | | | | | | code. Coding style hint: When TQS'ing HTML, please use single quotes instead of double quotes. It is much more common to find double quotes in HTML, which screws up font-lock when DQTQS'es are used :-)
* Ignore generated Makefilebwarsaw1998-11-031-0/+1
|
* .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-263-13/+5
| | | | | | | | | 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
* Looks like this makefile didn't make it into the series of updatescotton1998-10-231-0/+73
| | | | | moving the archiving stuff to a sub package. scott
* code cleanup: put all the web archive related stuff into it's own subcotton1998-10-225-0/+2177
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