| OLD | NEW |
| 1 #!/usr/bin/env python |
| 2 |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 4 | 6 |
| 5 import sys | 7 import sys |
| 6 from optparse import OptionParser | 8 from optparse import OptionParser |
| 7 from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice | 9 from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice |
| 8 | 10 |
| 9 def main(argv): | 11 def main(argv): |
| 10 # Parse options. | 12 # Parse options. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 if not device: | 32 if not device: |
| 31 return 1 | 33 return 1 |
| 32 | 34 |
| 33 # Grab screenshot and write to disk. | 35 # Grab screenshot and write to disk. |
| 34 result = device.takeSnapshot() | 36 result = device.takeSnapshot() |
| 35 result.writeToFile(options.filename, 'png') | 37 result.writeToFile(options.filename, 'png') |
| 36 return 0 | 38 return 0 |
| 37 | 39 |
| 38 if __name__ == '__main__': | 40 if __name__ == '__main__': |
| 39 sys.exit(main(sys.argv)) | 41 sys.exit(main(sys.argv)) |
| OLD | NEW |