new: users can now customize the faces via config.yml (ui.faces)

This commit is contained in:
Simone Margaritelli
2019-10-20 17:13:05 +02:00
parent 99e0a31ea8
commit cd5d783c52
3 changed files with 89 additions and 61 deletions

View File

@ -16,3 +16,8 @@ SAD = '(╥☁╥ )'
FRIEND = '(♥‿‿♥)'
BROKEN = '(☓‿‿☓)'
DEBUG = '(#__#)'
def load_from_config(config):
for face_name, face_value in config.items():
globals()[face_name.upper()] = face_value

View File

@ -22,6 +22,9 @@ class View(object):
def __init__(self, config, impl, state=None):
global ROOT
# setup faces from the configuration in case the user customized them
faces.load_from_config(config['ui']['faces'])
self._render_cbs = []
self._config = config
self._canvas = None