Source code for molfoundry.labelsettings
from .labeltype import LabelType
from .labelrelation import LabelRelation
from .core import TSObject
_class_ref = TSObject.get_class_ref("LabelSettings")
[docs]
class LabelSettings(TSObject):
def __init__(self, type: LabelType, relation: LabelRelation) -> None:
super().__init__(_class_ref, type.value, relation.value)
@property
def type(self) -> LabelType:
t = self._ref.getType()
return LabelType.Term if t == 'term' else LabelType.String
@property
def relation(self) -> LabelRelation:
r = self._ref.getRelation()
if r == 'isomorphism':
return LabelRelation.Isomorphism
if r == 'specialisation':
return LabelRelation.Specialisation
return LabelRelation.Unification