Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-26 02:34:21

0001 # taken  from 
0002 """
0003 http://wiki.python.org/moin/ConfigParserExamples
0004 http://stackoverflow.com/questions/3220670/read-all-the-contents-in-ini-file-into-dictionary-with-python
0005 """
0006 
0007 import configparser as cp 
0008 
0009 Config=cp.ConfigParser()
0010 
0011 def ConfigSectionMap(section):
0012     dict1 = {}
0013     options = Config.options(section)
0014     for option in options:
0015         try:
0016             dict1[option] = Config.get(section, option)
0017             if dict1[option] == -1:
0018                 DebugPrint("skip: %s" % option)
0019         except:
0020             print("exception on %s!" % option)
0021             dict1[option] = None
0022     return dict1