From 6b49316f217a8fd72f8dac2abd7b7fcd8084e8bc Mon Sep 17 00:00:00 2001 From: Ben Bangert Date: Wed, 27 Oct 2010 17:56:42 -0700 Subject: Add doc strings for TemplateLookup subclass. --- pyramid/mako_templating.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pyramid/mako_templating.py b/pyramid/mako_templating.py index 7946381a5..fb7a40c1c 100644 --- a/pyramid/mako_templating.py +++ b/pyramid/mako_templating.py @@ -20,13 +20,25 @@ class IMakoLookup(Interface): class PkgResourceTemplateLookup(TemplateLookup): + """TemplateLookup subclass that handles resource specification + uri's""" def adjust_uri(self, uri, relativeto): + """Called from within a Mako template, avoids adjusting the + uri if it looks like a resource specification""" # Don't adjust pkg resource spec names if ':' in uri: return uri return TemplateLookup.adjust_uri(self, uri, relativeto) def get_template(self, uri): + """Fetch a template from the cache, or check the filesystem + for it + + In addition to the basic filesystem lookup, this subclass will + use pkg_resource to load a file using the resource + specification syntax. + + """ if ':' not in uri: return TemplateLookup.get_template(self, uri) try: -- cgit v1.2.3