#!c:\Program Files\Python39\python.exe
# -*- coding: utf-8 -*-
# ***** include the biocase.lib directory in the python sys path for importing *****
import os, sys
exec(open(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir, 'lib', 'biocase', 'adjustpath.py'))).read())
# import pydevd; pydevd.settrace();
import subprocess
import biocase.configuration
from biocase.tools.various_functions import folder_not_writable
cfg = biocase.configuration.Cfg()
import graphviz
print('Content-Type: text/html')
print() # Blank line marking end of HTTP headers
print('''
Python Interpreter: %s
''' % ".".join([str(i) for i in sys.version_info[:3]]))
print('''
green: Ok! |
red: you have to install it |
orange: install only if required
Libraries required for core wrapper
Library |
Installed Version |
Hint |
''')
# biocase libs
print('''
BioCASe |
''')
try:
import biocase.tools.update
print('' + biocase.__version__ + '')
except Exception as err:
print('not installed' % err)
print(' | %s |
' % biocase.tools.update.update_hint())
# QueryTool
print('''
Libraries only needed for querytool
Library |
Installed Version |
Hint |
''')
# libxml2/libxslt
print('''
lxml |
''')
try:
import lxml
try:
v = lxml.__version__
except:
v = 'installed'
print('%s' % v)
except Exception as err:
print('not installed' % err)
print(''' |
Use PIP to install from PyPI: pip install lxml. |
''')
# HTML
print('''
Status of additional database dependent drivers
Library |
Installed Version |
Download Library |
''')
# pyODBC
print('''
pyodbc |
''')
try:
import pyodbc
print('' + pyodbc.version + '')
except Exception as err:
print('not installed' % err)
print(''' |
Use PIP to install from PyPI: pip install pyodbc. |
''')
# pymssql
print('''
pymssql |
''')
try:
import pymssql
print('' + pymssql.__version__ + '')
except Exception as err:
print('not installed' % err)
print(''' |
Use PIP to install from PyPI: pip install pymssql. |
''')
# psycopg2
print('''
psycopg2 |
''')
try:
import psycopg2
print('' + psycopg2.__version__ + '')
except Exception as err:
print('not installed' % err)
print(''' | Use PIP to install from PyPI: pip install psycopg2. |
''')
# MySQLdb
print('''
MySQLdb |
''')
try:
import MySQLdb
v = '.'.join([str(i) for i in MySQLdb.version_info])
print('' + v + '')
except Exception as err:
print('not installed' % err)
print(''' |
Use PIP to install from PyPI: pip install mysqlclient. |
''')
# kinterbasdb
print('''
fdb |
''')
try:
import fdb
print('' + fdb.__version__ + '')
except Exception as err:
print('not installed' % err)
print(''' |
Use PIP to install from PyPI: pip install fdb. |
''')
# SQLlite
print('''
SQLite3 |
''')
try:
import sqlite3
print('' + sqlite3.version + '')
except Exception as err:
print('not installed' % err)
print(''' |
(integrated into Python) |
''')
# cx_Oracle
print('''
cx_Oracle |
''')
try:
import cx_Oracle
print('' + cx_Oracle.version + '')
except Exception as err:
print('not installed' % err)
print(''' |
Oracle module, you also need the Oracle Client |
''')
# Sybase
print('''
Sybase |
''')
try:
import Sybase
print('' + Sybase.__version__ + '')
except Exception as err:
print('not installed' % err)
print(''' |
Sybase module |
If you can't find the Windows installer package for your Python version, try your luck here.
''')
# DETECT GRAPHVIZ, external binaries
try:
if cfg.server.graphviz_dot:
os.environ["PATH"] += os.pathsep + cfg.server.graphviz_dot
version = '.'.join([str(i) for i in graphviz.version()])
graphviz_status = '
%s' % version
else:
graphviz_status = '
not configured'
except Exception as err:
graphviz_status = '
Binary not found' % err
# Java
try:
proc = subprocess.Popen([cfg.server.java, '-version'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
version = str(proc.stderr.readline())
java_status = '
%s' % version.replace("b'java version ", '').replace("b'openjdk version ", '').replace('"', '').replace("\\r", "").replace("\\n", "").replace("'", "")
except Exception as err:
java_status = '
Binary not found' % err
print('''
Optional external binaries
Binary |
Status/Version |
Path |
%s |
%s |
%s |
%s |
%s |
%s |
''' % ('
Graphviz Dot', graphviz_status, cfg.server.graphviz_dot,
'
Java', java_status, cfg.server.java))
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'
statusArchiveWork = folder_not_writable(cfg.archiveWorkLocator)
if statusArchiveWork is None:
awrk_folder_writable_status = '
Writeable'
else:
awrk_folder_writable_status = '
Unwriteable'
statusArchiveDownload = folder_not_writable(cfg.archiveDownloadLocator)
if statusArchiveDownload is None:
adld_folder_writable_status = '
Writeable'
else:
adld_folder_writable_status = '
Unwriteable'
# HTML
print('''
Status of writable directories and files
Directory |
Status |
Path to problematic file |
Configuration |
%s |
%s |
Log |
%s |
%s |
Archive temp dir |
%s |
%s |
Archive download Dir |
%s |
%s |
''' % (config_folder_writable_status, str(statusCfg), log_folder_writable_status, str(statusLog), awrk_folder_writable_status, str(statusArchiveWork), adld_folder_writable_status, str(statusArchiveDownload)))
print('''
''')