def GetMountpoints(data=None):
 expiry = 60
 insert_time = MOUNTPOINT_CACHE[0]
 if ((insert_time + expiry) > time.time()):
  return MOUNTPOINT_CACHE[1]
 devices = {}
 if (data is None):
  data = '\n'.join([open(x, 'rb').read() for x in ['/proc/mounts', '/etc/mtab']])
 for line in data.splitlines():
  try:
   (device, mnt_point, fs_type, _) = line.split(' ', 3)
   mnt_point = os.path.normpath(mnt_point)
   devices[mnt_point] = (device, fs_type)
  except ValueError:
   pass
 MOUNTPOINT_CACHE[0] = time.time()
 MOUNTPOINT_CACHE[1] = devices
 return devices

def GetMountpoints ( data = None ) : expiry = 60 insert_time = MOUNTPOINT_CACHE [ 0 ] if ( ( insert_time + expiry ) > time . time ( ) ) : return MOUNTPOINT_CACHE [ 1 ] devices = { } if ( data is None ) : data = '\n' . join ( [ open ( x , 'rb' ) . read ( ) for x in [ '/proc/mounts' , '/etc/mtab' ] ] ) for line in data . splitlines ( ) : try : ( device , mnt_point , fs_type , _ ) = line . split ( ' ' , 3 ) mnt_point = os . path . normpath ( mnt_point ) devices [ mnt_point ] = ( device , fs_type ) except ValueError : pass MOUNTPOINT_CACHE [ 0 ] = time . time ( ) MOUNTPOINT_CACHE [ 1 ] = devices return devices
list all the filesystems mounted on the system .