Download a file from its remote, saving all snapshots to a database in the specified location. Returns a FileContext for opening the file later. :param file_: Remote File to download and open :param db_path: File path for saved database :param progress: Function to call for progress updates
(file_: 'file.RemoteFile', db_path: str, progress: 'util.ProgressFuncType' = util.nop)
| 44 | |
| 45 | |
| 46 | def download_file(file_: 'file.RemoteFile', db_path: str, progress: 'util.ProgressFuncType' = util.nop) -> 'FileMetadata': |
| 47 | """ |
| 48 | Download a file from its remote, saving all snapshots to a database in the |
| 49 | specified location. Returns a FileContext for opening the file later. |
| 50 | |
| 51 | :param file_: Remote File to download and open |
| 52 | :param db_path: File path for saved database |
| 53 | :param progress: Function to call for progress updates |
| 54 | :return: FileContext for opening |
| 55 | :raises RuntimeError: If there was an error |
| 56 | """ |
| 57 | value = core.BNCollaborationDownloadFile(file_._handle, db_path, util.wrap_progress(progress), None) |
| 58 | if value is None: |
| 59 | raise RuntimeError(util._last_error()) |
| 60 | return FileMetadata(handle=ctypes.cast(value, core.BNFileMetadataHandle)) |
| 61 | |
| 62 | |
| 63 | def upload_database(metadata: 'FileMetadata', project: 'project.RemoteProject', parent_folder: Optional['folder.RemoteFolder'] = None, progress: 'util.ProgressFuncType' = util.nop, name_changeset: 'util.NameChangesetFuncType' = util.nop) -> 'file.RemoteFile': |
nothing calls this directly
no test coverage detected