Added escaped JSON output.

This commit is contained in:
Nick Daly 2012-06-28 00:34:08 -05:00
parent 13a2880fa0
commit a464841867
9 changed files with 16 additions and 1 deletions

View File

@ -0,0 +1,2 @@
#from protocols.https.templates.json.escape import json_escape
$json_escape($services)

View File

@ -0,0 +1,2 @@
#from protocols.https.templates.json.escape import json_escape
$json_escape($locations)

View File

@ -1 +1,2 @@
$hosts
#from protocols.https.templates.json.escape import json_escape
$json_escape($hosts)

View File

@ -0,0 +1,4 @@
import cgi, json
def json_escape(x):
return [json.dumps(cgi.escape(y)) for y in x]

View File

@ -0,0 +1,2 @@
#from protocols.https.templates.json.escape import json_escape
$json_escape($services)

View File

@ -0,0 +1,2 @@
#from protocols.https.templates.json.escape import json_escape
$json_escape($locations)

View File

@ -0,0 +1,2 @@
#from protocols.https.templates.json.escape import json_escape
$json_escape($clients)