def load_database(self, database_name): # Load the database in the sync server thread. mutex.lock() # Libmnemosyne itself could also generate dialog messages, so # we temporarily override the main_widget with the threaded # routines in this class. self.component_manager.components[None]["main_widget"].append(self) self.sync_started_signal.emit() # Unload database in main thread. if not self.server_has_connection: database_released.wait(mutex) SyncServer.load_database(self, database_name) self.server_has_connection = True mutex.unlock() return self.database()