From a324a9282ecb6d0d6017f93a92ef2486f7a74b20 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Mon, 15 Sep 2014 00:55:41 -0500 Subject: [PATCH] Use a cheat to get around Mako limitation. --- templates/api.mako | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/api.mako b/templates/api.mako index 70962d8..b2850de 100644 --- a/templates/api.mako +++ b/templates/api.mako @@ -4,15 +4,15 @@ % endfor \ <%def name="walk_json(obj, indent=0)"> - % if isinstance(obj, __builtins__.dict): + % if isinstance(obj, type({})): { - % for key, value in obj.iteritems(): + % for key in obj: ${do_indent(indent + 1)} - "${key | h}": ${walk_json(key, indent + 1)}${"," if not loop.last else ""} + "${key | h}": ${walk_json(obj[key], indent + 1)}${"," if not loop.last else ""} % endfor ${do_indent(indent)} } - % elif isinstance(obj, __builtins__.list): + % elif isinstance(obj, type([])): [ % for member in obj: ${do_indent(indent + 1)}