diff options
Diffstat (limited to 'pystache/renderengine.py')
-rw-r--r-- | pystache/renderengine.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pystache/renderengine.py b/pystache/renderengine.py index e1d57e4..4b0ba20 100644 --- a/pystache/renderengine.py +++ b/pystache/renderengine.py @@ -7,6 +7,7 @@ Defines a class responsible for rendering logic. import re +from pystache.common import TemplateNotFoundError from pystache.parser import Parser @@ -65,6 +66,12 @@ class RenderEngine(object): self.load_partial = load_partial # TODO: rename context to stack throughout this module. + def read_partial(self, key): + try: + return self.load_partial(key) + except TemplateNotFoundError: + return u'' + def _get_string_value(self, context, tag_name): """ Get a value from the given context as a basestring instance. |