Beispiel #1
0
    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
Beispiel #2
0
 def decode(self,astring):
     jparser = JSONParser()
     return jparser.decode(astring)