annotate doc/upgrade.txt @ 922:bd47549f0555 experimental-py3k

Correct reference to i18n namespace in documentation.
author hodgestar
date Sun, 12 Dec 2010 22:29:56 +0000
parents 7d8b996b2c20
children 796b4600cdbd
rev   line source
713
5420fe9d99a9 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
88ec2b306296 * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
2 Upgrading Genshi
88ec2b306296 * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
3 ================
88ec2b306296 * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
4
606
37ff75bb4301 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
5
37ff75bb4301 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
6 .. contents:: Contents
37ff75bb4301 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
7 :depth: 2
37ff75bb4301 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
8 .. sectnum::
37ff75bb4301 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
9
919
7d8b996b2c20 Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
10 ----------------------------------------------
7d8b996b2c20 Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
11 Upgrading from Genshi 0.6.x to the py3k branch
7d8b996b2c20 Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
12 ----------------------------------------------
7d8b996b2c20 Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
13
7d8b996b2c20 Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
14 The most noticable API change in the Genshi py3k branch is that the
7d8b996b2c20 Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
15 default encoding in numerous places is now None (i.e. unicode) instead
7d8b996b2c20 Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
16 of UTF-8. This change was made in order to ease the transition to Python 3
7d8b996b2c20 Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
17 where strings are unicode strings by default.
7d8b996b2c20 Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
18
7d8b996b2c20 Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
19 If your application relies on the default UTF-8 encoding a simple way to
7d8b996b2c20 Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
20 have it work both with Genshi 0.6.x and the py3k branch is to specify the
7d8b996b2c20 Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
21 encoding explicitly in calls to the following classes, methods and functions:
7d8b996b2c20 Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
22
7d8b996b2c20 Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
23 * genshi.HTML
7d8b996b2c20 Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
24 * genshi.Stream.render
7d8b996b2c20 Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
25 * genshi.input.HTMLParser
7d8b996b2c20 Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
26 * genshi.template.MarkupTemplate
7d8b996b2c20 Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
27 * genshi.template.TemplateLoader
7d8b996b2c20 Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
28 * genshi.template.TextTemplate (and genshi.template.NewTextTemplate)
7d8b996b2c20 Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
29 * genshi.template.OldTextTemplate
7d8b996b2c20 Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
30
7d8b996b2c20 Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
31 Whether you explicitly specify UTF-8 or explicitly specify None (unicode) is
7d8b996b2c20 Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
32 a matter of personal taste, although working with unicode may make porting
7d8b996b2c20 Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
33 your own application to Python 3 easier.
7d8b996b2c20 Add documentation on upgrading to the Genshi py3k branch.
hodgestar
parents: 883
diff changeset
34
606
37ff75bb4301 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
35
713
5420fe9d99a9 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
36 ------------------------------------
756
70a172ab5705 Document dropping of Python 2.3 compat.
cmlenz
parents: 745
diff changeset
37 Upgrading from Genshi 0.5.x to 0.6.x
70a172ab5705 Document dropping of Python 2.3 compat.
cmlenz
parents: 745
diff changeset
38 ------------------------------------
70a172ab5705 Document dropping of Python 2.3 compat.
cmlenz
parents: 745
diff changeset
39
70a172ab5705 Document dropping of Python 2.3 compat.
cmlenz
parents: 745
diff changeset
40 Required Python Version
70a172ab5705 Document dropping of Python 2.3 compat.
cmlenz
parents: 745
diff changeset
41 -----------------------
70a172ab5705 Document dropping of Python 2.3 compat.
cmlenz
parents: 745
diff changeset
42
70a172ab5705 Document dropping of Python 2.3 compat.
cmlenz
parents: 745
diff changeset
43 Support for Python 2.3 has been dropped in this release. Python 2.4 is
70a172ab5705 Document dropping of Python 2.3 compat.
cmlenz
parents: 745
diff changeset
44 now the minimum version of Python required to run Genshi.
70a172ab5705 Document dropping of Python 2.3 compat.
cmlenz
parents: 745
diff changeset
45
883
bf4ed3c37ab5 Added a documentation page about the template loader.
cmlenz
parents: 756
diff changeset
46 The XPath engine has been completely overhauled for this version. Some
bf4ed3c37ab5 Added a documentation page about the template loader.
cmlenz
parents: 756
diff changeset
47 patterns that previously matched incorrectly will no longer match, and
bf4ed3c37ab5 Added a documentation page about the template loader.
cmlenz
parents: 756
diff changeset
48 the other way around. In such cases, the XPath expressions need to be
bf4ed3c37ab5 Added a documentation page about the template loader.
cmlenz
parents: 756
diff changeset
49 fixed in your application and templates.
bf4ed3c37ab5 Added a documentation page about the template loader.
cmlenz
parents: 756
diff changeset
50
756
70a172ab5705 Document dropping of Python 2.3 compat.
cmlenz
parents: 745
diff changeset
51
70a172ab5705 Document dropping of Python 2.3 compat.
cmlenz
parents: 745
diff changeset
52 ------------------------------------
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
53 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
54 ------------------------------------
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
55
713
5420fe9d99a9 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
56 Error Handling
5420fe9d99a9 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
57 --------------
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
58
606
37ff75bb4301 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
59 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
60 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
61 now generate an immediate exception, as will accessing object
37ff75bb4301 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
62 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
63 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
64 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
65 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
66 future release.
37ff75bb4301 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
67
713
5420fe9d99a9 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
68 Match Template Processing
5420fe9d99a9 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
69 -------------------------
5420fe9d99a9 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
694
07e3f6f0ef57 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
71 There has also been a subtle change to how ``py:match`` templates are
07e3f6f0ef57 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
72 processed: in previous versions, all match templates would be applied
07e3f6f0ef57 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 to the content generated by the matching template, and only the
07e3f6f0ef57 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 matching template itself was applied recursively to the original
07e3f6f0ef57 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 content. This behavior resulted in problems with many kinds of
07e3f6f0ef57 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 recursive matching, and hence was changed for 0.5: now, all match
07e3f6f0ef57 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 templates declared before the matching template are applied to the
07e3f6f0ef57 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 original content, and match templates declared after the matching
07e3f6f0ef57 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 template are applied to the generated content. This change should not
07e3f6f0ef57 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 have any effect on most applications, but you may want to check your
07e3f6f0ef57 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 use of match templates to make sure.
07e3f6f0ef57 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
713
5420fe9d99a9 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
83 Text Templates
5420fe9d99a9 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
84 --------------
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
85
713
5420fe9d99a9 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 Genshi 0.5 introduces a new, alternative syntax for text templates,
5420fe9d99a9 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
87 which is more flexible and powerful compared to the old syntax. For
5420fe9d99a9 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 backwards compatibility, this new syntax is not used by default,
5420fe9d99a9 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 though it will be in a future version. It is recommended that you
5420fe9d99a9 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 migrate to using this new syntax. To do so, simply rename any
5420fe9d99a9 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 references in your code to ``TextTemplate`` to ``NewTextTemplate``. To
5420fe9d99a9 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 explicitly use the old syntax, use ``OldTextTemplate`` instead, so
5420fe9d99a9 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 that you can be sure you'll be using the same language when the
5420fe9d99a9 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 default in Genshi is changed (at least until the old implementation is
5420fe9d99a9 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 completely removed).
5420fe9d99a9 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
5420fe9d99a9 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 ``Markup`` Constructor
5420fe9d99a9 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 ----------------------
5420fe9d99a9 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
745
74b5c5476ddb Preparing for [milestone:0.5] release.
cmlenz
parents: 714
diff changeset
100 The ``Markup`` class no longer has a specialized constructor. The old
713
5420fe9d99a9 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 (undocumented) constructor provided a shorthand for doing positional
5420fe9d99a9 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
102 substitutions. If you have code like this:
5420fe9d99a9 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
5420fe9d99a9 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 .. code-block:: python
5420fe9d99a9 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
5420fe9d99a9 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 Markup('<b>%s</b>', name)
5420fe9d99a9 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
745
74b5c5476ddb Preparing for [milestone:0.5] release.
cmlenz
parents: 714
diff changeset
108 You must replace it by the more explicit:
713
5420fe9d99a9 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
5420fe9d99a9 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
110 .. code-block:: python
5420fe9d99a9 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
5420fe9d99a9 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 Markup('<b>%s</b>') % name
5420fe9d99a9 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
714
fc6d9d2a3527 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
114 ``Template`` Constructor
fc6d9d2a3527 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
115 ------------------------
fc6d9d2a3527 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
fc6d9d2a3527 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 The constructor of the ``Template`` class and its subclasses has changed
fc6d9d2a3527 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 slightly: instead of the optional ``basedir`` parameter, it now expects
fc6d9d2a3527 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 an (also optional) ``filepath`` parameter, which specifies the absolute
fc6d9d2a3527 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 path to the template. You probably aren't using those constructors
fc6d9d2a3527 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 directly, anyway, but using the ``TemplateLoader`` API instead.
fc6d9d2a3527 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
713
5420fe9d99a9 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
123
5420fe9d99a9 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
124 ------------------------------------
336
7763f7aec949 Refactoring: `genshi.template` is now a package, it was getting way to crowded in that file.
cmlenz
parents: 233
diff changeset
125 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
126 ------------------------------------
7763f7aec949 Refactoring: `genshi.template` is now a package, it was getting way to crowded in that file.
cmlenz
parents: 233
diff changeset
127
452
a89368769b82 Add `filters` package in `setup.py`.
cmlenz
parents: 442
diff changeset
128 The modules ``genshi.filters`` and ``genshi.template`` have been
a89368769b82 Add `filters` package in `setup.py`.
cmlenz
parents: 442
diff changeset
129 refactored into packages containing multiple modules. While code using
a89368769b82 Add `filters` package in `setup.py`.
cmlenz
parents: 442
diff changeset
130 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
131 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
132 and ``template.py`` in the ``genshi`` package on the installation
37ff75bb4301 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
133 path (including the corresponding ``.pyc`` files). This is not
37ff75bb4301 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
134 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
135
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
136 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
137 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
138 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
139
606
37ff75bb4301 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
140 Instances of ``genshi.core.Attrs`` are now immutable. Filters
411
7d158f8f48ad Updated change log.
cmlenz
parents: 397
diff changeset
141 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
142 the ``Attrs`` class no longer automatically wraps all attribute names
37ff75bb4301 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
143 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
144 themselves. See the documentation of the ``Attrs`` class for more
411
7d158f8f48ad Updated change log.
cmlenz
parents: 397
diff changeset
145 information.
7d158f8f48ad Updated change log.
cmlenz
parents: 397
diff changeset
146
345
2aa7ca37ae6a Make `Attrs` instances immutable.
cmlenz
parents: 343
diff changeset
147
713
5420fe9d99a9 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
148 ---------------------
233
88ec2b306296 * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
149 Upgrading from Markup
88ec2b306296 * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
150 ---------------------
88ec2b306296 * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
151
88ec2b306296 * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
152 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
153 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
154 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
155
606
37ff75bb4301 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
156 * The package name was changed from "markup" to "genshi". Please
37ff75bb4301 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
157 adjust any import statements referring to the old package name.
37ff75bb4301 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
158 * 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
159 from ``http://markup.edgewall.org/`` to
37ff75bb4301 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
160 ``http://genshi.edgewall.org/``. Please update the ``xmlns:py``
37ff75bb4301 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
161 declaration in your template files accordingly.
233
88ec2b306296 * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
162
88ec2b306296 * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
163 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
164 the class::
233
88ec2b306296 * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
165
606
37ff75bb4301 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
166 markup.template.Template
233
88ec2b306296 * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
167
606
37ff75bb4301 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
168 has been renamed to::
233
88ec2b306296 * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
169
606
37ff75bb4301 Changed the default error handling mode to "strict".
cmlenz
parents: 592
diff changeset
170 genshi.template.MarkupTemplate
233
88ec2b306296 * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
171
88ec2b306296 * Added implementation of a simple text-based template engine. Closes #47.
cmlenz
parents:
diff changeset
172 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
173 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
174 did not change).
Copyright (C) 2012-2017 Edgewall Software