| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Utility for reading / writing command-line flag files on device(s).""" | 6 """Utility for reading / writing command-line flag files on device(s).""" |
| 7 | 7 |
| 8 import argparse | 8 import argparse |
| 9 import sys | 9 import sys |
| 10 | 10 |
| 11 import devil_chromium | 11 import devil_chromium |
| 12 |
| 12 from devil.android import device_utils | 13 from devil.android import device_utils |
| 13 from devil.android import device_errors | 14 from devil.android import device_errors |
| 14 from devil.utils import cmd_helper | 15 from devil.utils import cmd_helper |
| 15 | 16 |
| 16 | 17 |
| 17 def main(): | 18 def main(): |
| 18 parser = argparse.ArgumentParser(description=__doc__) | 19 parser = argparse.ArgumentParser(description=__doc__) |
| 19 parser.usage = '''%(prog)s --device-path PATH [--device SERIAL] [flags...] | 20 parser.usage = '''%(prog)s --device-path PATH [--device SERIAL] [flags...] |
| 20 | 21 |
| 21 No flags: Prints existing command-line file. | 22 No flags: Prints existing command-line file. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 device.RunShellCommand(['chmod', '0664', args.device_path], as_root=as_root) | 78 device.RunShellCommand(['chmod', '0664', args.device_path], as_root=as_root) |
| 78 | 79 |
| 79 all_devices.pMap(write_flags).pGet(None) | 80 all_devices.pMap(write_flags).pGet(None) |
| 80 print 'Wrote flags to %s' % args.device_path | 81 print 'Wrote flags to %s' % args.device_path |
| 81 print_args() | 82 print_args() |
| 82 return 0 | 83 return 0 |
| 83 | 84 |
| 84 | 85 |
| 85 if __name__ == '__main__': | 86 if __name__ == '__main__': |
| 86 sys.exit(main()) | 87 sys.exit(main()) |
| OLD | NEW |