#!C:\Python25\python.exe # -*- coding: UTF-8 -*- ''' $RCSfile: index.cgi,v $ $Revision$ $Author: markus $ $Date$ The deafult BioCASe provider software page ''' import os, sys # ***** include the biocase.lib directory in the python sys path for module importing ***** execfile( os.path.abspath(os.path.join(os.path.dirname( __file__ ), os.path.pardir, 'lib', 'biocase', 'adjustpath.py' ) ) ) execfile( os.path.abspath(os.path.join(os.path.dirname( __file__ ), os.path.pardir, 'lib', 'biocase', 'appinit.py' ) ) ) 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 import biocase.datasources from biocase import __version__ #------------------------------------------------------------------------------------ log.error("in index") 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__ #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