Get the list of files in this project. .. note:: If the project has not been opened, it will be opened upon calling this. .. note:: If folders have not been pulled, they will be pulled upon calling this. .. note:: If files have not been pulled, they will be pulled upon calling this. :
(self)
| 286 | |
| 287 | @property |
| 288 | def files(self) -> List['file.RemoteFile']: |
| 289 | """ |
| 290 | Get the list of files in this project. |
| 291 | |
| 292 | .. note:: If the project has not been opened, it will be opened upon calling this. |
| 293 | |
| 294 | .. note:: If folders have not been pulled, they will be pulled upon calling this. |
| 295 | |
| 296 | .. note:: If files have not been pulled, they will be pulled upon calling this. |
| 297 | |
| 298 | :return: List of File objects |
| 299 | :raises: RuntimeError if there was an error pulling files |
| 300 | """ |
| 301 | if not self.open(): |
| 302 | raise RuntimeError("Failed to open project") |
| 303 | |
| 304 | if not self.has_pulled_files: |
| 305 | self.pull_files() |
| 306 | |
| 307 | count = ctypes.c_size_t() |
| 308 | value = core.BNRemoteProjectGetFiles(self._handle, count) |
| 309 | if value is None: |
| 310 | raise RuntimeError(util._last_error()) |
| 311 | result = [] |
| 312 | for i in range(count.value): |
| 313 | result.append(file.RemoteFile(value[i])) |
| 314 | return result |
| 315 | |
| 316 | def get_file_by_id(self, id: str) -> Optional['file.RemoteFile']: |
| 317 | """ |
nothing calls this directly
no test coverage detected