Ticket #13 (closed bug: fixed)

Opened 9 years ago

Last modified 9 years ago

ajax.py2js with strings and dicts

Reported by: vrialland Owned by: apoirier
Priority: major Component: renderers
Version: 0.1.0 Keywords: py2js
Cc:

Description

Strings :
py2js doesn't escape characters such as ", \n...

current code: ajax.py line 365 :
return '"'+value+'"

working:
return '"%s"' % value.replace('
', '

').replace("\n","
n").replace('"','
"')



Dicts
:
An error occurs when a key in the dict contains the minus sign, Python tries to evaluate it:

current code : ajax.py line 323
return '{ ' + ', '.join(% (name, py2js(value, h)) for (name, value) in d.items()?) + '}'

working :
return '{ ' + ', '.join(% (py2js(name, h), py2js(value, h)) for (name, value) in d.items()?) + ' }'

Change History

comment:1 Changed 9 years ago by apoirier

  • Status changed from new to closed
  • Resolution set to fixed

(In [df275dba3f010375c92fc02e0c20e6b2f45e50fb]) AJAX communications refactoring:

  • using YAHOO.Get
  • no more DummyRenderer
  • handling of anonymous scripts and css styles
  • correct transcoding of unicode strings


Fixed #13 and #14

Note: See TracTickets for help on using tickets.