summaryrefslogtreecommitdiff
path: root/mailman/Archiver/HyperArch.py
diff options
context:
space:
mode:
Diffstat (limited to 'mailman/Archiver/HyperArch.py')
-rw-r--r--mailman/Archiver/HyperArch.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/mailman/Archiver/HyperArch.py b/mailman/Archiver/HyperArch.py
index 7b65d2f82..d9477cc3f 100644
--- a/mailman/Archiver/HyperArch.py
+++ b/mailman/Archiver/HyperArch.py
@@ -40,10 +40,10 @@ import binascii
from email.Charset import Charset
from email.Errors import HeaderParseError
from email.Header import decode_header, make_header
+from lazr.config import as_boolean
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
@@ -176,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 = Defaults.DEFAULT_SERVER_LANGUAGE
+ lang = config.mailman.default_language
else:
lang = mlist.preferred_language
cachekey = (templatefile, lang, listname)
@@ -252,7 +252,7 @@ class Article(pipermail.Article):
self._lang = lang
self._mlist = mlist
- if Defaults.ARCHIVER_OBSCURES_EMAILADDRS:
+ if as_boolean(config.archiver.pipermail.obscure_email_addresses):
# 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
@@ -327,7 +327,7 @@ class Article(pipermail.Article):
if hasattr(self, '_mlist'):
self._lang = self._mlist.preferred_language
else:
- self._lang = Defaults.DEFAULT_SERVER_LANGUAGE
+ self._lang = config.mailman.default_language
if not d.has_key('cenc'):
self.cenc = None
if not d.has_key('decoded'):
@@ -359,7 +359,7 @@ class Article(pipermail.Article):
if email:
self.decoded['email'] = email
if subject:
- if Defaults.ARCHIVER_OBSCURES_EMAILADDRS:
+ if as_boolean(config.archiver.pipermail.obscure_email_addresses):
with i18n.using_language(self._lang):
atmark = _(' at ')
subject = re.sub(r'([-+,.\w]+)@([-+.\w]+)',
@@ -407,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 Defaults.ARCHIVER_OBSCURES_EMAILADDRS:
+ if as_boolean(config.archiver.pipermail.obscure_email_addresses):
# Point the mailto url back to the list
author = re.sub('@', _(' at '), self.author)
emailurl = self._mlist.posting_address
@@ -511,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 Defaults.ARCHIVER_OBSCURES_EMAILADDRS:
+ if as_boolean(config.archiver.pipermail.obscure_email_addresses):
with i18n.using_language(self._lang):
atmark = _(' at ')
body = re.sub(r'([-+,.\w]+)@([-+.\w]+)',
@@ -707,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 Defaults.PUBLIC_MBOX:
+ if as_boolean(config.archiver.pipermail.public_mbox):
template = 'archtoc.html'
else:
template = 'archtocnombox.html'
@@ -964,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 Defaults.ARCHIVER_OBSCURES_EMAILADDRS:
+ if as_boolean(config.archiver.pipermail.obscure_email_addresses):
try:
author = re.sub('@', _(' at '), author)
except UnicodeError:
@@ -1137,7 +1137,8 @@ class HyperArchive(pipermail.T):
if j != -1 and (j < k or k == -1):
text = jr.group(1)
length = len(text)
- if Defaults.ARCHIVER_OBSCURES_EMAILADDRS:
+ if as_boolean(
+ config.archiver.pipermail.obscure_email_addresses):
text = re.sub('@', atmark, text)
URL = self.maillist.script_url('listinfo')
else: