Index: third_party/widevine/cdm/copy_with_rename.py |
diff --git a/third_party/widevine/cdm/copy_with_rename.py b/third_party/widevine/cdm/copy_with_rename.py |
new file mode 100755 |
index 0000000000000000000000000000000000000000..10e2328c7bc1f627d3424d888bd7fb2b88f0f40c |
--- /dev/null |
+++ b/third_party/widevine/cdm/copy_with_rename.py |
@@ -0,0 +1,33 @@ |
+#!/usr/bin/env python |
+# Copyright 2014 The Chromium Authors. All rights reserved. |
ddorwin
2015/03/28 04:00:11
2015 unless you copied this file.
jrummell
2015/04/01 23:37:37
Done.
|
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+ |
+import os |
+import shutil |
+import sys |
+ |
+def usage(): |
+ print """\nUsage: %s <input_files> <output_files> |
+ |
+ Copies 1 or 2 <input_files> to matching <output_files> |
+ |
+ Examples: |
+ Copy 1 file: |
+ ./copy_with_rename.py in out |
+ Copy 2 files: |
+ ./copy_with_rename.py in1 in2 out1 out2 |
+ """ % sys.argv[0] |
+ sys.exit(1) |
+ |
+def Main(argv): |
+ if len(argv) == 3: |
+ return shutil.copyfile(argv[1], argv[2]) |
+ elif len(argv) == 5: |
+ return shutil.copyfile(argv[1], argv[3]) |
+ return shutil.copyfile(argv[2], argv[4]) |
xhwang
2015/03/30 17:23:50
return twice?
jrummell
2015/04/01 23:37:37
Fixed.
|
+ else: |
+ usage() |
+ |
+if __name__ == '__main__': |
+ sys.exit(Main(sys.argv)) |