Package install :: Package MoSTBioDat :: Package DataBase :: Package ImportData :: Package Data2DB :: Module PropFile
[hide private]
[frames] | no frames]

Source Code for Module install.MoSTBioDat.DataBase.ImportData.Data2DB.PropFile

 1  #!/usr/bin/env python 
 2  ################################## 
 3  # PropFile.py                    # 
 4  # Parse Property  database file  # 
 5  ################################## 
 6   
 7  ###################################################### 
 8  # Copyright (c) 2007-2008 Andrzej Bak                # 
 9  # ARC Seibersdorf & University of Silesia            # 
10  # Author: Andrzej Bak <Andrzej.Bak@us.edu.pl>        # 
11  # License: GNU General Public License, version: 3    # 
12  # URL: http://chemoinformatyka.us.edu.pl/mostbiodat/ # 
13  # Version: 1, 06.01.2010                             # 
14  ###################################################### 
15   
16  try: 
17      import sys 
18      import os 
19      import anydbm 
20      from openeye.oechem import * 
21      from MoSTBioDat.DataBase.ImportData.Data2DB.DBFile import DBFile,InputDB,filterKeys 
22      from MoSTBioDat.Log.MoSTBioDatLog import  MoSTBioDatLog 
23  except ImportError,e: 
24      print 'Error: %s' %e 
25      sys.exit(1) 
26   
27  ########## Property file class ###################### 
28 -class PropFile(DBFile):
29 """ 30 Basic Property File parser 31 INPUT: 32 propfile - property file path, str, default=None 33 dictpath - str - path to dictionary 34 dictfilename - str - dictionary filename 35 dbfile - str - database file path 36 format - str - logging file format, default "%(levelname)s %(asctime)s %(ip)s %(username)s %(filename)s %(module)s %(funcName)s %(lineno)d >> %(message)s " 37 filter - specified record to be logged 38 datefmt - str - date format 39 path - str - path to log files 40 filename - str - log filename, default 'log' 41 filemode - str - log file mode, default 'wa' 42 level - str - logging level, default logging.DEBUG 43 logfilelevel - log file level 44 temporary - str - temporary directory 45 OUTPUT: 46 dictionary object 47 """
48 - def __init__(self,propfile=None,**kwargs):
49 DBFile.__init__(self,dbfile=propfile,**kwargs) 50 try: 51 self.logobj=MoSTBioDatLog(**kwargs)#create logging object 52 self.log=self.logobj.getLogHandler()#create logging handler 53 except IOError,e: 54 print 'Error: %s, %s' %(e[0],e[1]) 55 sys.exit(1)
56
57 - def proParse(self):
58 """ 59 virtual property parse file functions 60 """ 61 pass
62 63 ############### End of class ########################################## 64 ############ MAIN ##################################################### 65 ############ example of usage ######################################### 66 if __name__=='__main__': 67 pass 68