def addEnum(self, key, source):
    if (type(source).__name__ == 'dict'):
        self._enums[key] = source
    elif issubclass(source, Enum):
        list = {}
        enum = {name: value for (name, value) in vars(source).items() if name.isupper()}
        for p in enum:
            list[p] = enum[p].value
        self._enums[key] = list
    else:
        raise ExpressionError(('enum not supported: ' + key))
def addEnum(self, key, source):
    if (type(source).__name__ == 'dict'):
        self._enums[key] = source
    elif issubclass(source, Enum):
        list = {}
        enum = {name: value for (name, value) in vars(source).items() if name.isupper()}
        for p in enum:
            list[p] = enum[p].value
        self._enums[key] = list
    else:
        raise ExpressionError(('enum not supported: ' + key))