Chromium Code Reviews| Index: tools/py_event_log_analyzer/copy_files.py |
| diff --git a/tools/py_event_log_analyzer/copy_files.py b/tools/py_event_log_analyzer/copy_files.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..21a56c86b6694a98ec11bb0eb748bb26c37b8b27 |
| --- /dev/null |
| +++ b/tools/py_event_log_analyzer/copy_files.py |
| @@ -0,0 +1,32 @@ |
| +# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
| +# |
| +# Use of this source code is governed by a BSD-style license |
| +# that can be found in the LICENSE file in the root of the source |
| +# tree. An additional intellectual property rights grant can be found |
| +# in the file PATENTS. All contributing project authors may |
| +# be found in the AUTHORS file in the root of the source tree. |
| + |
| +"""File copying script for OS compatibility. Used when building.""" |
| + |
| +import optparse |
| +import os |
| +import shutil |
| + |
| + |
| +def main(): |
| + parser = optparse.OptionParser() |
| + parser.add_option("--input_dir", help="directory with *py files") |
| + parser.add_option("--output_dir", help="where to copy *py files") |
| + (options, _) = parser.parse_args() |
|
phoglund
2016/06/03 08:11:07
Nit: remove ( ).
aleloi
2016/06/09 12:00:44
The standings among reviewers are currently 1-1 fo
kwiberg-webrtc
2016/06/09 12:27:20
If it helps resolve the impasse, I can change my +
|
| + |
| + for file_name in os.listdir(options.input_dir): |
| + if file_name.endswith(".py"): |
| + copy_file(file_name, options.input_dir, options.output_dir) |
| + |
| + |
| +def copy_file(file_name, path_from, path_to): |
| + shutil.copyfile(os.path.join(path_from, file_name), |
| + os.path.join(path_to, file_name)) |
| + |
| +if __name__ == "__main__": |
| + main() |