Module RDConfig
[hide private]
[frames] | no frames]

Source Code for Module RDConfig

 1  #  $Id: RDConfig.py 1528 2010-09-26 17:04:37Z glandrum $ 
 2  # 
 3  #  Copyright (C) 2000-2010 Rational Discovery LLC 
 4  # 
 5  #   @@ All Rights Reserved @@ 
 6  #  This file is part of the RDKit. 
 7  #  The contents are covered by the terms of the BSD license 
 8  #  which is included in the file license.txt, found at the root 
 9  #  of the RDKit source tree. 
10  # 
11  """ Configuration for the RDKit Python code 
12   
13  """ 
14   
15  import os,sys 
16  if os.environ.has_key('RDBASE'): 
17    RDBaseDir=os.environ['RDBASE'] 
18    RDCodeDir=os.path.join(RDBaseDir,'rdkit') 
19    RDDataDir=os.path.join(RDBaseDir,'Data') 
20    RDDocsDir=os.path.join(RDBaseDir,'Docs') 
21    RDDemoDir=os.path.join(RDBaseDir,'Demo') 
22    RDBinDir=os.path.join(RDBaseDir,'bin') 
23    RDProjDir=os.path.join(RDBaseDir,'Projects') 
24  else: 
25    from RDPaths import * 
26   
27  rpcTestPort=8423 
28  pythonTestCommand="python" 
29   
30  defaultDBUser='sysdba' 
31  defaultDBPassword='masterkey' 
32   
33  import exceptions 
34 -class ObsoleteCodeError(exceptions.Exception):
35 pass
36 -class UnimplementedCodeError(exceptions.Exception):
37 pass
38 39 # --------------------- 40 # the following block contains stuff used by the 41 # testing infrastructure 42 if sys.platform=='win32': 43 pythonExe=sys.executable 44 else: 45 pythonExe="python" 46 47 # --------------------- 48 # the following block contains stuff controlling database access: 49 usePgSQL=False 50 useSqlLite=False 51 if not os.environ.get('RD_USESQLLITE',''): 52 try: 53 from pyPgSQL import PgSQL 54 usePgSQL=True 55 except ImportError: 56 usePgSQL=False 57 if not usePgSQL: 58 try: 59 # python2.5 has this: 60 import sqlite3 61 useSqlLite=True 62 except ImportError: 63 try: 64 # earlier versions of python: 65 from pysqlite2 import dbapi2 66 useSqlLite=True 67 except: 68 pass 69 70 if usePgSQL: 71 RDTestDatabase='::RDTests' 72 RDDataDatabase='::RDData' 73 elif useSqlLite: 74 RDTestDatabase=os.path.join(RDDataDir,"RDTests.sqlt") 75 RDDataDatabase=os.path.join(RDDataDir,"RDData.sqlt") 76 else: 77 RDTestDatabase=None 78 RDDataDatabase=None 79 80 # --------------------- 81 # the following block contains stuff controlling the program used for 82 # 3D molecular visualization: 83 molViewer=os.environ.get('RD_MOLVIEWER','PYMOL').upper() 84