qgreenland/util/misc.py
def directory_size_bytes(dir_path):
    """Return the size of the directory's contents in bytes."""
    dir_path = Path(dir_path)
    if not dir_path.is_dir():
        raise QgrRuntimeError(f'`dir_path` must be a directory. Got {dir_path}')

    contents = dir_path.glob('**/*')
    total_size = 0
    for content in contents:
        total_size += content.stat().st_size

    return total_size
Return the size of the directory's contents in bytes.
Return the size of the directory's contents in bytes.
Return the size of the directory ' s contents in bytes .
def directory_size_bytes(dir_path):
    dir_path = Path(dir_path)
    if not dir_path.is_dir():
        raise QgrRuntimeError(f'`dir_path` must be a directory. Got {dir_path}')
    contents = dir_path.glob('**/*')
    total_size = 0
    for content in contents:
        total_size += content.stat().st_size
    return total_size
def directory_size_bytes ( dir_path ) : dir_path = Path ( dir_path ) if not dir_path . is_dir ( ) : raise QgrRuntimeError ( f'`dir_path` must be a directory. Got {dir_path}' ) contents = dir_path . glob ( '**/*' ) total_size = 0 for content in contents : total_size += content . stat ( ) . st_size return total_size
Return the size of the directory's contents in bytes.
Return the size of the directory ' s contents in bytes .
"""Return the size of the directory's contents in bytes."""
dir_path