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

Unified Diff: utils.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.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tox.ini ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils.py
===================================================================
--- a/utils.py
+++ b/utils.py
@@ -31,14 +31,12 @@
}
-def ensureJSShell():
+def ensure_jsshell():
path = os.environ.get('SPIDERMONKEY_BINARY')
if path and os.path.isfile(path):
return path
- baseDir = os.path.dirname(__file__)
system = platform.system()
-
try:
build = JSSHELL_SUPPORTED_PLATFORMS[system]
if isinstance(build, dict):
@@ -48,7 +46,8 @@
system, platform.machine()
))
- shell_dir = os.path.join(baseDir, JSSHELL_DIR + "-" + build)
+ shell_dir = os.path.join(os.path.dirname(__file__),
+ '{}-{}'.format(JSSHELL_DIR, build))
if not os.path.exists(shell_dir):
os.makedirs(shell_dir)
if system == 'Windows':
@@ -66,7 +65,7 @@
archive.extractall(shell_dir)
if not os.path.exists(path):
- raise Exception('Downloaded package didn\'t contain JS shell executable')
+ raise Exception("Downloaded package doesn't contain JS shell")
try:
os.chmod(path, 0o700)
« no previous file with comments | « tox.ini ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld