summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Mailman/htmlformat.py11
-rw-r--r--modules/htmlformat.py11
2 files changed, 20 insertions, 2 deletions
diff --git a/Mailman/htmlformat.py b/Mailman/htmlformat.py
index 53bfe1240..9e8228d6f 100644
--- a/Mailman/htmlformat.py
+++ b/Mailman/htmlformat.py
@@ -3,7 +3,7 @@
Encapsulate HTML formatting directives in classes that act as containers
for python and, recursively, for nested HTML formatting objects."""
-__version__ = "$Revision: 394 $"
+__version__ = "$Revision: 404 $"
# Eventually could abstract down to HtmlItem, which outputs an arbitrary html
# object given start / end tags, valid options, and a value.
@@ -266,6 +266,15 @@ class Document(Container):
output = output + Container.Format(self, indent)
output = output + '%s</html>\n' % spaces
return output
+
+class HeadlessDocument(Document):
+ """Document without head section, for templates that provide their own."""
+ def Format(self, indent=0, **kw):
+ output = 'Content-type: text/html\n\n'
+ spaces = ' ' * indent
+ output = output + spaces
+ output = output + Container.Format(self, indent)
+ return output
class StdContainer(Container):
def Format(self, indent=0):
diff --git a/modules/htmlformat.py b/modules/htmlformat.py
index 53bfe1240..9e8228d6f 100644
--- a/modules/htmlformat.py
+++ b/modules/htmlformat.py
@@ -3,7 +3,7 @@
Encapsulate HTML formatting directives in classes that act as containers
for python and, recursively, for nested HTML formatting objects."""
-__version__ = "$Revision: 394 $"
+__version__ = "$Revision: 404 $"
# Eventually could abstract down to HtmlItem, which outputs an arbitrary html
# object given start / end tags, valid options, and a value.
@@ -266,6 +266,15 @@ class Document(Container):
output = output + Container.Format(self, indent)
output = output + '%s</html>\n' % spaces
return output
+
+class HeadlessDocument(Document):
+ """Document without head section, for templates that provide their own."""
+ def Format(self, indent=0, **kw):
+ output = 'Content-type: text/html\n\n'
+ spaces = ' ' * indent
+ output = output + spaces
+ output = output + Container.Format(self, indent)
+ return output
class StdContainer(Container):
def Format(self, indent=0):