#!C:\Programme2\Python26\python.exe # -*- coding: utf-8 -*- # ***** include the biocase.lib directory in the python sys path for importing ***** import os, sys execfile( os.path.abspath(os.path.join(os.path.dirname( __file__ ), os.path.pardir, os.path.pardir, 'lib', 'biocase', 'adjustpath.py' ) ) ) import cgitb; cgitb.enable() import string import biocase.configuration cfg = biocase.configuration.Cfg() print 'Content-Type: text/html' print # Blank line marking end of HTTP headers print ''' Python library tests

Python Interpreter: %s

''' % string.join([str(i) for i in sys.version_info[:3]],".") print '''green: Ok! | red: you have to install it | orange: install the one for your database

Libraries required for core wrapper

''' # biocase libs print ''' ''' # HTML print'''
Library Installed Version Download Library
BioCASE lib ''' try: import biocase print '' + biocase.__version__ + '' except: print 'not installed' print ''' BioCASE libs

 

Libraries only needed for querytool:

''' # 4suite print ''' ''' # HTML print '''
Library Installed Version Download Library
4Suite XML ''' try: import Ft print '' + Ft.__version__ + '' except: print 'not installed' print ''' 4Suite XML

 

Status of additional database dependent drivers:

''' # mxODBC print ''' ''' # pymssql print ''' ''' # psycopg2 print ''' ''' # MySQLdb print ''' ''' # cx_Oracle print ''' ''' # kinterbasdb print ''' ''' # SQLlite print ''' ''' # Sybase print '''
Library Installed Version Download Library
ceODBC ''' try: import ceODBC print '' + ceODBC.version + '' except: print 'not installed' print ''' ceODBC module
pymssql ''' try: import pymssql print '' + pymssql.__version__ + '' except: print 'not installed' print ''' MS SQL Server module (unix/win)
psycopg2 ''' try: import psycopg2 print '' + psycopg2.__version__ + '' except: print 'not installed' print ''' PostgreSQL module win binaries
MySQLdb ''' try: import MySQLdb print '' + MySQLdb.__version__ + '' except: print 'not installed' print ''' mySQL module
cx_Oracle ''' try: import cx_Oracle print '' + cx_Oracle.version + '' except: print 'not installed' print ''' Oracle 8-9 module, you also need the Oracle Client
kinterbasdb ''' try: import kinterbasdb print '' + string.join([str(x) for x in kinterbasdb.__version__], ".") + '' except: print 'not installed' print ''' Firebird/Interbase module
SQLlite ''' try: import sqlite print '' + sqlite.version + '' except: print 'not installed' print ''' pySQLite module
sybase ''' try: import sybase print '' + sybase.__version__ + '' except: print 'not installed' print ''' Sybase module
''' # DETECT GRAPHVIZ, external binaries if cfg.server.graphviz_dot is not None and os.path.isfile(cfg.server.graphviz_dot): graphviz_status = '%s' % "Binary found" else: graphviz_status = '%s' % "Binary not found" print '''

 

Optional external binaries:

Binary Status Path
%s %s %s
''' %('Graphviz Dot', graphviz_status, cfg.server.graphviz_dot) # #Detect if the configuration and log folders are writable rescursively. # def folder_not_writable(path, verbose=False): '''Returns "---" if folder is writable or the absolute path of the directory or file that is not writable.''' for root, dirs, files in os.walk(path): if verbose: print "
-->walk dir: %s"%(root) # check directories by creating a test dummy file for name in dirs: fn = os.path.join(root, name, 'dummy1973TestomatKarambolaIggI') try: f = file(fn, 'a') except: if verbose: print "
DIR %s IS NOT WRITABLE !!!"%(fn) return os.path.join(root, name) f.close() os.unlink(fn) if verbose: print "
dir %s is writable."%( os.path.join(root, name) ) # check if files are writable by opening them for appending for name in files: fn = os.path.join(root, name) try: f = file(fn, 'a') except: if verbose: print "
FILE %s IS NOT WRITABLE !!!"%(fn) return fn if verbose: print "
file %s is writable."%(fn) return None statusCfg = folder_not_writable(cfg.configurationLocator) if statusCfg is None: config_folder_writable_status = 'Writeable' else: config_folder_writable_status = 'Unwriteable' statusLog = folder_not_writable(cfg.logLocator) if statusLog is None: log_folder_writable_status = 'Writeable' else: log_folder_writable_status = 'Unwriteable' # HTML print '''

 

Status of writable directories and files:

Directory Status Path to problematic file
Configuration %s %s
Log %s %s
''' %(config_folder_writable_status, str(statusCfg), log_folder_writable_status, str(statusLog)) print '''
'''