1
2
3
4
5
6
7 """ Configuration for Rational Discovery's Python code
8
9 """
10
11 import os,sys
12 try:
13 RDBaseDir=os.environ['RDBASE']
14 except:
15 RDBaseDir='d:/RD'
16 RDCodeDir=os.path.join(RDBaseDir,'rdkit')
17 RDImageDir=os.path.join(RDCodeDir,'qtGui','Images')
18 RDDataDir=os.path.join(RDBaseDir,'Data')
19 RDDocsDir=os.path.join(RDBaseDir,'Docs')
20 RDDemoDir=os.path.join(RDBaseDir,'Demo')
21 RDBinDir=os.path.join(RDBaseDir,'bin')
22 RDProjDir=os.path.join(RDBaseDir,'Projects')
23
24
25
26
27 if os.environ.has_key('RDDGEOM'):
28 dgeomLoc=os.environ['RDDGEOM']
29 else:
30 if sys.platform=='win32':
31 binName = 'dgeom.exe'
32 else:
33 binName = 'dgeom'
34 dgeomLoc=os.path.join(RDBinDir,binName)
35
36 if os.environ.has_key('RDTINKER'):
37 tinkerPath=os.environ['RDTINKER']
38 else:
39 if sys.platform=='win32':
40 tinkerPath = ''
41 else:
42 tinkerPath = '/usr/local/src/tinker'
43 tinkerBin = '%s/bin'%(tinkerPath)
44 tinkerParams = '%s/params'%(tinkerPath)
45
46 try:
47 doingDemo=os.environ['RDDEMO']
48 if doingDemo=='0': doingDemo=0
49 except:
50 doingDemo=0
51
52 try:
53 largeFont=os.environ['RDLARGEFONT']
54 except:
55 largeFont=0
56
57 RDFont=None
58 logGui=0
59
60 rpcTestPort=8423
61 pythonTestCommand="python"
62
63 defaultDBUser='sysdba'
64 defaultDBPassword='masterkey'
65
66
67 import exceptions
72
73
74
75
76 if sys.platform=='win32':
77 pythonExe=os.path.join(os.environ.get('PYTHONHOME','c:/python25'),'python.exe')
78 spawn = os.spawnve
79 else:
80 pythonExe="python"
81 spawn = os.spawnvpe
82
83
84
85
86 usePgSQL=0
87 useSqlLite=0
88 if not (os.environ.has_key('RD_USEGVIB') and os.environ['RD_USEGVIB']):
89 if not os.environ.get('RD_USESQLLITE',''):
90 try:
91 from pyPgSQL import PgSQL
92 usePgSQL=1
93 except ImportError:
94 usePgSQL=0
95 try:
96
97 import sqlite3
98 useSqlLite=True
99 except ImportError:
100 try:
101
102 from pysqlite2 import dbapi2
103 useSqlLite=True
104 except:
105 pass
106 else:
107 useSqlLite=True
108 else:
109 usePgSQL=0
110
111 if usePgSQL:
112 RDTestDatabase='::RDTests'
113 RDDataDatabase='::RDData'
114 elif useSqlLite:
115 RDTestDatabase=os.path.join(RDDataDir,"RDTests.sqlt")
116 RDDataDatabase=os.path.join(RDDataDir,"RDData.sqlt")
117 else:
118 RDTestDatabase=os.path.join(RDDataDir,"RDTests.gdb")
119 RDDataDatabase=os.path.join(RDDataDir,"RDData.gdb")
120
121
122
123
124 molViewer=os.environ.get('RD_MOLVIEWER','PYMOL').upper()
125