Look up the remote File for a local database, or None if there is no matching remote File found. See :func:`get_for_bv` to load from a BinaryView. :param database: Local database :return: Remote File object :rtype: File or None
(database: 'Database')
| 50 | |
| 51 | @staticmethod |
| 52 | def get_for_local_database(database: 'Database') -> Optional['RemoteFile']: |
| 53 | """ |
| 54 | Look up the remote File for a local database, or None if there is no matching |
| 55 | remote File found. |
| 56 | See :func:`get_for_bv` to load from a BinaryView. |
| 57 | |
| 58 | :param database: Local database |
| 59 | :return: Remote File object |
| 60 | :rtype: File or None |
| 61 | """ |
| 62 | remote = databasesync.get_remote_for_local_database(database) |
| 63 | if remote is None: |
| 64 | return None |
| 65 | if not remote.has_pulled_projects: |
| 66 | remote.pull_projects() |
| 67 | project = databasesync.get_remote_project_for_local_database(database) |
| 68 | if project is None: |
| 69 | return None |
| 70 | if not project.has_pulled_files: |
| 71 | project.pull_files() |
| 72 | return databasesync.get_remote_file_for_local_database(database) |
| 73 | |
| 74 | @staticmethod |
| 75 | def get_for_bv(bv: 'BinaryView') -> Optional['RemoteFile']: |
no test coverage detected