view UPGRADE.txt @ 440:7884617bc941 trunk

Add stricter error handling to upgrade notes.
author cmlenz
date Wed, 04 Apr 2007 17:18:08 +0000
parents 5cd03affab4a
children 97544725bb7f
line wrap: on
line source
Upgrading Genshi
================

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.

Handling of errors in template expressions is now more strict. In
particular, it is no longer possible to reference an undefined
variable without an exception being raised. The previous error
handling let expressions get away with minor typos, which would
result in subtle bugs that were hard to find. The functions
`defined()` and `value_of()` are now available in all template
code; they can be used to test whether a specific variable is
defined at the top-level scope. Please refer to the template
language documentation for details.

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. 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
---------------------

Prior to version 0.3, the name of the Genshi project was "Markup". The
name change means that you will have to adjust your import statements
and the namespace URI of XML templates, among other things:

 * The package name was changed from "markup" to "genshi". Please
   adjust any import statements referring to the old package name.
 * The namespace URI for directives in Genshi XML templates has changed
   from http://markup.edgewall.org/ to http://genshi.edgewall.org/.
   Please update the xmlns:py declaration in your template files
   accordingly.

Furthermore, due to the inclusion of a text-based template language,
the class:

  `markup.template.Template`

has been renamed to:

  `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
did not change).
Copyright (C) 2012-2017 Edgewall Software