def createStore(self): if super(StoreFactory, self).createStore() is not None: return super(StoreFactory, self).createStore() pp = self.propertiesImporter() # increase readability a bit # No other store set up. Grab the configuration, check for postgres. root = pp.getRDFUtil().getRoot() storeConfig = root.getThing(predicate=VV.HAS_STORE) if (storeConfig.isA(VV.POSTGRES_STORE_TYPE)): from PGTransactionStore import PGTransactionStore self.store(newStore=PGTransactionStore( dbprops=pp.getDatabaseProperties(storeConfig=storeConfig))) elif storeConfig.isA(VV.FILE_STORE_TYPE): self.store( newStore=FileStore(storeConfig.getString(VV.FILE_DATA_PATH), storeConfig.getString(VV.FILE_INDEX_PATH))) elif storeConfig.isA(VV.MEMORY_STORE_TYPE): self.store(newStore=MemoryStore()) else: raise Exception('ERROR no store found!') return self.store()
def __init__(self, project): self.project = project self.store = FileStore("mutants")
def __set_storage(): if STORAGE_TYPE == 'mongo': return MongoStore() return FileStore()