docstrings

This commit is contained in:
Kenneth Reitz
2011-08-23 21:06:53 -04:00
parent 20bec630ef
commit e501ec273d
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -58,6 +58,8 @@ class Template(object):
def _compile_regexps(self):
"""Compiles regular expressions, based on otag/ctag values."""
tags = {
'otag': re.escape(self.otag),
'ctag': re.escape(self.ctag)
@@ -196,6 +198,8 @@ class Template(object):
def render(self, encoding=None):
"""Returns rendered Template string."""
template = self._render_sections(self.template, self.view)
result = self._render_tags(template)
+4
View File
@@ -35,6 +35,7 @@ class View(object):
def get(self, attr, default=None):
"""Returns given attribute value from View."""
attr = get_or_attr(self.context_list, attr, getattr(self, attr, default))
@@ -45,6 +46,7 @@ class View(object):
def get_template(self, template_name):
"""Returns current Template."""
if not self.template:
@@ -85,6 +87,8 @@ class View(object):
def render(self, encoding=None):
"""Returns rendered Template."""
template = Template(self.get_template(self.template_name), self)
return template.render(encoding=encoding)