utils¶
Uncategorised utilities.
- class deltona.utils.DataAdapter¶
Bases:
BaseAdapterNiquests adapter that returns the URL content (after
data:) as the response body.- send(request: PreparedRequest, **kwargs: Any) Response¶
Send a request and return the URL content as the response body.
- deltona.utils.add_cdda_times(times: Iterable[str] | None) str | None¶
Add CDDA time strings and get a total runtime in CDDA format.
CDDA format is
MM:SS:FFwhereMMis minutes,SSis seconds, andFFis frames.
- deltona.utils.kill_processes_by_name(name: str) None¶
-
deltona.utils.kill_processes_by_name(name: str, wait_timeout: float, signal: int =
SIGTERM, *, force: bool =False) list[int] Kill processes matching a name.
On Windows, uses
taskkill.exe. On other platforms, useskillall.
-
deltona.utils.secure_move_path(client: SSHClient, filename: StrPath, remote_target: str, *, bandwidth_limit_kbits: float | None =
None, dry_run: bool =False, preserve_stats: bool =False, write_into: bool =False) None¶ Move a file or directory to a remote host over SSH.
Like
scpbut deletes the local file after a successful copy.- Parameters:¶
- client : paramiko.SSHClient¶
Connected SSH client.
- filename : StrPath¶
Local file or directory to move.
- remote_target : str¶
Remote destination path.
~is expanded to the remote home directory. When moving a file, if this ends with/or refers to an existing remote directory, the source basename is appended; otherwise it is used as the literal destination filename.- bandwidth_limit_kbits : float | None¶
If set, throttle each upload to the given bandwidth in Kbit/s.
- dry_run : bool¶
If
True, do not perform any file operations.- preserve_stats : bool¶
If
True, preserve modification and access times.- write_into : bool¶
If
True, write into the target directory rather than creating a new one.