Esempio n. 1
0
_DebugFlagSet_doc_body = \
    """
    A :class:`!DebugFlagSet` object is a set of debugging flags that could
    be associated with a :class:`~bedframe._services.Service`

    """
_DebugFlagSet_doc = \
    """Debugging flags
    """ \
    + _DebugFlagSet_doc_body
_FrozenDebugFlagSet_doc = \
    """Immutable debugging flags
    """ \
    + _DebugFlagSet_doc_body
DebugFlagSetABC, DebugFlagSet, FrozenDebugFlagSet = \
    _namedflagset_classes('DebugFlagSet', doc=_DebugFlagSet_doc,
                          frozendoc=_DebugFlagSet_doc)


DEBUG_EXC_NAME = DebugFlagSet.register_flag('DEBUG_EXC_NAME', 'exception name')


DEBUG_EXC_MESSAGE = \
    DebugFlagSet.register_flag('DEBUG_EXC_MESSAGE', 'exception message',
                               implied=DEBUG_EXC_NAME)


DEBUG_EXC_INSTANCE_INFO = \
    DebugFlagSet.register_flag('DEBUG_EXC_INSTANCE_INFO',
                               'exception instance info',
                               implied=(DEBUG_EXC_NAME | DEBUG_EXC_MESSAGE))
Esempio n. 2
0
    .. seealso::
        :class:`spruce.lang.NamedFlagSet \
                <spruce.lang._datatypes._misc.NamedFlagSet>`

    """
_ProvisionSet_doc = \
    """Authentication security provisions.
    """ \
    + _ProvisionSet_doc_body
_FrozenProvisionSet_doc = \
    """Immutable authentication security provisions.
    """ \
    + _ProvisionSet_doc_body
ProvisionSetABC, ProvisionSet, FrozenProvisionSet = \
    _namedflagset_classes('ProvisionSet', doc=_ProvisionSet_doc,
                          frozendoc=_ProvisionSet_doc)


class ProvisionSetSetABC(object):

    __metaclass__ = _abc.ABCMeta

    def __repr__(self):
        if not self:
            items_repr = ''
        elif self == self._universe():
            items_repr = '*'
        else:
            ubi_provisionsets, nonubi_provisionsets = \
                self._condensed_repr_provisionsets()
            if ubi_provisionsets: