On 1/17/06, Ian Bicking <[EMAIL PROTECTED]> wrote: > > There's a couple things that seem weird to me in the template API. > > * What's up with the use of module names? Since they aren't really > Python files anyway, and you also need __init__.py files.
That's not necessarily true. They *can* be Python files. Cheetah and Kid both support compilation to .pyc files. Basically, this provides an unambiguous way to describe where a template is. You're right that doing it like that requires __init__.py, though. > * There should really really be a search path for templates. That > doesn't fit well with the modules either. Why should there be a search path? To save on typing? (Which is not an unreasonable reason, actually...) What API would you like to see? > * I'm confused what the purpose of .load_template() is. Or what it > should return. No return value is required. The purpose is to compile and load a template which *is* a Python module for importing later (without the use of import hooks). > * Where is the TurboCheetah repository? Can you put an svn link (with > #egg=TurboCheetah-dev) on the cheese shop page? Done. http://www.turbogears.org/svn/turbogears/trunk/plugins/cheetah/ > Another item: I feel like distribution and package are getting confused. > This line: > > tfile = pkg_resources.resource_filename(package, > "%s.%s" % > (basename, > self.extension)) > > The "package" here is actually a distribution name, and isn't related to > Python packages. This further muddles the use of module-like names for > templates, as you can't dot a distribution name with anything. From http://peak.telecommunity.com/DevCenter/PkgResources#resource-extraction resource_filename(package_or_requirement, resource_name) Kevin

