[Web-SIG] Standardized template API
mike_mp at zzzcomputing.com
Wed Feb 1 19:50:15 CET 2006
On Feb 1, 2006, at 12:59 PM, Phillip J. Eby wrote:
> At 1
> So asking for "foo" can resolve to "foo.gif" or "foo.jpeg" in the
> file system? If you have to say in the code which it is, that's
> not what I mean.
you can write a resolver that searches the filesystem for "foo.*" and
does some type calculation based on the extension it located, sure.
or you get a similar effect with two resolvers in a chain, one which
is configured to look for "<name>.jpeg" and return a jpeg-template,
and one configured to look for "<name>.gif" to return a gif-
template. you can switch the order of those resolvers to specify one
extension taking precendence over the other. the common use case in
myghty is looking for ".py", which gives you a ModuleComponent, or
".myt" or another file-based extension which gives you a FileComponent.
More information about the Web-SIG