| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 1 # This Source Code is subject to the terms of the Mozilla Public License | 1 # This Source Code is subject to the terms of the Mozilla Public License |
| 2 # version 2.0 (the "License"). You can obtain a copy of the License at | 2 # version 2.0 (the "License"). You can obtain a copy of the License at |
| 3 # http://mozilla.org/MPL/2.0/. | 3 # http://mozilla.org/MPL/2.0/. |
| 4 | |
| 5 from __future__ import print_function | |
|
Sebastian Noack
2016/08/30 11:44:38
I just noticed that this future import here isn't
Vasily Kuznetsov
2016/08/30 13:16:30
Acknowledged.
| |
| 6 | 4 |
| 7 import os | 5 import os |
| 8 import subprocess | 6 import subprocess |
| 9 | 7 |
| 10 import utils | 8 import utils |
| 11 | 9 |
| 12 | 10 |
| 13 def rewrite_js(args, script=None): | 11 def rewrite_js(args, script=None): |
|
Sebastian Noack
2016/08/28 22:36:13
Yes, this is a breaking change that needs to be ad
Vasily Kuznetsov
2016/08/30 13:16:30
Acknowledged.
| |
| 14 jsshell = utils.ensureJSShell() | 12 jsshell = utils.ensureJSShell() |
| 15 env = {'LD_LIBRARY_PATH': os.path.relpath(os.path.dirname(jsshell))} | 13 env = {'LD_LIBRARY_PATH': os.path.relpath(os.path.dirname(jsshell))} |
| 16 base_dir = os.path.dirname(__file__) | 14 base_dir = os.path.dirname(__file__) |
| 17 | 15 |
| 18 if not script: | 16 if not script: |
| 19 script = os.path.join(base_dir, 'scripts', 'abprewrite.js') | 17 script = os.path.join(base_dir, 'scripts', 'abprewrite.js') |
| 20 | 18 |
| 21 command = [jsshell, os.path.join(base_dir, 'jshydra.js'), script] + args | 19 command = [jsshell, os.path.join(base_dir, 'jshydra.js'), script] + args |
| 22 return subprocess.check_output(command, env=env, universal_newlines=True) | 20 return subprocess.check_output(command, env=env, universal_newlines=True) |
| LEFT | RIGHT |