annotate doc/upgrade.txt @ 937:459e1fed2c92

Update upgrade documentation to refer to the development version and not the py3k branch.
author hodgestar
date Fri, 18 Mar 2011 09:51:59 +0000
parents 47c83fbdf4d4
children
rev   line source
713
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
1 ================
233
7a426ab6407a * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
2 Upgrading Genshi
7a426ab6407a * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
3 ================
7a426ab6407a * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
4
606
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
5
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
6 .. contents:: Contents
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
7 :depth: 2
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
8 .. sectnum::
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
9
937
459e1fed2c92 Update upgrade documentation to refer to the development version and not the py3k branch.
hodgestar
parents: 936
diff changeset
10 ------------------------------------------------------
459e1fed2c92 Update upgrade documentation to refer to the development version and not the py3k branch.
hodgestar
parents: 936
diff changeset
11 Upgrading from Genshi 0.6.x to the development version
459e1fed2c92 Update upgrade documentation to refer to the development version and not the py3k branch.
hodgestar
parents: 936
diff changeset
12 ------------------------------------------------------
936
47c83fbdf4d4 Merge r1144 from py3k: Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
13
937
459e1fed2c92 Update upgrade documentation to refer to the development version and not the py3k branch.
hodgestar
parents: 936
diff changeset
14 The Genshi development version now supports both Python 2 and Python 3.
459e1fed2c92 Update upgrade documentation to refer to the development version and not the py3k branch.
hodgestar
parents: 936
diff changeset
15
459e1fed2c92 Update upgrade documentation to refer to the development version and not the py3k branch.
hodgestar
parents: 936
diff changeset
16 The most noticable API change in the Genshi development version is that the
936
47c83fbdf4d4 Merge r1144 from py3k: Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
17 default encoding in numerous places is now None (i.e. unicode) instead
47c83fbdf4d4 Merge r1144 from py3k: Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
18 of UTF-8. This change was made in order to ease the transition to Python 3
47c83fbdf4d4 Merge r1144 from py3k: Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
19 where strings are unicode strings by default.
47c83fbdf4d4 Merge r1144 from py3k: Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
20
47c83fbdf4d4 Merge r1144 from py3k: Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
21 If your application relies on the default UTF-8 encoding a simple way to
937
459e1fed2c92 Update upgrade documentation to refer to the development version and not the py3k branch.
hodgestar
parents: 936
diff changeset
22 have it work both with Genshi 0.6.x and the development version is to specify the
936
47c83fbdf4d4 Merge r1144 from py3k: Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
23 encoding explicitly in calls to the following classes, methods and functions:
47c83fbdf4d4 Merge r1144 from py3k: Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
24
47c83fbdf4d4 Merge r1144 from py3k: Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
25 * genshi.HTML
47c83fbdf4d4 Merge r1144 from py3k: Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
26 * genshi.Stream.render
47c83fbdf4d4 Merge r1144 from py3k: Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
27 * genshi.input.HTMLParser
47c83fbdf4d4 Merge r1144 from py3k: Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
28 * genshi.template.MarkupTemplate
47c83fbdf4d4 Merge r1144 from py3k: Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
29 * genshi.template.TemplateLoader
47c83fbdf4d4 Merge r1144 from py3k: Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
30 * genshi.template.TextTemplate (and genshi.template.NewTextTemplate)
47c83fbdf4d4 Merge r1144 from py3k: Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
31 * genshi.template.OldTextTemplate
47c83fbdf4d4 Merge r1144 from py3k: Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
32
47c83fbdf4d4 Merge r1144 from py3k: Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
33 Whether you explicitly specify UTF-8 or explicitly specify None (unicode) is
47c83fbdf4d4 Merge r1144 from py3k: Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
34 a matter of personal taste, although working with unicode may make porting
47c83fbdf4d4 Merge r1144 from py3k: Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
35 your own application to Python 3 easier.
47c83fbdf4d4 Merge r1144 from py3k: Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
36
606
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
37
713
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
38 ------------------------------------
756
211cd26d6fd9 Document dropping of Python 2.3 compat.
cmlenz
parents: 745
diff changeset
39 Upgrading from Genshi 0.5.x to 0.6.x
211cd26d6fd9 Document dropping of Python 2.3 compat.
cmlenz
parents: 745
diff changeset
40 ------------------------------------
211cd26d6fd9 Document dropping of Python 2.3 compat.
cmlenz
parents: 745
diff changeset
41
211cd26d6fd9 Document dropping of Python 2.3 compat.
cmlenz
parents: 745
diff changeset
42 Required Python Version
211cd26d6fd9 Document dropping of Python 2.3 compat.
cmlenz
parents: 745
diff changeset
43 -----------------------
211cd26d6fd9 Document dropping of Python 2.3 compat.
cmlenz
parents: 745
diff changeset
44
211cd26d6fd9 Document dropping of Python 2.3 compat.
cmlenz
parents: 745
diff changeset
45 Support for Python 2.3 has been dropped in this release. Python 2.4 is
211cd26d6fd9 Document dropping of Python 2.3 compat.
cmlenz
parents: 745
diff changeset
46 now the minimum version of Python required to run Genshi.
211cd26d6fd9 Document dropping of Python 2.3 compat.
cmlenz
parents: 745
diff changeset
47
883
0849dcc8ed46 Added a documentation page about the template loader.
cmlenz
parents: 756
diff changeset
48 The XPath engine has been completely overhauled for this version. Some
0849dcc8ed46 Added a documentation page about the template loader.
cmlenz
parents: 756
diff changeset
49 patterns that previously matched incorrectly will no longer match, and
0849dcc8ed46 Added a documentation page about the template loader.
cmlenz
parents: 756
diff changeset
50 the other way around. In such cases, the XPath expressions need to be
0849dcc8ed46 Added a documentation page about the template loader.
cmlenz
parents: 756
diff changeset
51 fixed in your application and templates.
0849dcc8ed46 Added a documentation page about the template loader.
cmlenz
parents: 756
diff changeset
52
756
211cd26d6fd9 Document dropping of Python 2.3 compat.
cmlenz
parents: 745
diff changeset
53
211cd26d6fd9 Document dropping of Python 2.3 compat.
cmlenz
parents: 745
diff changeset
54 ------------------------------------
592
7145e4eba2ec 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
55 Upgrading from Genshi 0.4.x to 0.5.x
7145e4eba2ec 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
56 ------------------------------------
7145e4eba2ec 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
57
713
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
58 Error Handling
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
59 --------------
592
7145e4eba2ec 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
60
606
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
61 The default error handling mode has been changed to "strict". This
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
62 means that accessing variables not defined in the template data will
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
63 now generate an immediate exception, as will accessing object
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
64 attributes or dictionary keys that don't exist. If your templates rely
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
65 on the old lenient behavior, you can configure Genshi to use that
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
66 instead. See the documentation for details on how to do that. But be
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
67 warned that lenient error handling may be removed completely in a
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
68 future release.
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
69
713
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
70 Match Template Processing
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
71 -------------------------
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
72
694
812671b40022 Match templates are now applied in a more controlled fashion: in the order they are declared in the template source, all match templates up to (and including) the matching template itself are applied to the matched content, whereas the match templates declared after the matching template are only applied to the generated content. Fixes #186. Many thanks to Matt Chaput for reporting the problem and providing a test case.
cmlenz
parents: 606
diff changeset
73 There has also been a subtle change to how ``py:match`` templates are
812671b40022 Match templates are now applied in a more controlled fashion: in the order they are declared in the template source, all match templates up to (and including) the matching template itself are applied to the matched content, whereas the match templates declared after the matching template are only applied to the generated content. Fixes #186. Many thanks to Matt Chaput for reporting the problem and providing a test case.
cmlenz
parents: 606
diff changeset
74 processed: in previous versions, all match templates would be applied
812671b40022 Match templates are now applied in a more controlled fashion: in the order they are declared in the template source, all match templates up to (and including) the matching template itself are applied to the matched content, whereas the match templates declared after the matching template are only applied to the generated content. Fixes #186. Many thanks to Matt Chaput for reporting the problem and providing a test case.
cmlenz
parents: 606
diff changeset
75 to the content generated by the matching template, and only the
812671b40022 Match templates are now applied in a more controlled fashion: in the order they are declared in the template source, all match templates up to (and including) the matching template itself are applied to the matched content, whereas the match templates declared after the matching template are only applied to the generated content. Fixes #186. Many thanks to Matt Chaput for reporting the problem and providing a test case.
cmlenz
parents: 606
diff changeset
76 matching template itself was applied recursively to the original
812671b40022 Match templates are now applied in a more controlled fashion: in the order they are declared in the template source, all match templates up to (and including) the matching template itself are applied to the matched content, whereas the match templates declared after the matching template are only applied to the generated content. Fixes #186. Many thanks to Matt Chaput for reporting the problem and providing a test case.
cmlenz
parents: 606
diff changeset
77 content. This behavior resulted in problems with many kinds of
812671b40022 Match templates are now applied in a more controlled fashion: in the order they are declared in the template source, all match templates up to (and including) the matching template itself are applied to the matched content, whereas the match templates declared after the matching template are only applied to the generated content. Fixes #186. Many thanks to Matt Chaput for reporting the problem and providing a test case.
cmlenz
parents: 606
diff changeset
78 recursive matching, and hence was changed for 0.5: now, all match
812671b40022 Match templates are now applied in a more controlled fashion: in the order they are declared in the template source, all match templates up to (and including) the matching template itself are applied to the matched content, whereas the match templates declared after the matching template are only applied to the generated content. Fixes #186. Many thanks to Matt Chaput for reporting the problem and providing a test case.
cmlenz
parents: 606
diff changeset
79 templates declared before the matching template are applied to the
812671b40022 Match templates are now applied in a more controlled fashion: in the order they are declared in the template source, all match templates up to (and including) the matching template itself are applied to the matched content, whereas the match templates declared after the matching template are only applied to the generated content. Fixes #186. Many thanks to Matt Chaput for reporting the problem and providing a test case.
cmlenz
parents: 606
diff changeset
80 original content, and match templates declared after the matching
812671b40022 Match templates are now applied in a more controlled fashion: in the order they are declared in the template source, all match templates up to (and including) the matching template itself are applied to the matched content, whereas the match templates declared after the matching template are only applied to the generated content. Fixes #186. Many thanks to Matt Chaput for reporting the problem and providing a test case.
cmlenz
parents: 606
diff changeset
81 template are applied to the generated content. This change should not
812671b40022 Match templates are now applied in a more controlled fashion: in the order they are declared in the template source, all match templates up to (and including) the matching template itself are applied to the matched content, whereas the match templates declared after the matching template are only applied to the generated content. Fixes #186. Many thanks to Matt Chaput for reporting the problem and providing a test case.
cmlenz
parents: 606
diff changeset
82 have any effect on most applications, but you may want to check your
812671b40022 Match templates are now applied in a more controlled fashion: in the order they are declared in the template source, all match templates up to (and including) the matching template itself are applied to the matched content, whereas the match templates declared after the matching template are only applied to the generated content. Fixes #186. Many thanks to Matt Chaput for reporting the problem and providing a test case.
cmlenz
parents: 606
diff changeset
83 use of match templates to make sure.
812671b40022 Match templates are now applied in a more controlled fashion: in the order they are declared in the template source, all match templates up to (and including) the matching template itself are applied to the matched content, whereas the match templates declared after the matching template are only applied to the generated content. Fixes #186. Many thanks to Matt Chaput for reporting the problem and providing a test case.
cmlenz
parents: 606
diff changeset
84
713
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
85 Text Templates
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
86 --------------
592
7145e4eba2ec 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
87
713
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
88 Genshi 0.5 introduces a new, alternative syntax for text templates,
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
89 which is more flexible and powerful compared to the old syntax. For
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
90 backwards compatibility, this new syntax is not used by default,
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
91 though it will be in a future version. It is recommended that you
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
92 migrate to using this new syntax. To do so, simply rename any
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
93 references in your code to ``TextTemplate`` to ``NewTextTemplate``. To
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
94 explicitly use the old syntax, use ``OldTextTemplate`` instead, so
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
95 that you can be sure you'll be using the same language when the
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
96 default in Genshi is changed (at least until the old implementation is
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
97 completely removed).
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
98
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
99 ``Markup`` Constructor
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
100 ----------------------
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
101
745
f9544a7cc57a Preparing for [milestone:0.5] release.
cmlenz
parents: 714
diff changeset
102 The ``Markup`` class no longer has a specialized constructor. The old
713
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
103 (undocumented) constructor provided a shorthand for doing positional
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
104 substitutions. If you have code like this:
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
105
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
106 .. code-block:: python
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
107
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
108 Markup('<b>%s</b>', name)
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
109
745
f9544a7cc57a Preparing for [milestone:0.5] release.
cmlenz
parents: 714
diff changeset
110 You must replace it by the more explicit:
713
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
111
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
112 .. code-block:: python
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
113
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
114 Markup('<b>%s</b>') % name
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
115
714
7e6496bde18a The `Template` class and its subclasses, as well as the interpolation API, now take an `filepath` parameter instead of `basedir`. Closes #207. Thanks to Waldemar Kornewald for the patch.
cmlenz
parents: 713
diff changeset
116 ``Template`` Constructor
7e6496bde18a The `Template` class and its subclasses, as well as the interpolation API, now take an `filepath` parameter instead of `basedir`. Closes #207. Thanks to Waldemar Kornewald for the patch.
cmlenz
parents: 713
diff changeset
117 ------------------------
7e6496bde18a The `Template` class and its subclasses, as well as the interpolation API, now take an `filepath` parameter instead of `basedir`. Closes #207. Thanks to Waldemar Kornewald for the patch.
cmlenz
parents: 713
diff changeset
118
7e6496bde18a The `Template` class and its subclasses, as well as the interpolation API, now take an `filepath` parameter instead of `basedir`. Closes #207. Thanks to Waldemar Kornewald for the patch.
cmlenz
parents: 713
diff changeset
119 The constructor of the ``Template`` class and its subclasses has changed
7e6496bde18a The `Template` class and its subclasses, as well as the interpolation API, now take an `filepath` parameter instead of `basedir`. Closes #207. Thanks to Waldemar Kornewald for the patch.
cmlenz
parents: 713
diff changeset
120 slightly: instead of the optional ``basedir`` parameter, it now expects
7e6496bde18a The `Template` class and its subclasses, as well as the interpolation API, now take an `filepath` parameter instead of `basedir`. Closes #207. Thanks to Waldemar Kornewald for the patch.
cmlenz
parents: 713
diff changeset
121 an (also optional) ``filepath`` parameter, which specifies the absolute
7e6496bde18a The `Template` class and its subclasses, as well as the interpolation API, now take an `filepath` parameter instead of `basedir`. Closes #207. Thanks to Waldemar Kornewald for the patch.
cmlenz
parents: 713
diff changeset
122 path to the template. You probably aren't using those constructors
7e6496bde18a The `Template` class and its subclasses, as well as the interpolation API, now take an `filepath` parameter instead of `basedir`. Closes #207. Thanks to Waldemar Kornewald for the patch.
cmlenz
parents: 713
diff changeset
123 directly, anyway, but using the ``TemplateLoader`` API instead.
7e6496bde18a The `Template` class and its subclasses, as well as the interpolation API, now take an `filepath` parameter instead of `basedir`. Closes #207. Thanks to Waldemar Kornewald for the patch.
cmlenz
parents: 713
diff changeset
124
713
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
125
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
126 ------------------------------------
336
5f2c7782cd8a Refactoring: `genshi.template` is now a package, it was getting way to crowded in that file.
cmlenz
parents: 233
diff changeset
127 Upgrading from Genshi 0.3.x to 0.4.x
5f2c7782cd8a Refactoring: `genshi.template` is now a package, it was getting way to crowded in that file.
cmlenz
parents: 233
diff changeset
128 ------------------------------------
5f2c7782cd8a Refactoring: `genshi.template` is now a package, it was getting way to crowded in that file.
cmlenz
parents: 233
diff changeset
129
452
0ed55216e8f2 Add `filters` package in `setup.py`.
cmlenz
parents: 442
diff changeset
130 The modules ``genshi.filters`` and ``genshi.template`` have been
0ed55216e8f2 Add `filters` package in `setup.py`.
cmlenz
parents: 442
diff changeset
131 refactored into packages containing multiple modules. While code using
0ed55216e8f2 Add `filters` package in `setup.py`.
cmlenz
parents: 442
diff changeset
132 the regular APIs should continue to work without problems, you should
606
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
133 make sure to remove any leftover traces of the files ``filters.py``
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
134 and ``template.py`` in the ``genshi`` package on the installation
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
135 path (including the corresponding ``.pyc`` files). This is not
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
136 necessary when Genshi was installed as a Python egg.
336
5f2c7782cd8a Refactoring: `genshi.template` is now a package, it was getting way to crowded in that file.
cmlenz
parents: 233
diff changeset
137
343
4ff2338e89cd 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
138 Results of evaluating template expressions are no longer implicitly
4ff2338e89cd 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
139 called if they are callable. If you have been using that feature, you
4ff2338e89cd 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
140 will need to add the parenthesis to actually call the function.
4ff2338e89cd 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
141
606
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
142 Instances of ``genshi.core.Attrs`` are now immutable. Filters
411
2f4a525c32d5 Updated change log.
cmlenz
parents: 397
diff changeset
143 manipulating the attributes in a stream may need to be updated. Also,
606
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
144 the ``Attrs`` class no longer automatically wraps all attribute names
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
145 in ``QName`` objects, so users of the ``Attrs`` class need to do this
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
146 themselves. See the documentation of the ``Attrs`` class for more
411
2f4a525c32d5 Updated change log.
cmlenz
parents: 397
diff changeset
147 information.
2f4a525c32d5 Updated change log.
cmlenz
parents: 397
diff changeset
148
345
8e75b83d3e71 Make `Attrs` instances immutable.
cmlenz
parents: 343
diff changeset
149
713
a58a50e89d04 The `Markup` class now supports mappings for right hand of the `%` (modulo) operator in the same way the Python string classes do, except that the substituted values are escape. Also, the special constructor which took positional arguments that would be substituted was removed. Thus the `Markup` class now supports the same arguments as that of its `unicode` base class. Closes #211. Many thanks to Christian Boos for the patch!
cmlenz
parents: 694
diff changeset
150 ---------------------
233
7a426ab6407a * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
151 Upgrading from Markup
7a426ab6407a * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
152 ---------------------
7a426ab6407a * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
153
7a426ab6407a * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
154 Prior to version 0.3, the name of the Genshi project was "Markup". The
7a426ab6407a * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
155 name change means that you will have to adjust your import statements
7a426ab6407a * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
156 and the namespace URI of XML templates, among other things:
7a426ab6407a * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
157
606
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
158 * The package name was changed from "markup" to "genshi". Please
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
159 adjust any import statements referring to the old package name.
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
160 * The namespace URI for directives in Genshi XML templates has changed
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
161 from ``http://markup.edgewall.org/`` to
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
162 ``http://genshi.edgewall.org/``. Please update the ``xmlns:py``
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
163 declaration in your template files accordingly.
233
7a426ab6407a * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
164
7a426ab6407a * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
165 Furthermore, due to the inclusion of a text-based template language,
606
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
166 the class::
233
7a426ab6407a * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
167
606
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
168 markup.template.Template
233
7a426ab6407a * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
169
606
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
170 has been renamed to::
233
7a426ab6407a * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
171
606
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
172 genshi.template.MarkupTemplate
233
7a426ab6407a * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
173
7a426ab6407a * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
174 If you've been using the Template class directly, you'll need to
606
9ada030ad986 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
175 update your code (a simple find/replace should do—the API itself
233
7a426ab6407a * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
176 did not change).
Copyright (C) 2012-2017 Edgewall Software