equal
deleted
inserted
replaced
20 from types import StringType |
20 from types import StringType |
21 import compiler |
21 import compiler |
22 from compiler import ast |
22 from compiler import ast |
23 import os |
23 import os |
24 import copy |
24 import copy |
|
25 from builtins import str as text |
25 from six.moves import cStringIO |
26 from six.moves import cStringIO |
26 |
27 |
27 # the standard location for builtins (e.g. pyjslib) can be |
28 # the standard location for builtins (e.g. pyjslib) can be |
28 # over-ridden by changing this. it defaults to sys.prefix |
29 # over-ridden by changing this. it defaults to sys.prefix |
29 # so that on a system-wide install of pyjamas the builtins |
30 # so that on a system-wide install of pyjamas the builtins |
1357 return str(node.value) |
1358 return str(node.value) |
1358 elif isinstance(node.value, float): |
1359 elif isinstance(node.value, float): |
1359 return str(node.value) |
1360 return str(node.value) |
1360 elif isinstance(node.value, basestring): |
1361 elif isinstance(node.value, basestring): |
1361 v = node.value |
1362 v = node.value |
1362 if isinstance(node.value, unicode): |
1363 if isinstance(node.value, text): |
1363 v = v.encode('utf-8') |
1364 v = v.encode('utf-8') |
1364 return "String('%s')" % escapejs(v) |
1365 return "String('%s')" % escapejs(v) |
1365 elif node.value is None: |
1366 elif node.value is None: |
1366 return "null" |
1367 return "null" |
1367 else: |
1368 else: |