Get a specific File in the Project by its name .. note:: If the project has not been opened, it will be opened upon calling this. .. note:: If files have not been pulled, they will be pulled upon calling this. :param name: Name of File :return: File object, if one with that name exists
(self, name: str)
| 337 | return file.RemoteFile(value) |
| 338 | |
| 339 | def get_file_by_name(self, name: str) -> Optional['file.RemoteFile']: |
| 340 | """ |
| 341 | Get a specific File in the Project by its name |
| 342 | |
| 343 | .. note:: If the project has not been opened, it will be opened upon calling this. |
| 344 | |
| 345 | .. note:: If files have not been pulled, they will be pulled upon calling this. |
| 346 | |
| 347 | :param name: Name of File |
| 348 | :return: File object, if one with that name exists. Else, None |
| 349 | :raises: RuntimeError if there was an error pulling files |
| 350 | """ |
| 351 | if not self.open(): |
| 352 | raise RuntimeError("Failed to open project") |
| 353 | |
| 354 | if not self.has_pulled_files: |
| 355 | self.pull_files() |
| 356 | |
| 357 | value = core.BNRemoteProjectGetFileByName(self._handle, name) |
| 358 | if value is None: |
| 359 | return None |
| 360 | return file.RemoteFile(value) |
| 361 | |
| 362 | def pull_files(self, progress: 'util.ProgressFuncType' = util.nop): |
| 363 | """ |
no test coverage detected