def parse_name_and_version(p):
 m = NAME_VERSION_RE.match(p)
 if (not m):
  raise DistlibException(("Ill-formed name/version string: '%s'" % p))
 d = m.groupdict()
 return (d['name'].strip().lower(), d['ver'])

def parse_name_and_version ( p ) : m = NAME_VERSION_RE . match ( p ) if ( not m ) : raise DistlibException ( ( "Ill-formed name/version string: '%s'" % p ) ) d = m . groupdict ( ) return ( d [ 'name' ] . strip ( ) . lower ( ) , d [ 'ver' ] )
a utility method used to get name and version from a string .