Parcourir la source

Use a cheat to get around Mako limitation.

pull/24/head
Ben Kurtovic il y a 9 ans
Parent
révision
a324a9282e
1 fichiers modifiés avec 4 ajouts et 4 suppressions
  1. +4
    -4
      templates/api.mako

+ 4
- 4
templates/api.mako Voir le fichier

@@ -4,15 +4,15 @@
% endfor
</%def>\
<%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)}


Chargement…
Annuler
Enregistrer