INNER CODE UNIT · Python
from_file
lgienapp/aquarel · aquarel/theme.py:749
def from_file(cls, filename: str):
"""
Initialize a theme from a theme file
:param filename: file to load theme dictionary from
:return: cls
"""
with open(filename, "r", encoding='utf8') as f:
data = json.load(f)
return cls.from_dict(data)
@classmethod
def from_dict(cls, data: dict):
"""
Initialize a theme from a dictionary
:param data: theme dictionary to initialize from
:return: cls