[F] AttributeError: 'dict' object has no attribute 'recolor_ascii'
This commit is contained in:
parent
d11796ef02
commit
85eaad14f2
4 changed files with 19 additions and 3 deletions
|
|
@ -7,7 +7,7 @@ from typing_extensions import Literal
|
|||
from .color_util import AnsiMode
|
||||
from .constants import CONFIG_PATH
|
||||
from .neofetch_util import ColorAlignment
|
||||
from .serializer import json_stringify
|
||||
from .serializer import json_stringify, from_dict
|
||||
|
||||
|
||||
@dataclass
|
||||
|
|
@ -18,6 +18,11 @@ class Config:
|
|||
lightness: float | None = None
|
||||
color_align: ColorAlignment = ColorAlignment('horizontal')
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, d: dict):
|
||||
d['color_align'] = ColorAlignment.from_dict(d['color_align'])
|
||||
return from_dict(cls, d)
|
||||
|
||||
def save(self):
|
||||
CONFIG_PATH.parent.mkdir(exist_ok=True, parents=True)
|
||||
CONFIG_PATH.write_text(json_stringify(self), 'utf-8')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue