Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 4 # 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 |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 """PyAuto: Python Interface to Chromium's Automation Proxy. | 7 """PyAuto: Python Interface to Chromium's Automation Proxy. |
| 8 | 8 |
| 9 PyAuto uses swig to expose Automation Proxy interfaces to Python. | 9 PyAuto uses swig to expose Automation Proxy interfaces to Python. |
| 10 For complete documentation on the functionality available, | 10 For complete documentation on the functionality available, |
| (...skipping 3589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3600 Raises: | 3600 Raises: |
| 3601 pyauto_errors.JSONInterfaceError if the automation call returns an error. | 3601 pyauto_errors.JSONInterfaceError if the automation call returns an error. |
| 3602 """ | 3602 """ |
| 3603 cmd_dict = { 'command': 'SetMute' } | 3603 cmd_dict = { 'command': 'SetMute' } |
| 3604 cmd_dict = { | 3604 cmd_dict = { |
| 3605 'command': 'SetMute', | 3605 'command': 'SetMute', |
| 3606 'mute': mute, | 3606 'mute': mute, |
| 3607 } | 3607 } |
| 3608 return self._GetResultFromJSONRequest(cmd_dict, windex=-1) | 3608 return self._GetResultFromJSONRequest(cmd_dict, windex=-1) |
| 3609 | 3609 |
| 3610 def CaptureProfilePhoto(self): | |
| 3611 """Captures user profile photo and saves it to file. | |
| 3612 | |
|
dennis_jeffrey
2011/07/29 20:10:06
Maybe mention here where the expected file is crea
frankf
2011/07/29 21:50:40
I've added more info here. The exact path to file
| |
| 3613 Raises: | |
| 3614 pyauto_errors.JSONInterfaceError if the automation call returns an error. | |
| 3615 """ | |
| 3616 cmd_dict = { 'command': 'CaptureProfilePhoto' } | |
| 3617 return self._GetResultFromJSONRequest(cmd_dict) | |
|
dennis_jeffrey
2011/07/29 20:10:06
Is something important actually returned here? Th
frankf
2011/07/29 21:50:40
No there is no return value. However, all the func
dennis_jeffrey
2011/07/29 23:11:46
I think it's kind of inconsistent in this file. F
| |
| 3618 | |
| 3610 ## ChromeOS section -- end | 3619 ## ChromeOS section -- end |
| 3611 | 3620 |
| 3612 | 3621 |
| 3613 class _RemoteProxy(): | 3622 class _RemoteProxy(): |
| 3614 """Class for PyAuto remote method calls. | 3623 """Class for PyAuto remote method calls. |
| 3615 | 3624 |
| 3616 Use this class along with RemoteHost.testRemoteHost to establish a PyAuto | 3625 Use this class along with RemoteHost.testRemoteHost to establish a PyAuto |
| 3617 connection with another machine and make remote PyAuto calls. The RemoteProxy | 3626 connection with another machine and make remote PyAuto calls. The RemoteProxy |
| 3618 mimics a PyAuto object, so all json-style PyAuto calls can be made on it. | 3627 mimics a PyAuto object, so all json-style PyAuto calls can be made on it. |
| 3619 | 3628 |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4118 successful = result.wasSuccessful() | 4127 successful = result.wasSuccessful() |
| 4119 if not successful: | 4128 if not successful: |
| 4120 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename) | 4129 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename) |
| 4121 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \ | 4130 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \ |
| 4122 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL) | 4131 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL) |
| 4123 sys.exit(not successful) | 4132 sys.exit(not successful) |
| 4124 | 4133 |
| 4125 | 4134 |
| 4126 if __name__ == '__main__': | 4135 if __name__ == '__main__': |
| 4127 Main() | 4136 Main() |
| OLD | NEW |