• Home
  • Raw
  • Download

Lines Matching +full:check +full:- +full:macos

2 # Use of this source code is governed by a BSD-style license that can be
53 def __init__(self) -> None:
56 def __getitem__(self, key: str) -> str:
59 def __setitem__(self, key: str, item: str) -> None:
62 def __delitem__(self, key: str) -> None:
65 def __iter__(self) -> Iterator[str]:
68 def __len__(self) -> int:
75 def __init__(self, platform: Platform, process) -> None:
80 def __str__(self) -> str:
93 # pylint: disable=locally-disabled, redefined-builtin
95 def __init__(self) -> None:
101 def assert_is_local(self) -> None:
111 def name(self) -> str:
116 def version(self) -> str:
121 def device(self) -> str:
126 def cpu(self) -> str:
130 def full_version(self) -> str:
133 def __str__(self) -> str:
137 def is_remote(self) -> bool:
141 def is_local(self) -> bool:
145 def host_platform(self) -> Platform:
149 def machine(self) -> MachineArch:
161 def _raw_machine_arch(self) -> str:
166 def is_ia32(self) -> bool:
170 def is_x64(self) -> bool:
174 def is_arm64(self) -> bool:
178 def key(self) -> Tuple[str, str]:
182 def is_macos(self) -> bool:
186 def is_linux(self) -> bool:
190 def is_android(self) -> bool:
194 def is_chromeos(self) -> bool:
198 def is_posix(self) -> bool:
202 def is_win(self) -> bool:
206 def is_remote_ssh(self) -> bool:
210 def environ(self) -> Environ:
215 def is_battery_powered(self) -> bool:
227 macos: Sequence[str],
231 ) -> pth.AnyPath:
234 executables = macos
251 macos: Sequence[str] = (),
254 ) -> pth.AnyPath:
255 return self._search_executable(name, macos, win, linux, self.search_app)
260 macos: Sequence[str] = (),
263 ) -> pth.AnyPath:
264 return self._search_executable(name, macos, win, linux, self.search_binary)
266 def search_app(self, app_or_bin: pth.AnyPath) -> Optional[pth.AnyPath]:
267 """Look up a application bundle (macos) or binary (all other platforms) in
273 def search_binary(self, app_or_bin: pth.AnyPathLike) -> Optional[pth.AnyPath]:
276 Returns the location of the binary (and not the .app bundle on macOS).
280 def app_version(self, app_or_bin: pth.AnyPathLike) -> str:
284 def has_display(self) -> bool:
289 def sleep(self, seconds: Union[int, float, dt.timedelta]) -> None:
297 def which(self, binary_name: pth.AnyPathLike) -> Optional[pth.AnyPath]:
308 self, binary_name: pth.AnyPathLike) -> Optional[pth.AnyPath]:
346 attrs: Optional[List[str]] = None) -> List[Dict[str, Any]]:
351 def process_running(self, process_name_list: List[str]) -> Optional[str]:
364 recursive: bool = False) -> List[Dict[str, Any]]:
374 self, process_iterator: Iterable[psutil.Process]) -> List[Dict[str, Any]]:
383 def process_info(self, pid: int) -> Optional[Dict[str, Any]]:
391 def foreground_process(self) -> Optional[Dict[str, Any]]:
394 def terminate(self, proc_pid: int) -> None:
403 def default_tmp_dir(self) -> pth.AnyPath:
407 def port_forward(self, local_port: int, remote_port: int) -> int:
413 def stop_port_forward(self, local_port: int) -> None:
417 def reverse_port_forward(self, remote_port: int, local_port: int) -> int:
423 def stop_reverse_port_forward(self, remote_port: int) -> None:
427 def local_cache_dir(self, name: Optional[str] = None) -> pth.LocalPath:
430 def cache_dir(self, name: Optional[str] = None) -> pth.AnyPath:
439 def set_cache_dir(self, path: pth.AnyPath) -> None:
443 def cat(self, file: pth.AnyPathLike, encoding: str = "utf-8") -> str:
448 def cat_bytes(self, file: pth.AnyPathLike) -> bytes:
455 encoding: str = "utf-8") -> str:
461 encoding: str = "utf-8") -> None:
466 to_path: pth.LocalPath) -> pth.LocalPath:
473 def push(self, from_path: pth.LocalPath, to_path: pth.AnyPath) -> pth.AnyPath:
480 def copy(self, from_path: pth.AnyPath, to_path: pth.AnyPath) -> pth.AnyPath:
483 raise ValueError(f"Cannot copy non-existing source path: {from_path}")
489 to_path: pth.AnyPathLike) -> pth.AnyPath:
497 to_path: pth.AnyPathLike) -> pth.AnyPath:
507 missing_ok: bool = False) -> None:
518 dst_path: pth.AnyPathLike) -> pth.AnyPath:
523 dst: pth.AnyPathLike) -> pth.AnyPath:
531 def path(self, path: pth.AnyPathLike) -> pth.AnyPath:
541 def local_path(self, path: pth.AnyPathLike) -> pth.LocalPath:
545 def absolute(self, path: pth.AnyPathLike) -> pth.AnyPath:
546 """Convert an arbitrary path to a platform-specific absolute path"""
555 def home(self) -> pth.AnyPath:
558 def touch(self, path: pth.AnyPathLike) -> None:
564 exist_ok: bool = True) -> None:
568 def NamedTemporaryFile( # pylint: disable=invalid-name
581 dir: Optional[pth.AnyPathLike] = None) -> pth.AnyPath:
587 dir: Optional[pth.AnyPathLike] = None) -> pth.AnyPath:
594 def TemporaryDirectory( # pylint: disable=invalid-name
604 def exists(self, path: pth.AnyPathLike) -> bool:
607 def is_file(self, path: pth.AnyPathLike) -> bool:
610 def is_dir(self, path: pth.AnyPathLike) -> bool:
614 path: pth.AnyPathLike) -> Generator[pth.AnyPath, None, None]:
618 pattern: str) -> Generator[pth.AnyPath, None, None]:
622 def file_size(self, path: pth.AnyPathLike) -> int:
630 encoding: str = "utf-8",
633 check: bool = True) -> str:
635 *args, shell=shell, quiet=quiet, stdin=stdin, env=env, check=check)
644 check: bool = True) -> bytes:
652 check=check)
657 bufsize=-1,
663 quiet: bool = False) -> subprocess.Popen:
686 check: bool = True) -> subprocess.CompletedProcess:
699 check=False)
700 if check and process.returncode != 0:
704 def exec_apple_script(self, script: str, *args: str) -> str:
706 raise NotImplementedError("AppleScript is only available on MacOS")
708 def log(self, *messages: Any, level: int = 2) -> None:
722 def check_system_monitoring(self, disable: bool = False) -> bool:
723 # pylint: disable=unused-argument
726 def get_relative_cpu_speed(self) -> float:
729 def is_thermal_throttled(self) -> bool:
732 def disk_usage(self, path: pth.AnyPathLike) -> psutil._common.sdiskusage:
735 def cpu_usage(self) -> float:
737 return 1 - psutil.cpu_times_percent().idle / 100
739 def cpu_details(self) -> Dict[str, Any]:
747 psutil.cpu_percent( # pytype: disable=attribute-error
759 logging.debug("psutil.cpu_freq() failed (normal on macOS M1): %s", e)
768 def system_details(self) -> Dict[str, Any]:
776 def os_details(self) -> JsonDict:
785 def python_details(self) -> JsonDict:
792 def download_to(self, url: str, path: pth.LocalPath) -> pth.LocalPath:
807 prefix: str = "") -> pth.LocalPath:
809 with output.open("w", encoding="utf-8") as output_f:
814 with input_file.open(encoding="utf-8") as input_f:
818 def set_main_display_brightness(self, brightness_level: int) -> None:
820 "'set_main_display_brightness' is only available on MacOS for now")
822 def get_main_display_brightness(self) -> int:
824 "'get_main_display_brightness' is only available on MacOS for now")
826 def check_autobrightness(self) -> bool:
828 "'check_autobrightness' is only available on MacOS for now")
830 def screenshot(self, result_path: pth.AnyPath) -> None:
833 "'screenshot' is only available on MacOS for now")