equal
deleted
inserted
replaced
1530 else: |
1530 else: |
1531 raise TranslationError("unsupported type (in expr)", node) |
1531 raise TranslationError("unsupported type (in expr)", node) |
1532 |
1532 |
1533 |
1533 |
1534 def translate(file_name, module_name, debug=False): |
1534 def translate(file_name, module_name, debug=False): |
1535 f = file(file_name, "r") |
1535 f = open(file_name, "r") |
1536 src = f.read() |
1536 src = f.read() |
1537 f.close() |
1537 f.close() |
1538 output = cStringIO() |
1538 output = cStringIO() |
1539 mod = compiler.parseFile(file_name) |
1539 mod = compiler.parseFile(file_name) |
1540 Translator(module_name, module_name, module_name, src, debug, mod, output) |
1540 Translator(module_name, module_name, module_name, src, debug, mod, output) |
1684 |
1684 |
1685 file_name = self.findFile(module_name + self.extension) |
1685 file_name = self.findFile(module_name + self.extension) |
1686 |
1686 |
1687 output = cStringIO() |
1687 output = cStringIO() |
1688 |
1688 |
1689 f = file(file_name, "r") |
1689 f = open(file_name, "r") |
1690 src = f.read() |
1690 src = f.read() |
1691 f.close() |
1691 f.close() |
1692 |
1692 |
1693 mod, override = self.parser.parseModule(module_name, file_name) |
1693 mod, override = self.parser.parseModule(module_name, file_name) |
1694 if override: |
1694 if override: |
1747 path = self.findFile(js) |
1747 path = self.findFile(js) |
1748 if os.path.isfile(path): |
1748 if os.path.isfile(path): |
1749 if self.verbose: |
1749 if self.verbose: |
1750 print('Including JS', js) |
1750 print('Including JS', js) |
1751 print('\n//\n// BEGIN JS '+js+'\n//\n', file=lib_code) |
1751 print('\n//\n// BEGIN JS '+js+'\n//\n', file=lib_code) |
1752 print(file(path).read(), file=lib_code) |
1752 print(open(path).read(), file=lib_code) |
1753 print('\n//\n// END JS '+js+'\n//\n', file=lib_code) |
1753 print('\n//\n// END JS '+js+'\n//\n', file=lib_code) |
1754 else: |
1754 else: |
1755 print('Warning: Unable to find imported javascript:', js, file=sys.stderr) |
1755 print('Warning: Unable to find imported javascript:', js, file=sys.stderr) |
1756 return lib_code.getvalue(), app_code.getvalue() |
1756 return lib_code.getvalue(), app_code.getvalue() |
1757 |
1757 |