equal
deleted
inserted
replaced
18 from types import StringType |
18 from types import StringType |
19 import compiler |
19 import compiler |
20 from compiler import ast |
20 from compiler import ast |
21 import os |
21 import os |
22 import copy |
22 import copy |
|
23 import cStringIO |
23 |
24 |
24 # the standard location for builtins (e.g. pyjslib) can be |
25 # the standard location for builtins (e.g. pyjslib) can be |
25 # over-ridden by changing this. it defaults to sys.prefix |
26 # over-ridden by changing this. it defaults to sys.prefix |
26 # so that on a system-wide install of pyjamas the builtins |
27 # so that on a system-wide install of pyjamas the builtins |
27 # can be found in e.g. {sys.prefix}/share/pyjamas |
28 # can be found in e.g. {sys.prefix}/share/pyjamas |
1518 return self._lambda(node, current_klass) |
1519 return self._lambda(node, current_klass) |
1519 else: |
1520 else: |
1520 raise TranslationError("unsupported type (in expr)", node) |
1521 raise TranslationError("unsupported type (in expr)", node) |
1521 |
1522 |
1522 |
1523 |
1523 import cStringIO |
|
1524 |
|
1525 |
|
1526 def translate(file_name, module_name, debug=False): |
1524 def translate(file_name, module_name, debug=False): |
1527 f = file(file_name, "r") |
1525 f = file(file_name, "r") |
1528 src = f.read() |
1526 src = f.read() |
1529 f.close() |
1527 f.close() |
1530 output = cStringIO.StringIO() |
1528 output = cStringIO.StringIO() |