Load a template from a string. This parses the source given and returns a :class:`Template` object.
(self, source, globals=None, template_class=None)
| 758 | return self.select_template(template_name_or_list, parent, globals) |
| 759 | |
| 760 | def from_string(self, source, globals=None, template_class=None): |
| 761 | """Load a template from a string. This parses the source given and |
| 762 | returns a :class:`Template` object. |
| 763 | """ |
| 764 | globals = self.make_globals(globals) |
| 765 | cls = template_class or self.template_class |
| 766 | return cls.from_code(self, self.compile(source), globals, None) |
| 767 | |
| 768 | def make_globals(self, d): |
| 769 | """Return a dict for the globals.""" |
no test coverage detected