def _parse_config(filename):
  """Return a dict with (name, value) items for the given I2P configuration file."""
  f = open(filename, 'r')
  s = f.read()
  f.close()
  ans = {}
  for line in s.split('\n'):
    line = line.strip()
    if '#' in line: line = line[:line.find('#')]
    pair = line.split('=')
    if len(pair) == 2:
      ans[pair[0].strip()] = pair[1].strip()
  return ans