cmlenz@233: Upgrading Genshi cmlenz@233: ================ cmlenz@233: cmlenz@336: Upgrading from Genshi 0.3.x to 0.4.x cmlenz@336: ------------------------------------ cmlenz@336: cmlenz@336: The `genshi.template` module has been refactored into a package with cmlenz@336: multiple modules. While code using the normal templating APIs should cmlenz@336: continue to work without problems, you should make sure to remove any cmlenz@336: leftover traces of the `template.py` file on the installation path. cmlenz@336: This is not necessary when Genshi was installed as a Python egg. cmlenz@336: cmlenz@440: Handling of errors in template expressions is now more strict. In cmlenz@440: particular, it is no longer possible to reference an undefined cmlenz@440: variable without an exception being raised. The previous error cmlenz@440: handling let expressions get away with minor typos, which would cmlenz@440: result in subtle bugs that were hard to find. The functions cmlenz@440: `defined()` and `value_of()` are now available in all template cmlenz@440: code; they can be used to test whether a specific variable is cmlenz@440: defined at the top-level scope. Please refer to the template cmlenz@440: language documentation for details. cmlenz@440: cmlenz@343: Results of evaluating template expressions are no longer implicitly cmlenz@343: called if they are callable. If you have been using that feature, you cmlenz@343: will need to add the parenthesis to actually call the function. cmlenz@343: cmlenz@345: Instances of `genshi.core.Attrs` are now immutable. Filters cmlenz@411: manipulating the attributes in a stream may need to be updated. Also, cmlenz@411: the `Attrs` class no longer automatically wraps all attribute names cmlenz@411: in `QName` objects, so users of the `Attrs` class need to do this cmlenz@411: themselves. See the documentation of the `Attrs` class for more cmlenz@411: information. cmlenz@411: cmlenz@345: cmlenz@233: Upgrading from Markup cmlenz@233: --------------------- cmlenz@233: cmlenz@233: Prior to version 0.3, the name of the Genshi project was "Markup". The cmlenz@233: name change means that you will have to adjust your import statements cmlenz@233: and the namespace URI of XML templates, among other things: cmlenz@233: cmlenz@233: * The package name was changed from "markup" to "genshi". Please cmlenz@233: adjust any import statements referring to the old package name. cmlenz@233: * The namespace URI for directives in Genshi XML templates has changed cmlenz@233: from http://markup.edgewall.org/ to http://genshi.edgewall.org/. cmlenz@233: Please update the xmlns:py declaration in your template files cmlenz@233: accordingly. cmlenz@233: cmlenz@233: Furthermore, due to the inclusion of a text-based template language, cmlenz@233: the class: cmlenz@233: cmlenz@233: `markup.template.Template` cmlenz@233: cmlenz@233: has been renamed to: cmlenz@233: cmlenz@414: `genshi.template.MarkupTemplate` cmlenz@233: cmlenz@233: If you've been using the Template class directly, you'll need to cmlenz@233: update your code (a simple find/replace should do--the API itself cmlenz@233: did not change).