# HG changeset patch # User cmlenz # Date 1180517733 0 # Node ID 90eecd360b1862bc0a07166c28614c2c327b9456 # Parent 37f94b46e42457cd1cfc2d467295c86c70cce6c6 Ported [594:596] to 0.4.x branch. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +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) diff --git a/MANIFEST.in b/MANIFEST.in --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,4 @@ exclude doc/2000ft.graffle -exclude doc/docutils.conf recursive-exclude doc/logo.lineform * -exclude doc/Makefile include doc/api/*.* include doc/*.html diff --git a/genshi/filters/i18n.py b/genshi/filters/i18n.py --- a/genshi/filters/i18n.py +++ b/genshi/filters/i18n.py @@ -129,7 +129,7 @@ yield kind, data, pos continue - new_attrs = list(attrs) + new_attrs = [] changed = False for name, value in attrs: newval = value diff --git a/genshi/output.py b/genshi/output.py --- 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: diff --git a/genshi/template/base.py b/genshi/template/base.py --- a/genshi/template/base.py +++ b/genshi/template/base.py @@ -297,7 +297,8 @@ template was found :param filename: the name of the template file, relative to the given base directory - :param loader: the `TemplateLoader` to use for load included templates + :param loader: the `TemplateLoader` to use for loading included + templates :param encoding: the encoding of the `source` :param lookup: the variable lookup mechanism; either "lenient" (the default), "strict", or a custom lookup class diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -119,5 +119,5 @@ genshi-text = genshi.template.plugin:TextTemplateEnginePlugin[plugin] """, - cmdclass={'build_doc': build_doc, 'test_doc': test_doc} + cmdclass = {'build_doc': build_doc, 'test_doc': test_doc} )