diff options
| author | Barry Warsaw | 2008-12-25 23:57:07 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2008-12-25 23:57:07 -0500 |
| commit | b8e68e7577aa12e0e355aabe2845981f0d73e3b5 (patch) | |
| tree | 4d988c8de9e29b080ac258d0bc1e4eee8e5ee32b /mailman/Archiver/HyperArch.py | |
| parent | d4de7996e6d4fb5db04dfed3b3fd12747622b164 (diff) | |
| download | mailman-b8e68e7577aa12e0e355aabe2845981f0d73e3b5.tar.gz mailman-b8e68e7577aa12e0e355aabe2845981f0d73e3b5.tar.zst mailman-b8e68e7577aa12e0e355aabe2845981f0d73e3b5.zip | |
Diffstat (limited to 'mailman/Archiver/HyperArch.py')
| -rw-r--r-- | mailman/Archiver/HyperArch.py | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/mailman/Archiver/HyperArch.py b/mailman/Archiver/HyperArch.py index 0395f6482..a4dc13423 100644 --- a/mailman/Archiver/HyperArch.py +++ b/mailman/Archiver/HyperArch.py @@ -43,6 +43,7 @@ from email.Header import decode_header, make_header from locknix.lockfile import Lock from string import Template +from mailman import Defaults from mailman import Utils from mailman import i18n from mailman.Archiver import HyperDatabase @@ -50,6 +51,7 @@ from mailman.Archiver import pipermail from mailman.Mailbox import ArchiverMailbox from mailman.config import config + log = logging.getLogger('mailman.error') # Set up i18n. Assume the current language has already been set in the caller. @@ -174,7 +176,7 @@ def quick_maketext(templatefile, dict=None, lang=None, mlist=None): listname = mlist.fqdn_listname if lang is None: if mlist is None: - lang = config.DEFAULT_SERVER_LANGUAGE + lang = Defaults.DEFAULT_SERVER_LANGUAGE else: lang = mlist.preferred_language cachekey = (templatefile, lang, listname) @@ -250,7 +252,7 @@ class Article(pipermail.Article): self._lang = lang self._mlist = mlist - if config.ARCHIVER_OBSCURES_EMAILADDRS: + if Defaults.ARCHIVER_OBSCURES_EMAILADDRS: # Avoid i18n side-effects. Note that the language for this # article (for this list) could be different from the site-wide # preferred language, so we need to ensure no side-effects will @@ -325,7 +327,7 @@ class Article(pipermail.Article): if hasattr(self, '_mlist'): self._lang = self._mlist.preferred_language else: - self._lang = config.DEFAULT_SERVER_LANGUAGE + self._lang = Defaults.DEFAULT_SERVER_LANGUAGE if not d.has_key('cenc'): self.cenc = None if not d.has_key('decoded'): @@ -357,7 +359,7 @@ class Article(pipermail.Article): if email: self.decoded['email'] = email if subject: - if config.ARCHIVER_OBSCURES_EMAILADDRS: + if Defaults.ARCHIVER_OBSCURES_EMAILADDRS: with i18n.using_language(self._lang): atmark = _(' at ') subject = re.sub(r'([-+,.\w]+)@([-+.\w]+)', @@ -405,7 +407,7 @@ class Article(pipermail.Article): d["subject_html"] = self.quote(self.subject) d["subject_url"] = url_quote(self.subject) d["in_reply_to_url"] = url_quote(self.in_reply_to) - if config.ARCHIVER_OBSCURES_EMAILADDRS: + if Defaults.ARCHIVER_OBSCURES_EMAILADDRS: # Point the mailto url back to the list author = re.sub('@', _(' at '), self.author) emailurl = self._mlist.posting_address @@ -509,7 +511,7 @@ class Article(pipermail.Article): # Coerce the body to Unicode and replace any invalid characters. if not isinstance(body, unicode): body = unicode(body, cset, 'replace') - if config.ARCHIVER_OBSCURES_EMAILADDRS: + if Defaults.ARCHIVER_OBSCURES_EMAILADDRS: with i18n.using_language(self._lang): atmark = _(' at ') body = re.sub(r'([-+,.\w]+)@([-+.\w]+)', @@ -705,7 +707,7 @@ class HyperArchive(pipermail.T): # The TOC is always in the charset of the list's preferred language d['meta'] += html_charset % Utils.GetCharSet(mlist.preferred_language) # The site can disable public access to the mbox file. - if config.PUBLIC_MBOX: + if Defaults.PUBLIC_MBOX: template = 'archtoc.html' else: template = 'archtocnombox.html' @@ -962,7 +964,7 @@ class HyperArchive(pipermail.T): def write_index_entry(self, article): subject = self.get_header("subject", article) author = self.get_header("author", article) - if config.ARCHIVER_OBSCURES_EMAILADDRS: + if Defaults.ARCHIVER_OBSCURES_EMAILADDRS: try: author = re.sub('@', _(' at '), author) except UnicodeError: @@ -1038,7 +1040,7 @@ class HyperArchive(pipermail.T): def update_archive(self, archive): self.__super_update_archive(archive) # only do this if the gzip module was imported globally, and - # gzip'ing was enabled via config.GZIP_ARCHIVE_TXT_FILES. See + # gzip'ing was enabled via Defaults.GZIP_ARCHIVE_TXT_FILES. See # above. if gzip: archz = None @@ -1135,7 +1137,7 @@ class HyperArchive(pipermail.T): if j != -1 and (j < k or k == -1): text = jr.group(1) length = len(text) - if config.ARCHIVER_OBSCURES_EMAILADDRS: + if Defaults.ARCHIVER_OBSCURES_EMAILADDRS: text = re.sub('@', atmark, text) URL = self.maillist.GetScriptURL( 'listinfo', absolute=1) |
