From 63d30013a335389503e7e382f2bed1debfa595eb Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 13 Sep 2024 15:53:20 +0200 Subject: [PATCH] lint/fs --- rwx/fs/__init__.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/rwx/fs/__init__.py b/rwx/fs/__init__.py index e769358..c91e0b8 100644 --- a/rwx/fs/__init__.py +++ b/rwx/fs/__init__.py @@ -1,3 +1,5 @@ +"""Operations involving FileSystems.""" + import os import shutil @@ -6,7 +8,8 @@ from rwx import ps CHARSET = "UTF-8" -def create_image(file_path: str, size_bytes: int): +def create_image(file_path: str, size_bytes: int) -> None: + """Create a virtual device image file.""" ps.run( ("qemu-img", "create"), ("-f", "qcow2"), @@ -14,11 +17,13 @@ def create_image(file_path: str, size_bytes: int): ) -def empty_file(path: str): +def empty_file(path: str) -> None: + """Empty the file at provided path.""" write(path, "") -def get_mount_uuid(path: str): +def get_mount_uuid(path: str) -> str: + """Return the UUID of provided mountpoint path.""" return ps.run_line( ("findmnt",), ("--noheadings",),