def connect(self, repositoryName):
        """Connect the driver for this repository (name)."""

        repository = self.rascal.get(repositoryName, [RepositoryInterface])
        repository.fw_init()

        # Build the driver.
        driver = repository.fw_chainControllers()
        driver.fw_init(repository.conf, repositoryName) # Initialize.
        driver.fw_sanityChecks(driver) # Catch common errors early.

        self.ui.debugC(DRV, "built driver '{}' for '{}'",
            driver.getName(), repositoryName)
        self.ui.debugC(DRV, "'{}' has conf {}", repositoryName, driver.conf)

        # Ready, connect.
        if driver.isLocal:
            self.ui.debugC(DRV, '{} working in {}', driver.getOwnerName(),
                driver.conf.get('path'))
        else:
            self.ui.debugC(DRV, '{} connecting to {}:{}',
                driver.getOwnerName(), driver.conf.get('host'),
                driver.conf.get('port'))

        connected = driver.connect()
        self.ui.debugC(DRV, "driver of {} connected", driver.getOwnerName())
        if connected:
            self._driver = driver
        else:
            raise Exception("%s: driver could not connect"% self._workerName)
dataset/ETHPy150Open OfflineIMAP/imapfw/imapfw/mmp/driver.py/DriverManager.connect/original