# HG changeset patch
# User cmlenz
# Date 1180718507 0
# Node ID 0742f421caba747967488b1f8fd443931162b959
# Parent 869b7885a516483c1916628d771fe4bbfce7b1f3
Merged revisions 487-603 via svnmerge from
http://svn.edgewall.org/repos/genshi/trunk
diff --git a/COPYING b/COPYING
--- a/COPYING
+++ b/COPYING
@@ -1,4 +1,4 @@
-Copyright (C) 2006 Edgewall Software
+Copyright (C) 2006-2007 Edgewall Software
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,54 @@
+Version 0.5
+http://svn.edgewall.org/repos/genshi/tags/0.5.0/
+(?, from branches/stable/0.5.x)
+
+ * 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)
+
+ * Fix incorrect reference to translation function in the I18N filter.
+ * The `ET()` function now correctly handles attributes with a namespace.
+ * XML declarations are now processed internally, as well as written to the
+ output when XML serialization is used (ticket #111).
+ * Added the functions `encode()` and `get_serializer()` to the `genshi.output`
+ module, which provide a lower-level API to the functionality previously only
+ available through `Stream.render()` and `Stream.serialize()`.
+ * The `DocType` class now has a `get(name)` function that returns a `DOCTYPE`
+ tuple for a given string.
+ * Added frameset variants to the `DocType` constants for HTML 4.01 and XHTML
+ 1.0.
+ * Improved I18n extraction for pluralizable messages: for any translation
+ function with multiple string arguments (such as ``ngettext``), a single
+ item with a tuple of strings is yielded, instead an item for each string
+ argument.
+ * The `HTMLFormFiller` stream filter no longer alters form elements for which
+ the data element contains no corresponding item.
+ * Code in `` processing instructions no longer gets the special
+ treatment as Python code in template expressions, i.e. item and attribute
+ access are no longer interchangeable (which was broken in a number of ways
+ anyway, see ticket #113). This change does not affect expressions.
+ * Numerous fixes for the execution of Python code in `` processing
+ instructions (tickets #113 and #114).
+ * The `py:def` (and `#def`) directive now supports "star args" (i.e. `*args`
+ and `**kwargs`) in the function declaration (ticket #116).
+
+
Version 0.4
http://svn.edgewall.org/repos/genshi/tags/0.4.0/
-(?, from branches/stable/0.4.x)
+(Apr 16 2007, from branches/stable/0.4.x)
* New example applications for CherryPy and web.py.
* The template loader now uses a LRU cache to limit the number of cached
@@ -30,7 +78,39 @@
* `MarkupTemplate`s can now be instantiated from markup streams, in addition
to strings and file-like objects (ticket #69).
* Improve handling of incorrectly nested tags in the HTML parser.
- * Template includes can you be nested inside fallback content.
+ * Template includes can now be nested inside fallback content.
+ * Expressions can now contain dict literals (ticket #37).
+ * It is now possible to have one or more escaped dollar signs in front of a
+ full expression (ticket #92).
+ * The `Markup` class is now available by default in template expressions
+ (ticket #67).
+ * The handling of namespace declarations in XML/XHTML output has been improved.
+ * The `Attrs` class no longer automatically wraps all attribute names in
+ `QName` objects. This is now the responsibility of whoever is instantiating
+ `Attrs` objects (for example, stream filters and generators).
+ * Python code blocks are now supported using the `` processing
+ instruction (ticket #84).
+ * The way errors in template expressions are handled can now be configured. The
+ option `LenientLookup` provides the same forgiving mode used in previous
+ Genshi versions, while `StrictLookup` raises exceptions when undefined
+ variables or members are accessed. The lenient mode is still the default in
+ this version, but that may change in the future. (ticket #88)
+ * If a variable is not necessarily defined at the top level of the template
+ data, the new built-in functions `defined(key)` and `value_of(key, default)`
+ can be used so that the template also works in strict lookup mode. These
+ functions were previously only available when using Genshi via the template
+ engine plugin (for compatibility with Kid).
+ * `style` attributes are no longer allowed by the `HTMLSanitizer` by default.
+ If they are explicitly added to the set of safe attributes, any unicode
+ escapes in the attribute value are now handled properly.
+ * Namespace declarations on conditional elements (for example using a `py:if`
+ directive`) are no longer moved to the following element when the element
+ originally carrying the declaration is removed from the stream (ticket #107).
+ * Added basic built-in support for internationalizing templates by providing
+ a new `Translator` class that can both extract localizable strings from a
+ stream, and replace those strings with their localizations at render time.
+ The code for this was largely taken from previous work done by Matt Good
+ and David Fraser.
Version 0.3.6
diff --git a/MANIFEST.in b/MANIFEST.in
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,5 +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/UPGRADE.txt b/UPGRADE.txt
--- a/UPGRADE.txt
+++ b/UPGRADE.txt
@@ -4,19 +4,23 @@
Upgrading from Genshi 0.3.x to 0.4.x
------------------------------------
-The `genshi.template` module has been refactored into a package with
-multiple modules. While code using the normal templating APIs should
-continue to work without problems, you should make sure to remove any
-leftover traces of the `template.py` file on the installation path.
-This is not necessary when Genshi was installed as a Python egg.
+The modules ``genshi.filters`` and ``genshi.template`` have been
+refactored into packages containing multiple modules. While code using
+the regular APIs should continue to work without problems, you should
+make sure to remove any leftover traces of the ``template.py`` file on
+the installation path. This is not necessary when Genshi was installed
+as a Python egg.
Results of evaluating template expressions are no longer implicitly
called if they are callable. If you have been using that feature, you
will need to add the parenthesis to actually call the function.
Instances of `genshi.core.Attrs` are now immutable. Filters
-manipulating the attributes in a stream may need to be updated. See
-the documentation of the `Attrs` class for more information.
+manipulating the attributes in a stream may need to be updated. Also,
+the `Attrs` class no longer automatically wraps all attribute names
+in `QName` objects, so users of the `Attrs` class need to do this
+themselves. See the documentation of the `Attrs` class for more
+information.
Upgrading from Markup
@@ -40,7 +44,7 @@
has been renamed to:
- `markup.template.MarkupTemplate`
+ `genshi.template.MarkupTemplate`
If you've been using the Template class directly, you'll need to
update your code (a simple find/replace should do--the API itself
diff --git a/doc/2000ft.graffle b/doc/2000ft.graffle
--- a/doc/2000ft.graffle
+++ b/doc/2000ft.graffle
@@ -56,7 +56,7 @@
TextText
- {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410
+ {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
@@ -91,7 +91,7 @@
TextText
- {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410
+ {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
@@ -126,7 +126,7 @@
TextText
- {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410
+ {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
@@ -161,7 +161,7 @@
TextText
- {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410
+ {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
@@ -196,7 +196,7 @@
TextText
- {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410
+ {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
@@ -273,7 +273,7 @@
TextText
- {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410
+ {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
@@ -347,7 +347,7 @@
TextText
- {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410
+ {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
{\fonttbl\f0\fswiss\fcharset77 Helvetica-BoldOblique;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
@@ -423,7 +423,7 @@
TextText
- {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410
+ {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
@@ -569,12 +569,12 @@
TextText
- {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410
+ {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
-\f0\fs22 \cf0 Whitespace Filter}
+\f0\fs22 \cf0 HTML Sanitizer}
@@ -604,12 +604,12 @@
TextText
- {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410
+ {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
-\f0\fs22 \cf0 XInclude Filter}
+\f0\fs22 \cf0 HTML Form Filler}
@@ -639,12 +639,12 @@
TextText
- {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410
+ {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
-\f0\fs22 \cf0 HTML Sanitizer}
+\f0\fs22 \cf0 I18N Translator}
@@ -720,7 +720,7 @@
Align2Text
- {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410
+ {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
{\fonttbl\f0\fswiss\fcharset77 Helvetica-BoldOblique;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qr\pardirnatural
@@ -760,7 +760,7 @@
TextText
- {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410
+ {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
@@ -795,7 +795,7 @@
TextText
- {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410
+ {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
@@ -830,7 +830,7 @@
TextText
- {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410
+ {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
@@ -911,7 +911,7 @@
Align2Text
- {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410
+ {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
{\fonttbl\f0\fswiss\fcharset77 Helvetica-BoldOblique;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qr\pardirnatural
@@ -946,7 +946,7 @@
TextText
- {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410
+ {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
@@ -981,7 +981,7 @@
TextText
- {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410
+ {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
@@ -1062,7 +1062,7 @@
Align2Text
- {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410
+ {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
{\fonttbl\f0\fswiss\fcharset77 Helvetica-BoldOblique;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qr\pardirnatural
@@ -1141,7 +1141,7 @@
TextText
- {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410
+ {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
{\fonttbl\f0\fswiss\fcharset77 Helvetica-BoldOblique;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
@@ -1249,7 +1249,7 @@
ModificationDate
- 2006-09-12 18:13:56 +0200
+ 2007-04-13 15:15:25 +0200ModifierChristopher LenzNotesVisible
@@ -1325,7 +1325,7 @@
ShowStatusBarVisibleRegion
- {{-121, 0}, {765, 470}}
+ {{-121, 0}, {765, 446}}Zoom1
diff --git a/doc/2000ft.png b/doc/2000ft.png
index 3c6dc53915076b2fd6225b9798325463a3e7399d..d0209916dd84c14e852056736dffa991c1cc1506
GIT binary patch
literal 28698
zc$}2G1#BJ7wx-?2n3)-3h#j+IW{BBw%*@Qpl$c|VnJH#wrkI(TnVD(t@psO>|D0bV
zjqa4RmrA=q)z#Itp11n#Fa>!DWCQ{P005AsB*hc~0Alt1mjDO({?AI{0xSTavRH_U
zDoBZnk|{XanOazz0DyaXf|>`{tj~gAXNtk;i)wF-&!?9}suxD`7mj}Yz?6QRoWaar
zA7z|ZFvLG