Implement nested tables for HTTP APIs. It even works(!)

This commit is contained in:
Kegan Dougal 2015-06-02 12:03:10 +01:00
parent 0275c2ffa0
commit 14d004146b
3 changed files with 30 additions and 16 deletions

View file

@ -25,13 +25,14 @@ class Sections(object):
if not func_name.startswith("render_"):
continue
section_key = func_name[len("render_"):]
self.log("Generating section '%s'" % section_key)
section = func()
if not isinstance(section, basestring):
raise Exception(
"Section function '%s' didn't return a string!" % func_name
)
section_dict[section_key] = section
self.log("Generated section '%s' : %s" % (
section_key, section[:60].replace("\n","")
))
self.log(
" Generated. Snippet => %s" % section[:60].replace("\n","")
)
return section_dict