Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: abp_rewrite.py

Issue 29350244: Issue 4374 - Made Python code part of jshydra comply with our coding practices (Closed)
Patch Set: Created Aug. 28, 2016, 10:42 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | autotest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4
5 from __future__ import print_function 5 from __future__ import print_function
6 6
7 import os 7 import os
8 import subprocess 8 import subprocess
9 9
10 import utils 10 import utils
11 11
12 12
13 def rewrite_js(args, script=None): 13 def rewrite_js(args, script=None):
14 jsshell = utils.ensureJSShell() 14 jsshell = utils.ensure_jsshell()
15 env = {'LD_LIBRARY_PATH': os.path.relpath(os.path.dirname(jsshell))} 15 env = {'LD_LIBRARY_PATH': os.path.relpath(os.path.dirname(jsshell))}
16 base_dir = os.path.dirname(__file__) 16 base_dir = os.path.dirname(__file__)
17 17
18 if not script: 18 if not script:
19 script = os.path.join(base_dir, 'scripts', 'abprewrite.js') 19 script = os.path.join(base_dir, 'scripts', 'abprewrite.js')
20 20
21 command = [jsshell, os.path.join(base_dir, 'jshydra.js'), script] + args 21 command = [jsshell, os.path.join(base_dir, 'jshydra.js'), script] + args
22 return subprocess.check_output(command, env=env, universal_newlines=True) 22 return subprocess.check_output(command, env=env, universal_newlines=True)
OLDNEW
« no previous file with comments | « no previous file | autotest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld