xo::REST method pp (public)

 <instance of xo::REST[i]> pp [ -list ] [ -prefix prefix ] dict

Defined in packages/xooauth/tcl/rest-procs.tcl

Simple pretty-print function which is based on the conventions of the dict structures as returned from Microsoft Graph API. Multi-valued results are returned in a dict member named "value", which are printed indented and space separated.

Switches:
-list (optional)
-prefix (optional)
Parameters:
dict (required)

Testcases:
No testcase defined.
Source code:
set r ""
if {$list} {
    foreach e $dict {
        append r [:pp -list=0 -prefix $prefix $e] \n
    }
    return $r
}

foreach {k v} $dict {
    if {$k eq "value"} {
        append r $prefix $k ": " \n
        foreach e $v {
            append r [:pp -prefix "    $prefix" $e] \n
        }
    } else {
        append r $prefix $k ": " $v \n
    }
}
return $r
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: