def __setup_db(self): ''' Open database if not already done. Db will only be set up per process, not for each task! Raises ------ StorageException Error while opening. ''' if self.result_database_storage is None: log.info("setup_db ...") self.result_database_storage = ResultDatabaseStorage.factory_from_config(settings)
def __setup_db(self): ''' Open database if not already done. Db will only be set up per process, not for each task! Raises ------ StorageException Error while opening. ''' if self.result_database_storage is None: log.info("setup_db ...") self.result_database_storage = ResultDatabaseStorage.factory_from_config( settings)
def get_apk_storage(settings): ''' Get an object implementing the `ApkCopyInterface`. Parameters ---------- settings : Settings ''' import androlyze.settings as s storage_engine = settings.get_apk_storage_engine() log.warn("Using APK storage: %s" % storage_engine) if storage_engine == s.SECTION_S3_STORAGE: return S3Storage.factory_from_config(settings) elif storage_engine == s.SECTION_RESULT_DB: return ResultDatabaseStorage.factory_from_config(settings) else: raise RuntimeError("No Storage engine defined! But requested!")
def get_apk_storage(settings): """ Get an object implementing the `ApkCopyInterface`. Parameters ---------- settings : Settings """ import androlyze.settings as s storage_engine = settings.get_apk_storage_engine() log.warn("Using APK storage: %s" % storage_engine) if storage_engine == s.SECTION_S3_STORAGE: return S3Storage.factory_from_config(settings) elif storage_engine == s.SECTION_RESULT_DB: return ResultDatabaseStorage.factory_from_config(settings) else: raise RuntimeError("No Storage engine defined! But requested!")