File indexing completed on 2023-03-17 11:09:54
0001
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 from __future__ import print_function
0007
0008 import configparser as cp
0009
0010 Config=cp.ConfigParser()
0011
0012 def ConfigSectionMap(section):
0013 dict1 = {}
0014 options = Config.options(section)
0015 for option in options:
0016 try:
0017 dict1[option] = Config.get(section, option)
0018 if dict1[option] == -1:
0019 DebugPrint("skip: %s" % option)
0020 except:
0021 print("exception on %s!" % option)
0022 dict1[option] = None
0023 return dict1