diff options
author | tavis_rudd <tavis_rudd> | 2005-12-30 03:03:02 +0000 |
---|---|---|
committer | tavis_rudd <tavis_rudd> | 2005-12-30 03:03:02 +0000 |
commit | e80b1585dd606439f0db8e54d6a91db31a00e214 (patch) | |
tree | b74290b2e806ff2571bd310d179a44f18b85043e /CHANGES | |
parent | fddb3413b27cedb1bae9097b6e54f5045a9ece20 (diff) | |
download | python-cheetah-e80b1585dd606439f0db8e54d6a91db31a00e214.tar.gz |
*** empty log message ***
Diffstat (limited to 'CHANGES')
-rw-r--r-- | CHANGES | 103 |
1 files changed, 103 insertions, 0 deletions
@@ -2,6 +2,109 @@ Please initial your changes (there's a key at bottom) and add a date for each release ================================================================================ +2.0b1 (Dec 29, 2005) + !!!THIS RELEASE REQUIRES RECOMPILATION OF ALL COMPILED CHEETAH TEMPLATES!!! + + Core Changes: + - enabled use of any expression in ${placeholders}. See the examples I posted to + the email list on Dec 12th. All use cases of the #echo directive can now + be handled with ${placeholders}. This came from a suggestion by Mike + Orr. [TR] + + - made it possible for templates to #extend (aka subclass) any arbitrary + baseclass, including Python's new style classes. You must either compile + your classes on the command line or use the new classmethod + Template.compile() as described below. The old Template(src) interface + still works, provided you don't try to use this new arbitrary baseclass + stuff. See my messages to the email list for more details. [TR] + + - made it possible to create template classes dynamically, rather than just + instances. See the new classmethod Template.compile(). See my messages + to the email list for more details. [TR] + + klass = Template.compile(src) + + - made it easier to work with custom compiler settings, particularly from + the command line tool. You can now define a subclass of Template which + will compile your templates using custom compilerSettings, or even a + custom compiler class, without requiring you to manually pass in your + compilerSettings each time or define them in the template src itself via + the #compiler directive. You can make the command line tool use your + subclass by defining the environment variable CHEETAH_TEMPLATE_CLASS. It + should be in the form 'package.module:class'. See my messages + to the email list for more details. [TR] + + - made it possible to pass the searchList in as an argument to #def'ined + methods. This makes all lookup that occur within the scope of that method + use the provided searchList rather than self._searchList. This does not + carry over to other methods called within the top method, unless they + explicitly accept the searchList in their signature AND you pass it to + them when calling them. This behaviour can be turned off with the + corresponding compilerSetting 'allowSearchListAsMethArg' [TR] + + - added hooks for filtering / restricting dangerous stuff in cheetah source + code at compile time. These hooks can be used to enable Cheetah template + authoring by untrusted users. See my messages to the email list for more + details. Note, it filters expressions at parse/compile time, unlike Python's + old rexec module which restricted the Python environment at runtime. [TR] + + # Here are the relevant compiler settings: + # use lower case keys here!! + 'disabledDirectives':[], # list of directive keys, without the start token + 'enabledDirectives':[], # list of directive keys, without the start token + + 'disabledDirectiveHooks':[], # callable(parser, directiveKey), + # called when a disabled directive is found, prior to raising an exception + + 'preparseDirectiveHooks':[], # callable(parser, directiveKey) + 'postparseDirectiveHooks':[], # callable(parser, directiveKey) + + 'preparsePlaceholderHooks':[], # callable(parser) + 'postparsePlaceholderHooks':[], # callable(parser) + + 'expressionFilterHooks':[], + # callable(parser, expr, exprType, rawExpr=None, startPos=None) + # exprType is the name of the directive, 'psp', or 'placeholder'. + #all lowercase + + - added support for a short EOLSlurpToken to supplement the #slurp + directive. It's currently re.compile('#\s*\n') (i.e # followed by + arbitrary whitespace and a new line), but this is not set in stone. One + other suggestion was the backslash char, but I believe Python's own + interpretation of backslashes will lead to confusion. The compiler + setting 'EOLSlurpToken' controls this. You can turn it off completely by + setting 'EOLSlurpToken' to None. See the email list for more details. [TR] + + - added '_CHEETAH_' prefix to all instance attribute names in compiled + templates. This is related to the arbitrary baseclass change. [TR] + + - shifted instance attribute setup to _initCheetahAttributes() method. This + is related to the arbitrary baseclass change. [TR] + + - made it possible to use full expressions in the #extends directive, rather + than just dotted names. This allows you to do things like this: + + #from xx.TemplateRepository import getTemplateClass + #extends getTemplateClass('someName') + + I don't expect this to be used much. I needed it for a wiki system in + which the baseclasses for the templates are dynamically compiled at run + time and are not available via simple imports. [TR] + + - fixed a bug in the parsing of single-line #def's and #block's when they + are enclosed within #if ... #end if. Reported by Marcin Gajda [TR] + + - tweak to remove needless write('') calls in generated code [TR] + + The command line tool (CheetahWrapper.py): + - added code to cleanup trailing slashes on path arguments (code originally + from Mike Orr) [TR] + - turned on the ImportHooks by default for the 'cheetah fill' command. See the + discussion on the email list [TR] + + ImportHooks: + - fixed a name error bug in the ImportHooks [TR] + 1.0 (Dec 4, 2005) !!!THIS RELEASE REQUIRES RECOMPILATION OF ALL COMPILED CHEETAH TEMPLATES!!! |