Push an updated File object to the Remote .. note:: If the project has not been opened, it will be opened upon calling this. :param file: File object which has been updated :param extra_fields: Extra HTTP fields to send with the update :raises: RuntimeError if there was an error
(self, file: 'file.RemoteFile', extra_fields: Optional[Dict[str, str]] = None)
| 409 | return file.RemoteFile(value) |
| 410 | |
| 411 | def push_file(self, file: 'file.RemoteFile', extra_fields: Optional[Dict[str, str]] = None): |
| 412 | """ |
| 413 | Push an updated File object to the Remote |
| 414 | |
| 415 | .. note:: If the project has not been opened, it will be opened upon calling this. |
| 416 | |
| 417 | :param file: File object which has been updated |
| 418 | :param extra_fields: Extra HTTP fields to send with the update |
| 419 | :raises: RuntimeError if there was an error |
| 420 | """ |
| 421 | if not self.open(): |
| 422 | raise RuntimeError("Failed to open project") |
| 423 | |
| 424 | if extra_fields is None: |
| 425 | extra_fields = {} |
| 426 | extra_field_keys = (ctypes.c_char_p * len(extra_fields))() |
| 427 | extra_field_values = (ctypes.c_char_p * len(extra_fields))() |
| 428 | for (i, (key, value)) in enumerate(extra_fields.items()): |
| 429 | extra_field_keys[i] = core.cstr(key) |
| 430 | extra_field_values[i] = core.cstr(value) |
| 431 | if not core.BNRemoteProjectPushFile(self._handle, file._handle, extra_field_keys, extra_field_values, len(extra_fields)): |
| 432 | raise RuntimeError(util._last_error()) |
| 433 | |
| 434 | def delete_file(self, file: 'file.RemoteFile'): |
| 435 | """ |