Lines Matching refs:self

29     def __init__(self, serial):  argument
30 self.serial = serial
31 super(DeviceNotFoundError, self).__init__(
36 def __init__(self): argument
37 super(NoUniqueDeviceError, self).__init__('No unique device')
41 def __init__(self, cmd, stdout, stderr, exit_code): argument
42 super(ShellError, self).__init__(
44 self.cmd = cmd
45 self.stdout = stdout
46 self.stderr = stderr
47 self.exit_code = exit_code
260 def __init__(self, serial, product=None, adb_path='adb'): argument
261 self.serial = serial
262 self.product = product
263 self.adb_cmd = [adb_path]
265 if self.serial is not None:
266 self.adb_cmd.extend(['-s', serial])
267 if self.product is not None:
268 self.adb_cmd.extend(['-p', product])
269 self._linesep = None
270 self._features = None
273 def linesep(self): argument
274 if self._linesep is None:
275 self._linesep = subprocess.check_output(self.adb_cmd +
277 return self._linesep
280 def features(self): argument
281 if self._features is None:
283 self._features = split_lines(self._simple_call(['features']))
285 self._features = []
286 return self._features
288 def has_shell_protocol(self): argument
289 return version(self.adb_cmd) >= 35 and 'shell_v2' in self.features
291 def _make_shell_cmd(self, user_cmd): argument
292 command = self.adb_cmd + ['shell'] + user_cmd
293 if not self.has_shell_protocol():
294 command += self._RETURN_CODE_PROBE
297 def _parse_shell_output(self, out): argument
312 if len(search_text) > self._RETURN_CODE_SEARCH_LENGTH:
315 search_text = search_text[-self._RETURN_CODE_SEARCH_LENGTH:]
316 partition = search_text.rpartition(self._RETURN_CODE_DELIMITER)
325 def _simple_call(self, cmd): argument
326 logging.info(' '.join(self.adb_cmd + cmd))
328 self.adb_cmd + cmd, stderr=subprocess.STDOUT)
330 def shell(self, cmd): argument
343 exit_code, stdout, stderr = self.shell_nocheck(cmd)
348 def shell_nocheck(self, cmd): argument
358 cmd = self._make_shell_cmd(cmd)
363 if self.has_shell_protocol():
366 exit_code, stdout = self._parse_shell_output(stdout)
369 def shell_popen(self, cmd, kill_atexit=True, preexec_fn=None, argument
388 command = self.adb_cmd + ['shell'] + cmd
411 def install(self, filename, replace=False): argument
416 return self._simple_call(cmd)
418 def push(self, local, remote): argument
419 return self._simple_call(['push', local, remote])
421 def pull(self, remote, local): argument
422 return self._simple_call(['pull', remote, local])
424 def sync(self, directory=None): argument
428 return self._simple_call(cmd)
430 def tcpip(self, port): argument
431 return self._simple_call(['tcpip', port])
433 def usb(self): argument
434 return self._simple_call(['usb'])
436 def reboot(self): argument
437 return self._simple_call(['reboot'])
439 def remount(self): argument
440 return self._simple_call(['remount'])
442 def root(self): argument
443 return self._simple_call(['root'])
445 def unroot(self): argument
446 return self._simple_call(['unroot'])
448 def connect(self, host): argument
449 return self._simple_call(['connect', host])
451 def disconnect(self, host): argument
452 return self._simple_call(['disconnect', host])
454 def forward(self, local, remote): argument
455 return self._simple_call(['forward', local, remote])
457 def forward_list(self): argument
458 return self._simple_call(['forward', '--list'])
460 def forward_no_rebind(self, local, remote): argument
461 return self._simple_call(['forward', '--no-rebind', local, remote])
463 def forward_remove(self, local): argument
464 return self._simple_call(['forward', '--remove', local])
466 def forward_remove_all(self): argument
467 return self._simple_call(['forward', '--remove-all'])
469 def reverse(self, remote, local): argument
470 return self._simple_call(['reverse', remote, local])
472 def reverse_list(self): argument
473 return self._simple_call(['reverse', '--list'])
475 def reverse_no_rebind(self, local, remote): argument
476 return self._simple_call(['reverse', '--no-rebind', local, remote])
478 def reverse_remove_all(self): argument
479 return self._simple_call(['reverse', '--remove-all'])
481 def reverse_remove(self, remote): argument
482 return self._simple_call(['reverse', '--remove', remote])
484 def wait(self): argument
485 return self._simple_call(['wait-for-device'])
487 def get_props(self): argument
489 output, _ = self.shell(['getprop'])
503 def get_prop(self, prop_name): argument
504 output = split_lines(self.shell(['getprop', prop_name])[0])
513 def set_prop(self, prop_name, value): argument
514 self.shell(['setprop', prop_name, value])