summaryrefslogtreecommitdiff
path: root/Mailman/htmlformat.py
diff options
context:
space:
mode:
authorbwarsaw2001-05-31 16:09:28 +0000
committerbwarsaw2001-05-31 16:09:28 +0000
commit7d21059b9fbb5948125a74432bf5274a02a5c8c3 (patch)
tree5fe4975c30eb083261b555f4222d37b8ccf6cbd0 /Mailman/htmlformat.py
parent78f417ac7bc30d750934bb74fd922b001d20fd62 (diff)
downloadmailman-7d21059b9fbb5948125a74432bf5274a02a5c8c3.tar.gz
mailman-7d21059b9fbb5948125a74432bf5274a02a5c8c3.tar.zst
mailman-7d21059b9fbb5948125a74432bf5274a02a5c8c3.zip
Document: Set the default background color of the document to
mm_cfg.WEB_BGCOLOR. Document.set_bgcolor(): New method to set the bgcolor attribute. Document.Format(): Add self.bgcolor to the kws dictionary if it isn't already there (i.e. allow it to be overridden by the caller). This means that we don't need to pass the background color in the Format() call for most cases. Cleans up the code and parameterizes the background color for site customization.
Diffstat (limited to 'Mailman/htmlformat.py')
-rw-r--r--Mailman/htmlformat.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Mailman/htmlformat.py b/Mailman/htmlformat.py
index 86ed99ea1..bb4d5a575 100644
--- a/Mailman/htmlformat.py
+++ b/Mailman/htmlformat.py
@@ -278,6 +278,7 @@ class Label(Container):
class Document(Container):
title = None
language = None
+ bgcolor = mm_cfg.WEB_BGCOLOR
def set_language(self, lang=None):
self.language = lang
@@ -288,12 +289,15 @@ class Document(Container):
ctype += '; charset=' + Utils.GetCharSet(self.language)
return ctype
+ def set_bgcolor(self, color):
+ self.bgcolor = color
+
def SetTitle(self, title):
self.title = title
def Format(self, indent=0, **kws):
+ kws.setdefault('bgcolor', self.bgcolor)
tab = ' ' * indent
-
output = [self.get_content_type(),
'',
tab,