OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Provides an interface to communicate with the device via the adb command. | 5 """Provides an interface to communicate with the device via the adb command. |
6 | 6 |
7 Assumes adb binary is currently on system path. | 7 Assumes adb binary is currently on system path. |
8 """ | 8 """ |
9 | 9 |
10 import collections | 10 import collections |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 '(?P<user>[^\s]+)\s+' | 655 '(?P<user>[^\s]+)\s+' |
656 '(?P<group>[^\s]+)\s+' | 656 '(?P<group>[^\s]+)\s+' |
657 '(?P<size>[^\s]+)\s+' | 657 '(?P<size>[^\s]+)\s+' |
658 '(?P<date>[^\s]+)\s+' | 658 '(?P<date>[^\s]+)\s+' |
659 '(?P<time>[^\s]+)\s+' | 659 '(?P<time>[^\s]+)\s+' |
660 '(?P<filename>[^\s]+)$') | 660 '(?P<filename>[^\s]+)$') |
661 return _GetFilesFromRecursiveLsOutput( | 661 return _GetFilesFromRecursiveLsOutput( |
662 path, self.RunShellCommand('ls -lR %s' % path), re_file, | 662 path, self.RunShellCommand('ls -lR %s' % path), re_file, |
663 self._device_utc_offset) | 663 self._device_utc_offset) |
664 | 664 |
665 | |
666 def SetJavaAssertsEnabled(self, enable): | 665 def SetJavaAssertsEnabled(self, enable): |
667 """Sets or removes the device java assertions property. | 666 """Sets or removes the device java assertions property. |
668 | 667 |
669 Args: | 668 Args: |
670 enable: If True the property will be set. | 669 enable: If True the property will be set. |
671 | 670 |
672 Returns: | 671 Returns: |
673 True if the file was modified (reboot is required for it to take effect). | 672 True if the file was modified (reboot is required for it to take effect). |
674 """ | 673 """ |
675 # First ensure the desired property is persisted. | 674 # First ensure the desired property is persisted. |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1067 def __init__(self, output): | 1066 def __init__(self, output): |
1068 self._output = output | 1067 self._output = output |
1069 | 1068 |
1070 def write(self, data): | 1069 def write(self, data): |
1071 data = data.replace('\r\r\n', '\n') | 1070 data = data.replace('\r\r\n', '\n') |
1072 self._output.write(data) | 1071 self._output.write(data) |
1073 | 1072 |
1074 def flush(self): | 1073 def flush(self): |
1075 self._output.flush() | 1074 self._output.flush() |
1076 | 1075 |
OLD | NEW |