def _read_rospack_cache(cache, ros_root, ros_package_path):
 try:
  with open(os.path.join(rospkg.get_ros_home(), 'rospack_cache')) as f:
   for l in f.readlines():
    l = l[:(-1)]
    if (not len(l)):
     continue
    if (l[0] == '#'):
     if l.startswith('#ROS_ROOT='):
      if (not (l[len('#ROS_ROOT='):] == ros_root)):
       return False
     elif l.startswith('#ROS_PACKAGE_PATH='):
      if (not (l[len('#ROS_PACKAGE_PATH='):] == ros_package_path)):
       return False
    else:
     cache[os.path.basename(l)] = (l, ros_root, ros_package_path)
  return True
 except:
  pass

def _read_rospack_cache ( cache , ros_root , ros_package_path ) : try : with open ( os . path . join ( rospkg . get_ros_home ( ) , 'rospack_cache' ) ) as f : for l in f . readlines ( ) : l = l [ : ( - 1 ) ] if ( not len ( l ) ) : continue if ( l [ 0 ] == '#' ) : if l . startswith ( '#ROS_ROOT=' ) : if ( not ( l [ len ( '#ROS_ROOT=' ) : ] == ros_root ) ) : return False elif l . startswith ( '#ROS_PACKAGE_PATH=' ) : if ( not ( l [ len ( '#ROS_PACKAGE_PATH=' ) : ] == ros_package_path ) ) : return False else : cache [ os . path . basename ( l ) ] = ( l , ros_root , ros_package_path ) return True except : pass
read in rospack_cache data into cache .