def driver(): return ehbDriver( url='http://example.com/api/', user='******', password='******', secure=False )
def getDriver(self, protocol_user_credentials): """Get a configured driver backend instance for the DataSource.""" driver = None if self.driver == ProtocolDataSourceConstants.redcap_driver: pw = protocol_user_credentials.data_source_password driver = RedCapDriver.ehbDriver(self.data_source.url, password=pw, secure=self._isSecure()) elif self.driver == ProtocolDataSourceConstants.nautilus_driver: pw = protocol_user_credentials.data_source_password user = protocol_user_credentials.data_source_username driver = NauDriver.ehbDriver(url=self.data_source.url, user=user, password=pw, secure=self._isSecure()) elif self.driver == ProtocolDataSourceConstants.phenotype_driver: pw = protocol_user_credentials.data_source_password user = protocol_user_credentials.data_source_username driver = PhenotypeDriver.PhenotypeDriver(url=self.data_source.url, user=user, password=pw, secure=self._isSecure()) elif self.driver == ProtocolDataSourceConstants.external_identifiers: pw = protocol_user_credentials.data_source_password user = protocol_user_credentials.data_source_username driver = ExIdDriver.ehbDriver(url=self.data_source.url, user=user, password=pw, secure=self._isSecure()) return driver
def getDriver(self, protocol_user_credentials): driver = None if self.driver == ProtocolDataSourceConstants.redcap_driver: pw = protocol_user_credentials.data_source_password driver = RedCapDriver.ehbDriver( self.data_source.url, password=pw, secure=self._isSecure() ) elif self.driver == ProtocolDataSourceConstants.nautilus_driver: pw = protocol_user_credentials.data_source_password user = protocol_user_credentials.data_source_username driver = NauDriver.ehbDriver( url=self.data_source.url, user=user, password=pw, secure=self._isSecure() ) elif self.driver == ProtocolDataSourceConstants.phenotype_driver: pw = protocol_user_credentials.data_source_password user = protocol_user_credentials.data_source_username driver = PhenotypeDriver.PhenotypeDriver( url=self.data_source.url, user=user, password=pw, secure=self._isSecure() ) elif self.driver == ProtocolDataSourceConstants.external_identifiers: pw = protocol_user_credentials.data_source_password user = protocol_user_credentials.data_source_username driver = ExIdDriver.ehbDriver( url=self.data_source.url, user=user, password=pw, secure=self._isSecure() ) return driver
def driver(): return ehbDriver(url='http://example.com/api/', user='******', password='******', secure=False)