| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # coding: utf-8 | 2 # coding: utf-8 |
| 3 | 3 |
| 4 import os, sys, subprocess | 4 import os, sys, subprocess |
| 5 | 5 |
| 6 DEPENDECY_SCRIPT = os.path.join(os.getcwd(), "ensure_dependencies.py") | 6 DEPENDENCY_SCRIPT = os.path.join(os.path.dirname(__file__), "ensure_dependencies .py") |
|
Wladimir Palant
2014/12/17 14:29:32
1) Nit: DEPENDENCY_SCRIPT please.
2) Don't use cur
| |
| 7 | 7 |
| 8 try: | 8 if os.path.isfile(DEPENDENCY_SCRIPT): |
| 9 subprocess.check_call(["python", DEPENDECY_SCRIPT]) | 9 try: |
|
Wladimir Palant
2014/12/17 14:29:32
Only call this if the script actually exists pleas
| |
| 10 except subprocess.CalledProcessError as e: | 10 subprocess.check_call(["python", DEPENDENCY_SCRIPT]) |
| 11 print >>sys.stderr, str(e)+'\n' | 11 except subprocess.CalledProcessError as e: |
|
Wladimir Palant
2014/12/17 14:29:32
print will automatically add a newline, no need to
| |
| 12 print >>sys.stderr,"Failed to ensure dependencies being up-to-date!"+'\n' | 12 print >>sys.stderr, e |
|
Wladimir Palant
2014/12/17 14:29:32
Style nit: space after comma please.
Newline is u
| |
| 13 print >>sys.stderr, "Failed to ensure dependencies being up-to-date!" | |
| 13 | 14 |
| 14 import buildtools.build | 15 import buildtools.build |
| 15 buildtools.build.processArgs('.', sys.argv) | 16 buildtools.build.processArgs('.', sys.argv) |
| LEFT | RIGHT |