mirror of https://gitlab.com/bashrc2/epicyon
Add exception handling
parent
ccd06e614f
commit
e60c8d65dc
11
theme.py
11
theme.py
|
@ -518,8 +518,15 @@ def _set_dyslexic_font(base_dir: str) -> bool:
|
||||||
template_filename = base_dir + '/' + filename
|
template_filename = base_dir + '/' + filename
|
||||||
if not os.path.isfile(template_filename):
|
if not os.path.isfile(template_filename):
|
||||||
continue
|
continue
|
||||||
with open(template_filename, 'r', encoding='utf-8') as fp_css:
|
|
||||||
css = fp_css.read()
|
css = None
|
||||||
|
try:
|
||||||
|
with open(template_filename, 'r', encoding='utf-8') as fp_css:
|
||||||
|
css = fp_css.read()
|
||||||
|
except OSError:
|
||||||
|
print('EX: _set_dyslexic_font unable to read ' + template_filename)
|
||||||
|
|
||||||
|
if css:
|
||||||
css = \
|
css = \
|
||||||
set_css_param(css, "*src",
|
set_css_param(css, "*src",
|
||||||
"url('./fonts/OpenDyslexic-Regular.woff2" +
|
"url('./fonts/OpenDyslexic-Regular.woff2" +
|
||||||
|
|
Loading…
Reference in New Issue