toolsutils.py
changeset 8697 574bb05e40a4
parent 8695 358d8bed9626
child 9740 c0239d8ae742
child 9928 0d831b40fa48
equal deleted inserted replaced
8696:0bb18407c053 8697:574bb05e40a4
   174             except ValueError:
   174             except ValueError:
   175                 option = line.strip().lower()
   175                 option = line.strip().lower()
   176                 if option[0] == '[':
   176                 if option[0] == '[':
   177                     # start a section
   177                     # start a section
   178                     section = option[1:-1]
   178                     section = option[1:-1]
   179                     assert not config.has_key(section), \
   179                     assert section not in config, \
   180                            'Section %s is defined more than once' % section
   180                            'Section %s is defined more than once' % section
   181                     config[section] = current = {}
   181                     config[section] = current = {}
   182                     continue
   182                     continue
   183                 sys.stderr.write('ignoring malformed line\n%r\n' % line)
   183                 sys.stderr.write('ignoring malformed line\n%r\n' % line)
   184                 continue
   184                 continue