From 9294453a9968f60b9cc1a81d35374d88b4f30288 Mon Sep 17 00:00:00 2001 From: mailman Date: Fri, 10 Apr 1998 00:25:16 +0000 Subject: HeadlessDocument(): new variant of Document(), for templates that have their own section. --- Mailman/htmlformat.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'Mailman/htmlformat.py') 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\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): -- cgit v1.2.3-70-g09d2