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)
| 27 | |
| 28 | class 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`. |