summaryrefslogtreecommitdiff
path: root/Mailman/Archiver/HyperArch.py
Commit message (Collapse)AuthorAgeFilesLines
* Bite the bullet: rename the Mailman package to mailman.Barry Warsaw2008-02-271-1270/+0
|
* Tweak copyright years.Barry Warsaw2008-02-071-1/+1
|
* Much progress, though not perfect, on migrating to SQLAlchemy 0.4 and ElixirBarry Warsaw2007-10-311-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 0.4. Lots of things changes, which broke lots of our code. There are still a couple of failures in the test suite that I don't understand. It seems that for pending.txt and requests.txt, sometimes strings come back from the database as 8-bit strings and other times as unicodes. It's impossible to make these tests work both separately and together. users.txt is also failing intermittently. Lots of different behavior between running the full test suite all together and running individual tests. Sigh. Note also that actually, Elixir 0.4.0 doesn't work for us. There's a bug in that version that prevented zope.interfaces and Elixir working together. Get the latest 0.4.0 from source to fix this. Other changes include: - Remove Mailman/lockfile.py. While I haven't totally eliminated locking, I have released the lockfile as a separate Python package called locknix, which Mailman 3.0 now depends on. - Renamed Mailman/interfaces/messagestore.py and added an IMessage interface. - bin/testall raises turns on SQLALCHEMY_ECHO when the verbosity is above 3 (that's three -v's because the default verbosity is 1). - add_domain() in config files now allows url_host to be optional. If not given, it defaults to email_host. - Added a non-public interface IDatabase._reset() used by the test suite to zap the database between doctests. Added an implementation in the model which just runs through all rows in all entities, deleting them. - [I]Pending renamed to [I]Pended - Don't allow Pendings.add() to infloop. - In the model's User impelementations, we don't need to append or remove the address when linking and unlinking. By setting the address.user attribute, SQLAlchemy appears to do the right thing, though I'm not 100% sure of that (see the above mentioned failures).
* General cleanups some of which is even tested <wink>. Mailman.LockFile moduleBarry Warsaw2007-10-101-3/+3
| | | | | | | | | | | | | is moved to Mailman.lockfile. Remove a few more MailList methods that aren't used any more, e.g. the lock related stuff, the Save() and CheckValues() methods, as well as ChangeMemberName(). Add a missing import to lifecycle.py. We no longer need withlist to unlock the mailing list. Also, expose config.db.flush() in the namespace of withlist directly, under 'flush'.
* Implement a context manager for Python 2.5's with statement, which isBarry Warsaw2007-09-191-45/+10
| | | | | | | | used where we used to do a try/except to temporarily change the global translation language. This makes the code shorter and cleaner. E.g. with i18n.using_language(another_language): # do something
* Other than contrib files, convert all imports of mm_cfg to imports of config.Barry Warsaw2007-07-141-16/+16
| | | | | | | | | | | Ignore mailman.egg-info In bin/make_instance.py: Catch and ignore import errors when importing Mailman.i18n. Before this script has actually been run, there won't be enough infrastructure in place of the import to succeed. Include several other fixes in this file. Add install_requires to the setup script.
* Update copyright years.bwarsaw2007-01-191-1/+1
|
* A little more internal_name() to fqdn_listname changes.tkikuchi2006-12-031-4/+4
|
* Added '(by thread)' to the previous and next message links to emphasize thatmsapiro2006-06-111-2/+2
| | | | even if you got to the message from a subject, date or author index, previous and next are still by thread.
* Remove most uses of the types module, in favor of isinstance checks againstbwarsaw2006-04-171-4/+3
| | | | | | the builtin types. Two still remain: a check against ClassType and a check against MethodType. Also, fix some hinky type comparisons to use isinstance() consistently.
* - Convert all logging to Python's standard logging module. Get rid of allbwarsaw2006-04-171-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | traces of our crufty old Syslog. Most of this work was purely mechanical, except for: 1) Initializing the loggers. For this, there's a new module Mailman/loginit.py (yes all modules from now on will use PEP 8 names). We can't call this 'logging.py' because that will interfere with importing the stdlib module of the same name (can you say Python 2.5 and absolute imports?). If you want to write log messages both to the log file and to stderr, pass True to loginit.initialize(). This will turn on propagation of log messages to the parent 'mailman' logger, which is set up to print to stderr. This is how bin/qrunner works when not running as a subprocess of mailmanctl. 2) The driver script. I had to untwist the StampedLogger stuff and implement differently printing exceptions and such to log/error because standard logging objects don't have a write() method. So we write to a cStringIO and then pass that to the logger. 3) SMTPDirect.py because of the configurability of the log messages. This required changing SafeDict into a dict subclass (which is better than using UserDicts anyway -- yay Python 2.3!). It's probably still possible to flummox things up if you change the name of the loggers in the SMTP_LOG_* variables in mm_cfg.py. However, the worst you can do is cause output to go to stderr and not go to a log file. Note too that all entry points into the Mailman system must call Mailman.loginit.initialize() or the log output will go to stderr (which may occasionally be what you want). Currently all CGIs and qrunners should be working properly. I wish I could have tested all code paths that touch the logger, but that's infeasible. I have tested this, but it's possible that there were some mistakes in the translation. - Mailman.Bouncers.BounceAPI.Stop is a singleton, but not a class instance any more. - True/False code cleanup, PEP 8 import restructuring, whitespace normalization, and copyright year updates, as appropriate.
* Now that Python 2.3 is the minimum requirement for Mailman 2.2:bwarsaw2006-04-151-20/+12
| | | | | | | | | | | - Remove True/False binding cruft - Remove __future__ statements for nested scopes - Remove ascii_letters import hack from Utils.py - Remove mimetypes.guess_all_extensions import hack from Scrubber.py - In Pending.py, set _missing to object() (better than using []) Also, update copyright years where appropriate, and re-order imports more to my PEP 8 tastes. Whitespace normalize.
* Added missing import of Errors module.msapiro2006-03-201-0/+1
|
* Back out Revision 2.30 patch for email.Message.set_payload() bugtkikuchi2006-01-291-7/+2
| | | | because it is overwrapped in Mailman.Message.
* Text file '@' obfuscation bug (unicode) fix. Thanks Mark.tkikuchi2006-01-091-3/+8
|
* Port cleaning changes forward from 2.1-maint branch.bwarsaw2005-12-301-1/+2
|
* Fixes for email.set_payload() not distinguish parsed or virgin payload.tkikuchi2005-12-241-1/+6
|
* Finnish dialect of "Re:".tkikuchi2005-11-011-1/+1
|
* Obfuscate email address in the subject line.tkikuchi2005-10-311-0/+9
|
* Obscure email when the poster doesn't set full name in From:.tkikuchi2005-09-191-1/+5
|
* back porting from 2.1.6tkikuchi2005-08-281-27/+64
|
* FSF office has moved. chdcking in for MAIN branch.tkikuchi2005-08-271-1/+1
|
* quick_maketext(): Richard Barrett's patch for bug #730769, with minorbwarsaw2003-05-121-6/+36
| | | | | | stylistic modifications. This fixes caching by adding the listname to the cache key. Otherwise, lists with local overriding templates would find the wrong template. Uses the new Utils.findtext() interface.
* volNameToDate(): Catch failures in time.mktime() which can happen ifbwarsaw2003-01-191-15/+18
| | | | the year is weird (e.g. 1969). Also, code cleanup.
* Copyright years.bwarsaw2003-01-101-1/+1
|
* Article.__init__(): Watch out for tuples coming back frombwarsaw2003-01-101-0/+3
| | | | | message.get_param(). Such beasts are RFC 2231 charsets which need to be converted to unicode.
* __processbody_URLquote(): Tokio Kikuchi's patch #658598 to fix rc1 bugbwarsaw2002-12-261-1/+3
| | | | in email obscuring in the body of the message.
* __processbody_URLquote(): Obscure email addresses in the body ofbwarsaw2002-12-241-1/+6
| | | | messages when ARCHIVER_OBSCURES_EMAILADDRS is true.
* Martin's patch #655214 to fix multi-charset archiving. He says:bwarsaw2002-12-241-108/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch restores MIME charset capabilities for article archiving in CVS Mailman. It: - removes the .charset attribute from articles; all yarticles are encoded in the list's charset, - decodes subject and author to Unicode; if this fails, no decoding (not even MIME) is done to subject and author, - MIME-decodes the body in the constructor using get_payload, removes the hand-crafted qp decoding from _get_body, - Unicode-decodes the body in the constructor if the body's charset differs from the list's charset, - fixes processbody_URLquote to always return byte strings (by escaping the URL also); comparing the old and the new string is no longer possible since the old string is Unicode and the new string is a list-encoded byte string. - changes text archiving to have the archives in the list's encoding, with unsupported characters 'replace'd With these changes, I can process the playground archives correctly, to get mojibake-free pages.
* Tokio Kikichi's patch for multibyte i18n problems. Patch #646884,bwarsaw2002-12-081-39/+60
| | | | | | | | | | | | | | | | | | | | | | | explanations: HyperArch.py in 2.1b5 use Utils.uquote() for CGIescape() and html_quote() but it does not take language argument. This is no good for multilbyte charset because characters are escaped in separate 8bit bytes which results in mojibake. We should rather use Utils.uncanonstr() to honor the legal characters within the multibyte charset. This patch fixes other minor bugs in the current code. and... Utils.uquote() makes a multibyte character into two or more fragmants of Latin-1 characters. Utils.uquote() makes all the 8bit-set character escaped while Utils.uncanonstr() checks if the character is within the charset and escapes only if the chatacter is not legal. Some additional minor code cleanup by Barry.
* decode_charset(): Greg Ward's patch for SF # 649007. If there is anbwarsaw2002-12-071-2/+2
| | | | | | unknown character set specified in an RFC 2047 encoded header, or in the Content-Type of one of the parts, we'd get a LookupError. This simply moves the make_header() call to inside the try/except.
* sizeof(): Watch out for ENOENT exceptions which can happen if the mboxbwarsaw2002-12-071-1/+7
| | | | | | | file was moved or deleted, and an explicit mbox file name was given to bin/arch. Closes SF # 649011
* update_article(): Reword the messages for proper i18n style. Closesbwarsaw2002-12-051-6/+9
| | | | SF bug #648604.
* setListIfUnset(): Greg Ward's patch to actually make this work. ;)bwarsaw2002-12-051-2/+1
| | | | Closes SF bug #648607
* setListIfUnset(): Hack to set self._mlist if it isn't already set.bwarsaw2002-12-021-12/+36
| | | | | | | | | | | | | | | | | | | | | | | This is needed to fully fix SF bug #644294. Old archived Articles won't have the _mlist attribute but we really want that for better handling of page creation. Unfortunately, only the HyperDatabase knows this value so this is a public method it can call after the fact. as_html(): Fix address obscuring in the article pages. If ARCHIVER_OBSCURES_EMAILADDRS is true, then we'll `at-ify' the visible author text and point the mailto: to the list's posting address. HyperArchive.__init__(): Pass the maillist to the HyperDatabase constructor. write_index_entry(): If ARCHIVER_OBSCURES_EMAILADDRS, `at-ify' the author field in the index. This might catch non-addresses with @'s in them, but so what? For the most part, it'll moderately obscure email addresses. __processbody_URLquote(): Futile attempt at code cleaning for a method that I don't think ever gets called. :/
* quick_maketext(): Copy the body of the try: from Utils.maketext() forbwarsaw2002-11-181-8/+14
| | | | | | | | | | | | completeness (this really needs to be refactored). Article.as_html(): Set the encoding of the page to the list's preferred encoding, which seems to make the headers and bodies come out okay when mixing languages -- at least as in the minimal testing I've been able to do. Woo boy, I'm really not positive about this change and would love a second opinion. Martin?
* Simplification and fixes for i18n in the archives. This is related tobwarsaw2002-11-181-62/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | SF patch #634303, but I think it's better because it actually removes code instead of adding it. We'll see what kind of holes Martin shoots through my optimism. ;) Specifically, unicode_quote() -> Utils.uquote() everywhere quick_maketext(): We can get rid of the `raw' argument since we're never going to wrap html text here. Also, put in a defense for lang=None and mlist=None (although in practice that doesn't happen). Finally -- and this is the key -- pass the interpolated text through Utils.uncanonstr() so that what we get back will be a unicode, with any characters outside the lang's charset html-ified. I think this simplifies matters by always encoding the indices to the charset of the list's preferred language, at the expense of potentially larger pages (which I don't care about). html_TOC(): Add a http-equiv meta tag indicating the charset of this page, which should fix display for the table of contents. Note that the various archtoc.html templates need updating but I will check those changes in next. HyperArchive.add_article(), .choose_charset(), .update_dirty_archives(): Removed.
* decode_charset(): We no longer need the EncWord module, sincebwarsaw2002-11-121-16/+23
| | | | | | email.Header should be sufficient. This change uses decode_header() from email.Header instead of EncWord.decode(). The EncWord.py module will be removed.
* __getstate__(), __setstate__(): Be slightly more defensive.bwarsaw2002-11-071-6/+14
|
* as_html(): Add a link to the listinfo page for the mailing list.bwarsaw2002-11-041-0/+2
|
* Fixes for terrible performance hits after the i18n patches werebwarsaw2002-11-041-22/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | applied. The problems were twofold: - The _mlist attribute of Article objects was being pickled, causing the *-article pickles to be around 10x too big. - The article template files were being opened and re-read for each article. Fixes include pickling only a reference to the mailing list (i.e its internal name), and caching both the MailList objects and the template files. Specifically, quick_maketext(): Front-end to the template cache, this has the same signature as Utils.maketext(), but it caches as much of the results as possible. Article._open_list(): A MailList cache, stolen from Runner.py. Can you say "re-factor"? Article.__getstate__(): Don't pickle the _mlist instance, instead, return an __listname key which contains the internal name of the mailing list. Article.__setstate__(): Watch for __listname and call _open_list() to get a real MailList object. Everywhere: Use quick_maketext() instead of Utils.make_text() to take advantage of the template cache.
* Get rid of all the manipulations of the MailList object's lock file.bwarsaw2002-10-191-6/+2
| | | | HyperArch should have nothing to do with it.
* Add a work around for the default small stack size on MacOSX.bwarsaw2002-10-181-0/+19
| | | | | Apparently pipermail tickles a well-known bug on OSX related to deeply recursive regular expressions.
* __init__(): Somehow the archiver was unlocking the list at an oddbwarsaw2002-10-151-1/+1
| | | | | time. I can't figure out why that's happening but defaulting unlock to false seemed to take care of the problem... for now. :(
* Whitespace normalization and some Pychecker cleanup.bwarsaw2002-10-091-8/+7
|
* _makeArticle(): Override base class method so that we create abwarsaw2002-10-091-1/+6
| | | | | HyperArch.Article instead -- which takes two extra constructor arguments.
* Integrating SF patch #594771, i18n'ified pipermail.bwarsaw2002-10-081-368/+411
| | | | | | | | | | | | | | | | | | | sizeof(): Grows a lang argument. Class Article: - grows attributes _lang, _mlist - default self.charset to the server language's charset - constructor grows a lang and and mlist argument - new __setstate__() method for backcompat with older (pickled) archives - as_html(): use i18n.ctime() - in many places, use standard language templates. All inlined tqs templates in this file have been removed. - volNameToDesc(): new Code cleanup. Whitespace normalization.
* as_html(): Patch #546362 by Nicholas Russo to include the Subject: andbwarsaw2002-08-231-0/+2
| | | | | In-Reply-To: information in archive mailto urls. Closes bug #443952 reported by Stig Hackvan.
* QuoteHyperChars() -> websafe()bwarsaw2002-05-221-2/+2
| | | | | Also, use Utils.websafe() consistently throughout, instead of the inconsistent calls to cgi.escape().
* Integrating a patch from Martin v. Loewis related to i18n; quoting:bwarsaw2002-05-041-38/+86
| | | | | | | | | | | | | | | | | | | With this, you should be able to observe the following effects: - when reading the mailbox in current mailman, the index will be windows-1257; there will be lots of garbage MIME text - when applying my patch, the utf-8 and iso-8859-1 parts of it will become readable. Japanese and Korean text (in the name of two message authors) will remain obscure. - when making available the Japanese MIME charset names, the Japanese name will become readable (to those which can read Japanese, that is) - when adding the Korean codecs, the Korean name will also become readable - in all cases, the subject encoded x-mvl will remain MIME garbage.