def _write(self, data, length, progress_callback=None):
    """Sends the data to the device, tracking progress with the callback."""
    if progress_callback:
      progress = self._handle_progress(length, progress_callback)
      six.next(progress)
    while length:
      tmp = data.read(FASTBOOT_DOWNLOAD_CHUNK_SIZE_KB * 1024)
      length -= len(tmp)
      self.usb.write(tmp)

      if progress_callback:
        progress.send(len(tmp))
def _write ( self , data , length , progress_callback = None ) : if progress_callback : progress = self . _handle_progress ( length , progress_callback ) six . next ( progress ) while length : tmp = data . read ( FASTBOOT_DOWNLOAD_CHUNK_SIZE_KB * 1024 ) length -= len ( tmp ) self . usb . write ( tmp ) if progress_callback : progress . send ( len ( tmp ) )
Sends the data to the device, tracking progress with the callback.