Upload a file, with database, to the remote under the given project :param metadata: Local file with database :param project: Remote project under which to place the new file :param progress: Function to call for progress updates :param name_changeset: Function to call for naming a pushed cha
(metadata: 'FileMetadata', project: 'project.RemoteProject', parent_folder: Optional['folder.RemoteFolder'] = None, progress: 'util.ProgressFuncType' = util.nop, name_changeset: 'util.NameChangesetFuncType' = util.nop)
| 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': |
| 64 | """ |
| 65 | Upload a file, with database, to the remote under the given project |
| 66 | |
| 67 | :param metadata: Local file with database |
| 68 | :param project: Remote project under which to place the new file |
| 69 | :param progress: Function to call for progress updates |
| 70 | :param name_changeset: Function to call for naming a pushed changeset, if necessary |
| 71 | :param parent_folder: Optional parent folder in which to place this file |
| 72 | :return: Remote File created |
| 73 | :raises RuntimeError: If there was an error |
| 74 | """ |
| 75 | folder_handle = parent_folder._handle if parent_folder is not None else None |
| 76 | value = core.BNCollaborationUploadDatabase(ctypes.cast(metadata.handle, core.BNFileMetadataHandle), project._handle, folder_handle, util.wrap_progress(progress), None, util.wrap_name_changeset(name_changeset), None) |
| 77 | if value is None: |
| 78 | raise RuntimeError(util._last_error()) |
| 79 | return file.RemoteFile(handle=value) |
| 80 | |
| 81 | |
| 82 | def is_collaboration_database(database: Database) -> bool: |
nothing calls this directly
no test coverage detected