Re: How do I reference functions from another template?
Michael DeHaan <[email protected]>
| Newsgroups | gmane.comp.python.cheetah |
|---|---|
| Message-ID | <[email protected]> |
R. Tyler Ballance wrote:
> On Mon, May 04, 2009 at 09:34:03PM -0400, Saul Jaspan wrote:
>
>> Lets say I have a template, dir1/dir2/dir3/foo.tmpl:
>>
>> #def FooFunct($param1, $param2):
>> Stuff here
>> #end def
>>
>> and another template where I want to call FooFunct, dir1/base.tmpl:
>>
>> #include "dir1/dir2/dir3/foo.tmpl"
>> #* Want to call $FooFunct("1", "2") *#
>>
>
>
> Tavis and I have talked about starting to try to phase out the "#include"
> statement so I wouldn't exactly recommend it if you can avoid it.
>
Please don't. That would break quite a few folks existing template
usage in my userbase.
Cobbler snippets are actually implemented as:
"#def SNIPPET($file)",
"#set $fullpath = $find_snippet($file)",
"#if $fullpath",
"#include $fullpath",
"#else",
"# Error: no snippet data for $file",
"#end if",
"#end def",
Please please please don't do this.
API breakage when needing to support things all the way from
RHEL/CentOS-4 through Fedora-latest is fun enough without having to code
workarounds. It happens, of course, but I find this feature to be
quite useful.
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com