for line in lines:
line = line.strip() ifnot line: continue# Skip empty lines
if line.startswith("project "): # Extract project name: remove "project " prefix and trailing "/"
current_project_name = line.removeprefix("project ").removesuffix("/") elif current_project_name isnotNone:
match = re.match(r"^(\d+)\s+\.$", line) ifnot match: continue
size_str = match.group(1)
project_sizes[current_project_name] = int(size_str)
current_project_name = None# Reset for the next project
return project_sizes
def get_dot_repo_size() -> int: """Gets the disk usage of the '.repo' directory in bytes.
Returns:
The size of the '.repo' directory in bytes. Returns 0if the command
fails or the directory doesn't exist (du returns 0).
Raises:
FileNotFoundError: If the 'du' command isnot found. # Note: subprocess.CalledProcessError is not explicitly raised on failure # because we want to return 0 in that case. """
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.