# HG changeset patch # User cmlenz # Date 1161706209 0 # Node ID 8ba12f886c8a20e438864a864d50a63105862031 # Parent 4ab9edf5e83bd94a8450d6ee31bd715af259bbf4 Update change log, and some minor tweaks to keyword argument ordering for the new `encoding` parameter. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,19 @@ associated choose directive does have one. In that case, the when branch is followed if the expression of the choose directive evaluates to a truth value. + * Unsuccessful attribute or item lookups now return `Undefined` objects for + nicer error messages. + + +Version 0.3.4 +http://svn.edgewall.org/repos/genshi/tags/0.3.4/ +(?, from branches/stable/0.3.x) + + * The encoding of HTML and XML files, as well as markup and text templates, + can now be specified. Also, the encoding specified in XML declarations is + now respected unless an expiclit encoding is requested. + * Expressions used as arguments for `py:with`, `py:def`, and `py:for` + directives can now contain non-ASCII strings. Version 0.3.3 diff --git a/genshi/template.py b/genshi/template.py --- a/genshi/template.py +++ b/genshi/template.py @@ -1288,8 +1288,8 @@ >>> os.remove(path) """ - def __init__(self, search_path=None, auto_reload=False, max_cache_size=25, - default_encoding=None): + def __init__(self, search_path=None, auto_reload=False, + default_encoding=None, max_cache_size=25): """Create the template laoder. @param search_path: a list of absolute path names that should be @@ -1297,10 +1297,10 @@ absolute path @param auto_reload: whether to check the last modification time of template files, and reload them if they have changed + @param default_encoding: the default encoding to assume when loading + templates; defaults to UTF-8 @param max_cache_size: the maximum number of templates to keep in the cache - @param default_encoding: the default encoding to assume when loading - templates; defaults to UTF-8 """ self.search_path = search_path if self.search_path is None: @@ -1393,7 +1393,7 @@ filename = os.path.join(dirname, filename) dirname = '' tmpl = cls(fileobj, basedir=dirname, filename=filename, - encoding=encoding, loader=self) + loader=self, encoding=encoding) finally: fileobj.close() self._cache[filename] = tmpl