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

def get_local_version ( pear_output ) : lines = pear_output . split ( '\n' ) for line in lines : if ( 'Installed ' in line ) : installed = line . rsplit ( None , 1 ) [ ( - 1 ) ] . strip ( ) if ( installed == '-' ) : continue return installed return None
take pear remoteinfo output and get the installed version .