Index: third_party/libadblockplus/subproc.py |
diff --git a/third_party/libadblockplus/subproc.py b/third_party/libadblockplus/subproc.py |
deleted file mode 100644 |
index 3df27e032f9b2d1ea11792bc51c0b5f7fd5318a1..0000000000000000000000000000000000000000 |
--- a/third_party/libadblockplus/subproc.py |
+++ /dev/null |
@@ -1,38 +0,0 @@ |
-import os |
-import sys |
-import subprocess |
- |
- |
-def main(argv): |
- cwd = os.getcwd() |
- subprocess_env = os.environ.copy() |
- subprocess_args = [] |
- for arg in argv: |
- # if it's env var |
- if arg[: 5] == '--env': |
- equal_pos = arg.index('=') |
- key = arg[5:equal_pos] |
- value = arg[equal_pos + 1:len(arg)] |
- print('Set env variable {}={}'.format(key, value)) |
- subprocess_env[key] = value |
- else: |
- # if it's cwd |
- if arg[: 5] == '--cwd': |
- cwd = arg[5:] |
- print('Set cwd={}'.format(cwd)) |
- else: |
- # cmd arguments |
- subprocess_args += [arg] |
- |
- process = subprocess.Popen(subprocess_args, env=subprocess_env, |
- cwd=cwd, stdout=sys.stdout, stderr=sys.stderr) |
- process.communicate() |
- return process.returncode |
- |
- |
-if '__main__' == __name__: |
- try: |
- sys.exit(main(sys.argv[1:])) |
- except KeyboardInterrupt: |
- sys.stderr.write('interrupted\n') |
- sys.exit(1) |