def parse_egg_info(path):
 info = {}
 for line in open(path, encoding=u'utf-8'):
  line = line.strip()
  m = pat.match(line)
  if m:
   key = m.group(1).lower()
   info[key] = m.group(2)
  try:
   return (u'%(name)s-%(version)s-<pip>' % info)
  except KeyError:
   pass
 return None

def parse_egg_info ( path ) : info = { } for line in open ( path , encoding = u'utf-8' ) : line = line . strip ( ) m = pat . match ( line ) if m : key = m . group ( 1 ) . lower ( ) info [ key ] = m . group ( 2 ) try : return ( u'%(name)s-%(version)s-<pip>' % info ) except KeyError : pass return None
parse an .