toolsutils.py
changeset 7896 4c954e1e73ef
parent 7879 9aae456abab5
child 8695 358d8bed9626
equal deleted inserted replaced
7894:ad0eeb0f7a8d 7896:4c954e1e73ef
   178                     section = option[1:-1]
   178                     section = option[1:-1]
   179                     assert not config.has_key(section), \
   179                     assert not config.has_key(section), \
   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                 print >> sys.stderr, 'ignoring malformed line\n%r' % line
   183                 sys.stderr.write('ignoring malformed line\n%r\n' % line)
   184                 continue
   184                 continue
   185             option = option.strip().replace(' ', '_')
   185             option = option.strip().replace(' ', '_')
   186             value = value.strip()
   186             value = value.strip()
   187             current[option] = value or None
   187             current[option] = value or None
   188     except IOError, ex:
   188     except IOError, ex: