refactor: remove dataclass dependency

This commit is contained in:
Daylin Morgan 2023-08-21 09:30:55 -05:00
parent 3031e5fb7f
commit c7bcdfefee
Signed by: daylin
GPG key ID: C1E52E7DD81DF79F

View file

@ -32,7 +32,6 @@ from argparse import (
) )
from argparse import ArgumentParser as StdArgParser from argparse import ArgumentParser as StdArgParser
from contextlib import contextmanager from contextlib import contextmanager
from dataclasses import dataclass
from datetime import datetime from datetime import datetime
from logging.handlers import RotatingFileHandler from logging.handlers import RotatingFileHandler
from pathlib import Path from pathlib import Path
@ -53,7 +52,7 @@ from typing import (
Union, Union,
) )
__version__ = "23.8b1-6-g19c39ad-dev" __version__ = "23.8b1-7-g3031e5f-dev"
class Spinner: class Spinner:
@ -800,15 +799,24 @@ def get_hash(spec: Tuple[str, ...] | List[str], track_exe: bool = False) -> str:
return sha256.hexdigest() return sha256.hexdigest()
@dataclass
class Meta: class Meta:
name: str def __init__(
id: str self,
spec: List[str] name: str,
files: List[str] id: str,
exe: str spec: List[str],
created: str = "" files: List[str],
accessed: str = "" exe: str,
created: str = "",
accessed: str = "",
):
self.name = name
self.id = id
self.spec = spec
self.files = files
self.exe = exe
self.created = created
self.accessed = accessed
@classmethod @classmethod
def load(cls, name: str) -> "Meta": def load(cls, name: str) -> "Meta":