Mercurial > genshi > mirror
changeset 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 | 3f6582a5a4a5 |
children | f56046e4b0de |
files | ChangeLog genshi/output.py |
diffstat | 2 files changed, 15 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,16 @@ * Added #include directive for text templates (ticket #115). +Version 0.4.2 +http://svn.edgewall.org/repos/genshi/tags/0.4.2/ +(?, from branches/stable/0.4.x) + + * The `doctype` parameter of the markup serializers now also accepts the "name" + of the doctype as string, in addition to the `(name, pubid, sysid)` tuple. + * The I18n filter was not replacing the original attributes with the + translation, but instead adding a second attribute with the same name. + + Version 0.4.1 http://svn.edgewall.org/repos/genshi/tags/0.4.1/ (May 21 2007, from branches/stable/0.4.x)
--- 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: