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

Unified Diff: third_party/libadblockplus_android/subproc.py

Issue 29674558: Issue 6286 - Remove common scripts duplicating (Closed)
Patch Set: Created Jan. 19, 2018, 8:03 a.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
Index: third_party/libadblockplus_android/subproc.py
diff --git a/third_party/libadblockplus_android/subproc.py b/third_party/libadblockplus_android/subproc.py
deleted file mode 100644
index 3df27e032f9b2d1ea11792bc51c0b5f7fd5318a1..0000000000000000000000000000000000000000
--- a/third_party/libadblockplus_android/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)

Powered by Google App Engine
This is Rietveld