def get_human_readable_disk_usage(d):
 if (platform.system() in ['Linux', 'FreeBSD']):
  try:
   return subprocess.Popen(['du', '-sh', d], stdout=subprocess.PIPE).communicate()[0].split()[0]
  except:
   raise CleanupException('rosclean is not supported on this platform')
 else:
  raise CleanupException('rosclean is not supported on this platform')

def get_human_readable_disk_usage ( d ) : if ( platform . system ( ) in [ 'Linux' , 'FreeBSD' ] ) : try : return subprocess . Popen ( [ 'du' , '-sh' , d ] , stdout = subprocess . PIPE ) . communicate ( ) [ 0 ] . split ( ) [ 0 ] except : raise CleanupException ( 'rosclean is not supported on this platform' ) else : raise CleanupException ( 'rosclean is not supported on this platform' )
get human-readable disk usage for directory .