def getAnalysisPath(*args, **kwargs): config = getAnalysisSettings() rootPath = config.get('OUTPUT_PATH') if not rootPath or not os.path.exists(rootPath): rootPath = CadenceEnvironment.getLocalAppResourcePath( '..', '..', 'analysis', isDir=True) return FileUtils.createPath(rootPath, *args, **kwargs)
def createEngine(analysis =False): """ Creates the SqlAlchemy engine to connect to the database and returns that engine. :return: Engine """ name = 'analysis.vdb' if analysis else 'tracks.vdb' path = CadenceEnvironment.getLocalAppResourcePath( 'data', name, isFile=True) url = 'sqlite:///%s' % path return sqla.create_engine(url)