D404: fix
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"""This module provides utility functions for serialization and deserialization of data classes.
|
||||
"""Provides utility functions for serialization and deserialization of data classes.
|
||||
|
||||
Functions:
|
||||
- sanitize_string(s: str) -> str: Ensures a string is properly escaped for json serializing.
|
||||
|
||||
@@ -61,7 +61,7 @@ class AsyncResult[R]:
|
||||
|
||||
@dataclass
|
||||
class AsyncContext:
|
||||
"""This class stores thread-local data."""
|
||||
"""Stores thread-local data."""
|
||||
|
||||
prefix: str | None = None # prefix for logging
|
||||
stdout: IO[bytes] | None = None # stdout of subprocesses
|
||||
|
||||
@@ -231,8 +231,8 @@ def terminate_process(process: subprocess.Popen) -> Iterator[None]:
|
||||
|
||||
|
||||
class TimeTable:
|
||||
"""This class is used to store the time taken by each command
|
||||
and print it at the end of the program if env CLAN_CLI_PERF=1 is set.
|
||||
"""Stores the time taken by each command
|
||||
and prints it at the end of the program if env CLAN_CLI_PERF=1 is set.
|
||||
"""
|
||||
|
||||
def __init__(self) -> None:
|
||||
@@ -297,7 +297,7 @@ class RunOpts:
|
||||
|
||||
|
||||
def cmd_with_root(cmd: list[str], graphical: bool = False) -> list[str]:
|
||||
"""This function returns a wrapped command that will be run with root permissions.
|
||||
"""Returns a wrapped command that will be run with root permissions.
|
||||
It will use sudo if graphical is False, otherwise it will use run0 or pkexec.
|
||||
"""
|
||||
if os.geteuid() == 0:
|
||||
|
||||
@@ -99,7 +99,7 @@ class SetSelectorType(str, Enum):
|
||||
|
||||
@dataclass
|
||||
class SetSelector:
|
||||
"""This class represents a selector used in a set.
|
||||
"""Represents a selector used in a set.
|
||||
type: SetSelectorType = SetSelectorType.STR
|
||||
value: str = ""
|
||||
|
||||
@@ -783,7 +783,7 @@ class FlakeCache:
|
||||
|
||||
@dataclass
|
||||
class Flake:
|
||||
"""This class represents a flake, and is used to interact with it.
|
||||
"""Represents a flake, and is used to interact with it.
|
||||
values can be accessed using the select method, which will fetch the value from the cache if it is present.
|
||||
"""
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ from clan_lib.jsonrpc import ClanJSONEncoder
|
||||
|
||||
@contextmanager
|
||||
def locked_open(filename: Path, mode: str = "r") -> Generator:
|
||||
"""This is a context manager that provides an advisory write lock on the file specified by `filename` when entering the context, and releases the lock when leaving the context. The lock is acquired using the `fcntl` module's `LOCK_EX` flag, which applies an exclusive write lock to the file."""
|
||||
"""Context manager that provides an advisory write lock on the file specified by `filename` when entering the context, and releases the lock when leaving the context. The lock is acquired using the `fcntl` module's `LOCK_EX` flag, which applies an exclusive write lock to the file."""
|
||||
with filename.open(mode) as fd:
|
||||
fcntl.flock(fd, fcntl.LOCK_EX)
|
||||
yield fd
|
||||
|
||||
Reference in New Issue
Block a user