Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions adb/adb_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def GetState(self):
return self._device_state

def Install(self, apk_path, destination_dir=None, timeout_ms=None):
"""Install apk to device.
"""Install an apk to the device.

Doesn't support verifier file, instead allows destination directory to be
overridden.
Expand All @@ -133,10 +133,11 @@ def Install(self, apk_path, destination_dir=None, timeout_ms=None):
timeout_ms=timeout_ms)

def Push(self, source_file, device_filename, mtime='0', timeout_ms=None):
"""Push source_file to file on device.
"""Push a file or directory to the device.

Arguments:
source_file: Either a filename or file-like object to push to the device.
source_file: Either a filename, a directory or file-like object to push to
the device.
device_filename: The filename on the device to write to.
mtime: Optional, modification time to set on the file.
timeout_ms: Expected timeout for any part of the push.
Expand All @@ -158,7 +159,7 @@ def Push(self, source_file, device_filename, mtime='0', timeout_ms=None):
connection.Close()

def Pull(self, device_filename, dest_file=None, timeout_ms=None):
"""Pull file from device.
"""Pull a file from the device.

Arguments:
device_filename: The filename on the device to pull.
Expand Down Expand Up @@ -198,7 +199,10 @@ def List(self, device_path):
return listing

def Reboot(self, destination=''):
"""Reboot device, specify 'bootloader' for fastboot."""
"""Reboot the device.

Specify 'bootloader' for fastboot.
"""
self.protocol_handler.Open(self.handle, 'reboot:%s' % destination)

def RebootBootloader(self):
Expand All @@ -210,7 +214,7 @@ def Remount(self):
return self.protocol_handler.Command(self.handle, service='remount')

def Root(self):
"""Restart adbd as root on device."""
"""Restart adbd as root on the device."""
return self.protocol_handler.Command(self.handle, service='root')

def Shell(self, command, timeout_ms=None):
Expand Down
1 change: 1 addition & 0 deletions adb/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ def BulkRead(self, length, timeout_ms=None):
'Could not receive data from %s (timeout %sms)' % (
self.usb_info, self.Timeout(timeout_ms)), e)

@classmethod
def PortPathMatcher(cls, port_path):
"""Returns a device matcher for the given port path."""
if isinstance(port_path, basestring):
Expand Down