Better printing of MOs in API

This commit is contained in:
Bertrand Benjamin 2018-09-20 18:38:49 +02:00
parent b63405592f
commit 49a09fd52c

View File

@ -16,6 +16,11 @@ def _txt(mo_tree):
""" txt render for MOs or Trees"""
try:
return tree2txt(mo_tree)
except AttributeError:
pass
try:
return mo_tree.__txt__
except AttributeError:
return str(mo_tree)
@ -23,6 +28,11 @@ def _tex(mo_tree):
""" Tex render for MOs or Trees"""
try:
return tree2tex(mo_tree)
except AttributeError:
pass
try:
return mo_tree.__tex__
except AttributeError:
return str(mo_tree)