Mercurial > p > roundup > code
view roundup/anypy/README.txt @ 4587:a2eb4fb3e6d8
New Chameleon templating engine, engine is now configurable.
We now have two configurable templating engines, the old Zope TAL
templates (called zopetal in the config) and the new Chameleon (called
chameleon in the config). A new config-option "template_engine" under
[main] can take these config-options, the default is zopetal.
Thanks to Cheer Xiao for the idea of making this configurable *and*
for the actual implementation!
Cheer Xiao commit log:
- The original TAL engine ported from Zope is thereafter referred to as
"zopetal", in speech and in code
- A new option "template_engine" under [main] introduced
- Zopetal-specific code stripped from cgi/templating.py to form the new
cgi/engine_zopetal.py
- Interface to Chameleon in cgi/engine_chameleon.py
- Engines are supposed to provide a Templates class that mimics the
behavior of the old cgi.templating.Templates. The Templates class is
preferably subclassed from cgi.templating.TemplatesBase.
- New function cgi.templating.get_templates to get the appropriate engine's
Templates instance according to the engine name
| author | Ralf Schlatterbeck <rsc@runtux.com> |
|---|---|
| date | Thu, 23 Feb 2012 18:10:03 +0100 |
| parents | eddb82d0964c |
| children | 9ba03348f923 |
line wrap: on
line source
roundup.anypy package - Python version compatibility layer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Roundup currently supports Python 2.3 to 2.6; however, some modules have been introduced, while others have been deprecated. The modules in this package provide the functionalities which are used by Roundup - adapting the most recent Python usage - using new built-in functionality - avoiding deprecation warnings Use the modules in this package to preserve Roundup's compatibility. sets_: sets compatibility module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Since Python 2.4, there is a built-in type 'set'; therefore, the 'sets' module is deprecated since version 2.6. As far as Roundup is concerned, the usage is identical; see http://docs.python.org/library/sets.html#comparison-to-the-built-in-set-types Uses the built-in type 'set' if available, and thus avoids deprecation warnings. Simple usage: Change all:: from sets import Set to:: from roundup.anypy.sets_ import set and use 'set' instead of 'Set' (or sets.Set, respectively). To avoid unnecessary imports, you can:: try: set except NameError: from roundup.anypy.sets_ import set hashlib_: md5/sha/hashlib compatibility ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The md5 and sha modules are deprecated since Python 2.6; the hashlib module, introduced with Python 2.5, is recommended instead. Change all:: import md5 md5.md5(), md5.new() import sha sha.sha(), sha.new() to:: from roundup.anypy.hashlib_ import md5 md5() from roundup.anypy.hashlib_ import sha1 sha1() # vim: si
