Re: [Cheetahtemplate-discuss] Template()
Brought to you by:
rtyler,
tavis_rudd
From: <ir...@ms...> - 2001-09-13 03:44:20
|
On Wed, Sep 12, 2001 at 06:26:03PM -0700, Chuck Esterbrook wrote: > >'namespace' is not required. All templates implicitly have the template > >object itself as one of the search objects. > > When is that ever useful? Does anyone really create template objects > without an explicit namespace? I do. It's also useful if your template object has methods you want to call, or inherits from a class that has methods you want to call. > >** The 'settings' parameter. I assume this is a must-have, because users > >will want to change settings. __init__ itself uses the settings > >'formatter', 'formatterClass', 'errorChecker', 'errorCheckerClass', > >'plugins', 'delayedCompile' to adjust its behavior. > > So we add it in. Although I don't see it in the original signature. Must be > one of those "secret" arguments. It is. > >** 'overwriteSettings'. This clears out the settings before adding the > >new ones, rather than merging the new ones in. > > What's that for? Tavis thought it would be useful. If you want to ensure no default settings leak in. > >** 'setVars'. Apparently used internally to pass #set variables to > >nested templates. > > > >** 'preBuiltSearchList', 'macros', 'cheetahBlocks'. > >"these are for internal use by Nested Templates in #include's" We'll have to ask Tavis whether there's another way to handle these rather than using keyword arguments. Maybe he can use a special constructor function to create nested templates. > So are the above things additional settings or additional arguments that > are pulled out of **kw? They are keyword arguments. > In the current __init__ interface, we seem to arbitrarily have explicit > arguments and implicit arguments. I don't see why some args fall on one > side of the fence and others on the other side. I think Cheetah was originally intended for string template definitions, and 'file' was added as an afterthought. So a normal call would have only positional parameters. -- -Mike (Iron) Orr, ir...@ms... (if mail problems: ms...@ji...) http://iron.cx/ English * Esperanto * Russkiy * Deutsch * Espan~ol |