# Path: sslscan/exception.py
# class ConfigOptionNotFound(BaseConfigError):
#     def __init__(self, name, value):
#         self.name = name
#         self.value = value
# 
#     def __str__(self):
#         s = "Option with name '{0}' does not exist.".format(
#             self.name
#         )
#         return s
# 
# class OptionValueError(BaseConfigError):
#     def __init__(self, option, value):
#         self.option = option
#         self.value = value
# 
#     def __str__(self):
#         s = "Unable to set value '{2}' for option '{0}' of type '{1}'".format(
#             self.option.name,
#             self.option.type,
#             self.value
#         )
#         return s


import logging
from sslscan.exception import ConfigOptionNotFound, OptionValueError

        :param Mixed default: Default value if value of option not set
        :return: The value or the default value
        :rtype: Mixed
        """

        if self.value is not None:
            return self.value
        if default is not None:
            return default
        return self.default

    def set_value(self, value):
        """
        Set the value and returns True if it was successful or False if not.

        :param Mixed value: The value
        :raises sslscan.exception.OptionValueError: if types do not match
        """

        logger.debug("Set value of option '%s' to '%r'", self.name, value)

        value = self.convert_value_type(value)

        if self.type == "choice":
            values = self.values
            if callable(values):
                values = values(self)

            if value not in values:

# Path: sslscan/exception.py
# class ConfigOptionNotFound(BaseConfigError):
#     def __init__(self, name, value):
#         self.name = name
#         self.value = value
# 
#     def __str__(self):
#         s = "Option with name '{0}' does not exist.".format(
#             self.name
#         )
#         return s
# 
# class OptionValueError(BaseConfigError):
#     def __init__(self, option, value):
#         self.option = option
#         self.value = value
# 
#     def __str__(self):
#         s = "Unable to set value '{2}' for option '{0}' of type '{1}'".format(
#             self.option.name,
#             self.option.type,
#             self.value
#         )
#         return s


# Path: sslscan/config.py
import logging
from sslscan.exception import ConfigOptionNotFound, OptionValueError


        :param Mixed default: Default value if value of option not set
        :return: The value or the default value
        :rtype: Mixed
        """

        if self.value is not None:
            return self.value
        if default is not None:
            return default
        return self.default

    def set_value(self, value):
        """
        Set the value and returns True if it was successful or False if not.

        :param Mixed value: The value
        :raises sslscan.exception.OptionValueError: if types do not match
        """

        logger.debug("Set value of option '%s' to '%r'", self.name, value)

        value = self.convert_value_type(value)

        if self.type == "choice":
            values = self.values
            if callable(values):
                values = values(self)

            if value not in values:

                raise OptionValueError(option=self, value=value)