def wdecode(self,astring): anobj = None JS(""" anobj = unescape(astring); """) nastring = ''' [ { "body" : "escreva", "line" : 1 }, { "body" : "aqui", "line" : 2 } ]''' #JS(""" # anobj = JSON.parse(astring); # """) #return anobj astring = anobj.replace("'",'"') jparser = JSONParser() return jparser.decode(astring) #anobj
def decode(self,astring): jparser = JSONParser() return jparser.decode(astring)