#!/System/Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python
# -*- coding: UTF-8 -*-

'''
$RCSfile: main.py,v $
$Revision: 897 $
$Author: markus $
$Date: 2008-04-29 18:15:52 +0200 (Di, 29. Apr 2008) $
The BioCASE querytool
'''

import os, sys
# ***** include the biocase.lib directory in the python sys path for importing *****
execfile( os.path.abspath( os.path.join( os.path.dirname( __file__ ), os.pardir, os.pardir, 'lib', 'biocase', 'adjustpath.py' ) ))

from biocase.configtool.general import *
from biocase.datasources import getDsaList


############################################################################################################
#
#   MAIN
#
#===========================================================================================================


# use the main.html template to select a datasource first
tmpl = PageMacro('Content', PageMacro.DELMODE)
tmpl.load('Content', os.path.join(templateDir, '_main.html'))
# get list of available dsa's
DsaList = getDsaList()
log.debug("DSA list from datasource directory: %s" %str(DsaList))

# fill template 
DsaTmplList = [{'dsa':dsa.name} for dsa in DsaList]
tmpl.expand('Content', 'datasourcelist', DsaTmplList)
    

#
# print HTML !
#
printOverHTTP( tmpl )


