FileInfo is now a frozen dataclass for efficiency.
This commit is contained in:
parent
bb47b50c5f
commit
7754a90313
@ -1,23 +1,23 @@
|
||||
"""FileInfo object stores all needed information about a file."""
|
||||
"""FileInfo object stores information about a file."""
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
__all__ = ["FileInfo"]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class FileInfo:
|
||||
"""Stores all needed information about a file.
|
||||
"""Stores information about a file.
|
||||
|
||||
Arguments:
|
||||
Fields:
|
||||
- `name` -- name of a file;
|
||||
- `size` -- size of a file;
|
||||
- `dlurl` -- full download URL for a file;
|
||||
- `download_url` -- full download URL for a file;
|
||||
- `hash_value` -- hash sum of a file;
|
||||
- `hash_algo` -- hash algorithm used (e.g. md5).
|
||||
- `hash_algorithm` -- hash algorithm used (e.g. md5).
|
||||
"""
|
||||
def __init__(self, name: str, size: int, dlurl: str,
|
||||
hash_value: str, hash_algo: str) -> None:
|
||||
self.name = name
|
||||
self.size = size
|
||||
self.dlurl = dlurl
|
||||
self.hash_value = hash_value
|
||||
self.hash_algo = hash_algo
|
||||
name: str
|
||||
size: int
|
||||
download_url: str
|
||||
hash_value: str
|
||||
hash_algorithm: str
|
||||
|
Loading…
Reference in New Issue
Block a user