| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 """PyAuto: Python Interface to Chromium's Automation Proxy. | 6 """PyAuto: Python Interface to Chromium's Automation Proxy. |
| 7 | 7 |
| 8 PyAuto uses swig to expose Automation Proxy interfaces to Python. | 8 PyAuto uses swig to expose Automation Proxy interfaces to Python. |
| 9 For complete documentation on the functionality available, | 9 For complete documentation on the functionality available, |
| 10 run pydoc on this file. | 10 run pydoc on this file. |
| (...skipping 4509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4520 A dictionary with the following keys: | 4520 A dictionary with the following keys: |
| 4521 | 4521 |
| 4522 'next_screen': The title of the next OOBE screen as a string. | 4522 'next_screen': The title of the next OOBE screen as a string. |
| 4523 | 4523 |
| 4524 Raises: | 4524 Raises: |
| 4525 pyauto_errors.JSONInterfaceError if the automation call returns an error. | 4525 pyauto_errors.JSONInterfaceError if the automation call returns an error. |
| 4526 """ | 4526 """ |
| 4527 cmd_dict = { 'command': 'AcceptOOBENetworkScreen' } | 4527 cmd_dict = { 'command': 'AcceptOOBENetworkScreen' } |
| 4528 return self._GetResultFromJSONRequest(cmd_dict, windex=None) | 4528 return self._GetResultFromJSONRequest(cmd_dict, windex=None) |
| 4529 | 4529 |
| 4530 def AcceptOOBEEula(self, accepted, usage_stats_reporting=False): | 4530 def AcceptOOBEEula(self, accepted, usage_stats_reporting=False, |
| 4531 rlz_enabled=False): |
| 4531 """Accepts OOBE EULA and advances to the next screen. | 4532 """Accepts OOBE EULA and advances to the next screen. |
| 4532 | 4533 |
| 4533 Assumes that we're already at the OOBE EULA screen. | 4534 Assumes that we're already at the OOBE EULA screen. |
| 4534 | 4535 |
| 4535 Args: | 4536 Args: |
| 4536 accepted: Boolean indicating whether the EULA should be accepted. | 4537 accepted: Boolean indicating whether the EULA should be accepted. |
| 4537 usage_stats_reporting: Boolean indicating whether UMA should be enabled. | 4538 usage_stats_reporting: Boolean indicating whether UMA should be enabled. |
| 4539 rlz_enabled: Boolean indicating whether RLZ should be enabled. |
| 4538 | 4540 |
| 4539 Returns: | 4541 Returns: |
| 4540 A dictionary with the following keys: | 4542 A dictionary with the following keys: |
| 4541 | 4543 |
| 4542 'next_screen': The title of the next OOBE screen as a string. | 4544 'next_screen': The title of the next OOBE screen as a string. |
| 4543 | 4545 |
| 4544 Raises: | 4546 Raises: |
| 4545 pyauto_errors.JSONInterfaceError if the automation call returns an error. | 4547 pyauto_errors.JSONInterfaceError if the automation call returns an error. |
| 4546 """ | 4548 """ |
| 4547 cmd_dict = { 'command': 'AcceptOOBEEula', | 4549 cmd_dict = { 'command': 'AcceptOOBEEula', |
| 4548 'accepted': accepted, | 4550 'accepted': accepted, |
| 4549 'usage_stats_reporting': usage_stats_reporting } | 4551 'usage_stats_reporting': usage_stats_reporting, |
| 4552 'rlz_enabled': rlz_enabled } |
| 4550 return self._GetResultFromJSONRequest(cmd_dict, windex=None) | 4553 return self._GetResultFromJSONRequest(cmd_dict, windex=None) |
| 4551 | 4554 |
| 4552 def CancelOOBEUpdate(self): | 4555 def CancelOOBEUpdate(self): |
| 4553 """Skips update on OOBE and advances to the next screen. | 4556 """Skips update on OOBE and advances to the next screen. |
| 4554 | 4557 |
| 4555 Returns: | 4558 Returns: |
| 4556 A dictionary with the following keys: | 4559 A dictionary with the following keys: |
| 4557 | 4560 |
| 4558 'next_screen': The title of the next OOBE screen as a string. | 4561 'next_screen': The title of the next OOBE screen as a string. |
| 4559 | 4562 |
| (...skipping 1968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6528 successful = result.wasSuccessful() | 6531 successful = result.wasSuccessful() |
| 6529 if not successful: | 6532 if not successful: |
| 6530 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename) | 6533 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename) |
| 6531 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \ | 6534 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \ |
| 6532 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL) | 6535 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL) |
| 6533 sys.exit(not successful) | 6536 sys.exit(not successful) |
| 6534 | 6537 |
| 6535 | 6538 |
| 6536 if __name__ == '__main__': | 6539 if __name__ == '__main__': |
| 6537 Main() | 6540 Main() |
| OLD | NEW |