Explorar el Código

Use a cheat to get around Mako limitation.

pull/24/head
Ben Kurtovic hace 10 años
padre
commit
a324a9282e
Se han modificado 1 ficheros con 4 adiciones y 4 borrados
  1. +4
    -4
      templates/api.mako

+ 4
- 4
templates/api.mako Ver fichero

@@ -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)}


Cargando…
Cancelar
Guardar