MCPcopy
hub / github.com/appium/python-client / pull_file

Method pull_file

appium/webdriver/extensions/remote_fs.py:29–43  ·  view source on GitHub ↗

Retrieves the file at `path`. Args: path: the path to the file on the device Returns: The file's contents encoded as Base64.

(self, path: str)

Source from the content-addressed store, hash-verified

27
28class RemoteFS(CanExecuteCommands, CanExecuteScripts, CanRememberExtensionPresence):
29 def pull_file(self, path: str) -> str:
30 """Retrieves the file at `path`.
31
32 Args:
33 path: the path to the file on the device
34
35 Returns:
36 The file's contents encoded as Base64.
37 """
38 ext_name = 'mobile: pullFile'
39 try:
40 return self.assert_extension_exists(ext_name).execute_script(ext_name, {'remotePath': path})
41 except UnknownMethodException:
42 # TODO: Remove the fallback
43 return self.mark_extension_absence(ext_name).execute(Command.PULL_FILE, {'path': path})['value']
44
45 def pull_folder(self, path: str) -> str:
46 """Retrieves a folder at `path`.

Callers 1

test_pull_fileMethod · 0.80

Calls 4

execute_scriptMethod · 0.80
executeMethod · 0.45

Tested by 1

test_pull_fileMethod · 0.64