src/build/lacros/lacros_resource_sizes.py
def _get_total_pathsize(base_dir, paths):
  """Computes total file sizes given by a list of paths, best-effort.

  Args:
    base_dir: Base directory for all elements in |paths|.
    paths: A list of filenames or directory names to specify files whose sizes
      to be counted. Directories are recursed. There's no de-duping effort.
      Non-existing files or directories are ignored (with warning message).
  """
  total_size = 0
  for path in paths:
    full_path = os.path.join(base_dir, path)
    if os.path.exists(full_path):
      if os.path.isdir(full_path):
        for dirpath, _, filenames in os.walk(full_path):
          for filename in filenames:
            total_size += _get_single_filesize(os.path.join(dirpath, filename))
      else:  # Assume is file.
        total_size += _get_single_filesize(full_path)
    else:
      logging.critical('Not found: %s', path)
  return total_size
Computes total file sizes given by a list of paths, best-effort.

  Args:
    base_dir: Base directory for all elements in |paths|.
    paths: A list of filenames or directory names to specify files whose sizes
      to be counted. Directories are recursed. There's no de-duping effort.
      Non-existing files or directories are ignored (with warning message).
  
Computes total file sizes given by a list of paths, best-effort.
Computes total file sizes given by a list of paths best - effort .
def _get_total_pathsize(base_dir, paths):
  total_size = 0
  for path in paths:
    full_path = os.path.join(base_dir, path)
    if os.path.exists(full_path):
      if os.path.isdir(full_path):
        for dirpath, _, filenames in os.walk(full_path):
          for filename in filenames:
            total_size += _get_single_filesize(os.path.join(dirpath, filename))
      else:  
        total_size += _get_single_filesize(full_path)
    else:
      logging.critical('Not found: %s', path)
  return total_size
def _get_total_pathsize ( base_dir , paths ) : total_size = 0 for path in paths : full_path = os . path . join ( base_dir , path ) if os . path . exists ( full_path ) : if os . path . isdir ( full_path ) : for dirpath , _ , filenames in os . walk ( full_path ) : for filename in filenames : total_size += _get_single_filesize ( os . path . join ( dirpath , filename ) ) else : total_size += _get_single_filesize ( full_path ) else : logging . critical ( 'Not found: %s' , path ) return total_size
Computes total file sizes given by a list of paths, best-effort.
Computes total file sizes given by a list of paths best - effort .
"""Computes total file sizes given by a list of paths, best-effort.

  Args:
    base_dir: Base directory for all elements in |paths|.
    paths: A list of filenames or directory names to specify files whose sizes
      to be counted. Directories are recursed. There's no de-duping effort.
      Non-existing files or directories are ignored (with warning message).
  """ # Assume is file.
base_dir
Base directory for all elements in |paths|.
Base directory for all elements in |paths| .
paths
A list of filenames or directory names to specify files whose sizes
to be counted. Directories are recursed. There's no de-duping effort.
Non-existing files or directories are ignored (with warning message).
A list of filenames or directory names to specify files whose sizes to be counted . Directories are recursed . There ' s no de - duping effort . Non - existing files or directories are ignored ( with warning message ) .