Mercurial > genshi > mirror
diff genshi/output.py @ 494:942d73ba938c trunk
The `doctype` parameter for serializers can now be a string.
author | cmlenz |
---|---|
date | Wed, 30 May 2007 09:33:54 +0000 |
parents | 2f13c5fc4a4d |
children | 7553760b58af |
line wrap: on
line diff
--- a/genshi/output.py +++ b/genshi/output.py @@ -150,12 +150,16 @@ :param doctype: a ``(name, pubid, sysid)`` tuple that represents the DOCTYPE declaration that should be included at the top - of the generated output + of the generated output, or the name of a DOCTYPE as + defined in `DocType.get` :param strip_whitespace: whether extraneous whitespace should be stripped from the output + :note: Changed in 0.4.2: The `doctype` parameter can now be a string. """ self.preamble = [] if doctype: + if isinstance(doctype, basestring): + doctype = DocType.get(doctype) self.preamble.append((DOCTYPE, doctype, (None, -1, -1))) self.filters = [EmptyTagFilter()] if strip_whitespace: