#!c:\Program Files\Python39\python.exe # -*- coding: UTF-8 -*- ''' $RCSfile: index.cgi,v $ $Revision$ $Author: markus $ $Date$ The deafult BioCASe provider software page ''' import os # ***** include the biocase.lib directory in the python sys path for module importing ***** exec(open(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, 'lib', 'biocase', 'adjustpath.py'))).read()) exec(open(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, 'lib', 'biocase', 'appinit.py'))).read()) # import pydevd; pydevd.settrace(); import cgitb cgitb.enable() import biocase.configuration cfg = biocase.configuration.Cfg() import logging, biocase.initlogs biocase.initlogs.initWebappLogging() log = logging.getLogger("webapp") try: #----------------------------------------------------------------------------------------------------------- import biocase.tools.templating, biocase.datasources from biocase import __version__ from biocase.tools.update import update_hint #------------------------------------------------------------------------------------ pm = biocase.tools.templating.PageMacro('Content', biocase.tools.templating.PageMacro.KEEPMODE) pm.load('Content', os.path.join(cfg.wwwLocator, '_index.html')) pm['ServiceTitle'] = 'BioCASe Provider Software %s' % __version__ pm['version'] = __version__ pm['update_hint'] = update_hint() #Now get the list of datasources available in the data provider dsaListOfHash = [{'dsa': dsaObj.name} for dsaObj in biocase.datasources.getDsaList()] pm.expand('Content', 'DataSourcesList', dsaListOfHash) # Print the headers print('Content-Type: text/html; charset=UTF-8') print() # Blank line marking end of HTTP headers print(pm) except ImportError: # redirect to lib test page print("Location: utilities/testlibs.cgi") print()