diff options
| author | Ben Bangert <ben@groovie.org> | 2010-10-27 17:56:42 -0700 |
|---|---|---|
| committer | Ben Bangert <ben@groovie.org> | 2010-10-27 17:56:42 -0700 |
| commit | 6b49316f217a8fd72f8dac2abd7b7fcd8084e8bc (patch) | |
| tree | 016fa69fc30fd4f319a14d5bb59b671009fa5ce0 | |
| parent | ecbf957db6c1efbc4c90852d3a62ca4df669f5f4 (diff) | |
| download | pyramid-6b49316f217a8fd72f8dac2abd7b7fcd8084e8bc.tar.gz pyramid-6b49316f217a8fd72f8dac2abd7b7fcd8084e8bc.tar.bz2 pyramid-6b49316f217a8fd72f8dac2abd7b7fcd8084e8bc.zip | |
Add doc strings for TemplateLookup subclass.
| -rw-r--r-- | pyramid/mako_templating.py | 12 |
1 files changed, 12 insertions, 0 deletions
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: |
