OLD | NEW |
1 #!/usr/bin/python2.4 | 1 #!/usr/bin/python2.4 |
2 # | 2 # |
3 # | 3 # |
4 # Copyright 2008, The Android Open Source Project | 4 # Copyright 2008, The Android Open Source Project |
5 # | 5 # |
6 # Licensed under the Apache License, Version 2.0 (the "License"); | 6 # Licensed under the Apache License, Version 2.0 (the "License"); |
7 # you may not use this file except in compliance with the License. | 7 # you may not use this file except in compliance with the License. |
8 # You may obtain a copy of the License at | 8 # You may obtain a copy of the License at |
9 # | 9 # |
10 # http://www.apache.org/licenses/LICENSE-2.0 | 10 # http://www.apache.org/licenses/LICENSE-2.0 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 dest: destination file path on host | 118 dest: destination file path on host |
119 | 119 |
120 Returns: | 120 Returns: |
121 True if success and False otherwise. | 121 True if success and False otherwise. |
122 """ | 122 """ |
123 # Create the base dir if it doesn't exist already | 123 # Create the base dir if it doesn't exist already |
124 if not os.path.exists(os.path.dirname(dest)): | 124 if not os.path.exists(os.path.dirname(dest)): |
125 os.makedirs(os.path.dirname(dest)) | 125 os.makedirs(os.path.dirname(dest)) |
126 | 126 |
127 if self.DoesFileExist(src): | 127 if self.DoesFileExist(src): |
128 self.SendCommand("pull %s %s" % (src, dest), timeout_time=60) | 128 print 'Command output:', self.SendCommand("pull %s %s" % (src, dest), time
out_time=60) |
129 return True | 129 return True |
130 else: | 130 else: |
131 logger.Log("ADB Pull Failed: Source file %s does not exist." % src) | 131 logger.Log("ADB Pull Failed: Source file %s does not exist." % src) |
132 return False | 132 return False |
133 | 133 |
134 def DoesFileExist(self, src): | 134 def DoesFileExist(self, src): |
135 """Checks if the given path exists on device target. | 135 """Checks if the given path exists on device target. |
136 | 136 |
137 Args: | 137 Args: |
138 src: file path to be checked. | 138 src: file path to be checked. |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 # press the MENU key, this will disable key guard if runtime is started | 504 # press the MENU key, this will disable key guard if runtime is started |
505 # with ro.monkey set to 1 | 505 # with ro.monkey set to 1 |
506 self.SendShellCommand("input keyevent 82", retry_count=retry_count) | 506 self.SendShellCommand("input keyevent 82", retry_count=retry_count) |
507 else: | 507 else: |
508 self.WaitForDevicePm() | 508 self.WaitForDevicePm() |
509 return output | 509 return output |
510 | 510 |
511 def GetSerialNumber(self): | 511 def GetSerialNumber(self): |
512 """Returns the serial number of the targeted device.""" | 512 """Returns the serial number of the targeted device.""" |
513 return self.SendCommand("get-serialno").strip() | 513 return self.SendCommand("get-serialno").strip() |
OLD | NEW |