def get_repository_version(pear_output):
 lines = pear_output.split('\n')
 for line in lines:
  if ('Latest ' in line):
   return line.rsplit(None, 1)[(-1)].strip()
 return None

def get_repository_version ( pear_output ) : lines = pear_output . split ( '\n' ) for line in lines : if ( 'Latest ' in line ) : return line . rsplit ( None , 1 ) [ ( - 1 ) ] . strip ( ) return None
take pear remote-info output and get the latest version .