Mercurial > genshi > mirror
annotate doc/upgrade.txt @ 676:30c3b0592f82 experimental-optimizer
Clarified docs and docstrings.
author | athomas |
---|---|
date | Wed, 23 Jan 2008 13:11:03 +0000 |
parents | 37ff75bb4301 |
children | 07e3f6f0ef57 |
rev | line source |
---|---|
233
88ec2b306296
* Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff
changeset
|
1 Upgrading Genshi |
88ec2b306296
* Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff
changeset
|
2 ================ |
88ec2b306296
* Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff
changeset
|
3 |
606
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
4 |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
5 .. contents:: Contents |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
6 :depth: 2 |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
7 .. sectnum:: |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
8 |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
9 |
592
1da8de3e5e51
Add a new syntax for text templates, which is available alongside the old syntax for now. The new syntax is more poweful and flexible, using Django-style directive notation.
cmlenz
parents:
452
diff
changeset
|
10 Upgrading from Genshi 0.4.x to 0.5.x |
1da8de3e5e51
Add a new syntax for text templates, which is available alongside the old syntax for now. The new syntax is more poweful and flexible, using Django-style directive notation.
cmlenz
parents:
452
diff
changeset
|
11 ------------------------------------ |
1da8de3e5e51
Add a new syntax for text templates, which is available alongside the old syntax for now. The new syntax is more poweful and flexible, using Django-style directive notation.
cmlenz
parents:
452
diff
changeset
|
12 |
606
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
13 Genshi 0.5 introduces a new, alternative syntax for text templates, |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
14 which is more flexible and powerful compared to the old syntax. For |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
15 backwards compatibility, this new syntax is not used by default, |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
16 though it will be in a future version. It is recommended that you |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
17 migrate to using this new syntax. To do so, simply rename any |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
18 references in your code to ``TextTemplate`` to ``NewTextTemplate``. To |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
19 explicitly use the old syntax, use ``OldTextTemplate`` instead, so |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
20 that you can be sure you'll be using the same language when the |
592
1da8de3e5e51
Add a new syntax for text templates, which is available alongside the old syntax for now. The new syntax is more poweful and flexible, using Django-style directive notation.
cmlenz
parents:
452
diff
changeset
|
21 default in Genshi is changed (at least until the old implementation is |
1da8de3e5e51
Add a new syntax for text templates, which is available alongside the old syntax for now. The new syntax is more poweful and flexible, using Django-style directive notation.
cmlenz
parents:
452
diff
changeset
|
22 completely removed). |
1da8de3e5e51
Add a new syntax for text templates, which is available alongside the old syntax for now. The new syntax is more poweful and flexible, using Django-style directive notation.
cmlenz
parents:
452
diff
changeset
|
23 |
606
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
24 The default error handling mode has been changed to "strict". This |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
25 means that accessing variables not defined in the template data will |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
26 now generate an immediate exception, as will accessing object |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
27 attributes or dictionary keys that don't exist. If your templates rely |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
28 on the old lenient behavior, you can configure Genshi to use that |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
29 instead. See the documentation for details on how to do that. But be |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
30 warned that lenient error handling may be removed completely in a |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
31 future release. |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
32 |
592
1da8de3e5e51
Add a new syntax for text templates, which is available alongside the old syntax for now. The new syntax is more poweful and flexible, using Django-style directive notation.
cmlenz
parents:
452
diff
changeset
|
33 |
336
7763f7aec949
Refactoring: `genshi.template` is now a package, it was getting way to crowded in that file.
cmlenz
parents:
233
diff
changeset
|
34 Upgrading from Genshi 0.3.x to 0.4.x |
7763f7aec949
Refactoring: `genshi.template` is now a package, it was getting way to crowded in that file.
cmlenz
parents:
233
diff
changeset
|
35 ------------------------------------ |
7763f7aec949
Refactoring: `genshi.template` is now a package, it was getting way to crowded in that file.
cmlenz
parents:
233
diff
changeset
|
36 |
452 | 37 The modules ``genshi.filters`` and ``genshi.template`` have been |
38 refactored into packages containing multiple modules. While code using | |
39 the regular APIs should continue to work without problems, you should | |
606
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
40 make sure to remove any leftover traces of the files ``filters.py`` |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
41 and ``template.py`` in the ``genshi`` package on the installation |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
42 path (including the corresponding ``.pyc`` files). This is not |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
43 necessary when Genshi was installed as a Python egg. |
336
7763f7aec949
Refactoring: `genshi.template` is now a package, it was getting way to crowded in that file.
cmlenz
parents:
233
diff
changeset
|
44 |
343
35189e960252
Remove automatic calling of expression evaluation results if they are callable. See [http://groups.google.com/group/genshi/browse_thread/thread/f515986760918d41 this mailing list thread].
cmlenz
parents:
336
diff
changeset
|
45 Results of evaluating template expressions are no longer implicitly |
35189e960252
Remove automatic calling of expression evaluation results if they are callable. See [http://groups.google.com/group/genshi/browse_thread/thread/f515986760918d41 this mailing list thread].
cmlenz
parents:
336
diff
changeset
|
46 called if they are callable. If you have been using that feature, you |
35189e960252
Remove automatic calling of expression evaluation results if they are callable. See [http://groups.google.com/group/genshi/browse_thread/thread/f515986760918d41 this mailing list thread].
cmlenz
parents:
336
diff
changeset
|
47 will need to add the parenthesis to actually call the function. |
35189e960252
Remove automatic calling of expression evaluation results if they are callable. See [http://groups.google.com/group/genshi/browse_thread/thread/f515986760918d41 this mailing list thread].
cmlenz
parents:
336
diff
changeset
|
48 |
606
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
49 Instances of ``genshi.core.Attrs`` are now immutable. Filters |
411 | 50 manipulating the attributes in a stream may need to be updated. Also, |
606
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
51 the ``Attrs`` class no longer automatically wraps all attribute names |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
52 in ``QName`` objects, so users of the ``Attrs`` class need to do this |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
53 themselves. See the documentation of the ``Attrs`` class for more |
411 | 54 information. |
55 | |
345 | 56 |
233
88ec2b306296
* Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff
changeset
|
57 Upgrading from Markup |
88ec2b306296
* Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff
changeset
|
58 --------------------- |
88ec2b306296
* Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff
changeset
|
59 |
88ec2b306296
* Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff
changeset
|
60 Prior to version 0.3, the name of the Genshi project was "Markup". The |
88ec2b306296
* Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff
changeset
|
61 name change means that you will have to adjust your import statements |
88ec2b306296
* Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff
changeset
|
62 and the namespace URI of XML templates, among other things: |
88ec2b306296
* Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff
changeset
|
63 |
606
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
64 * The package name was changed from "markup" to "genshi". Please |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
65 adjust any import statements referring to the old package name. |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
66 * The namespace URI for directives in Genshi XML templates has changed |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
67 from ``http://markup.edgewall.org/`` to |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
68 ``http://genshi.edgewall.org/``. Please update the ``xmlns:py`` |
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
69 declaration in your template files accordingly. |
233
88ec2b306296
* Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff
changeset
|
70 |
88ec2b306296
* Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff
changeset
|
71 Furthermore, due to the inclusion of a text-based template language, |
606
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
72 the class:: |
233
88ec2b306296
* Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff
changeset
|
73 |
606
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
74 markup.template.Template |
233
88ec2b306296
* Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff
changeset
|
75 |
606
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
76 has been renamed to:: |
233
88ec2b306296
* Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff
changeset
|
77 |
606
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
78 genshi.template.MarkupTemplate |
233
88ec2b306296
* Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff
changeset
|
79 |
88ec2b306296
* Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff
changeset
|
80 If you've been using the Template class directly, you'll need to |
606
37ff75bb4301
Changed the default error handling mode to "strict".
cmlenz
parents:
592
diff
changeset
|
81 update your code (a simple find/replace should do—the API itself |
233
88ec2b306296
* Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff
changeset
|
82 did not change). |