Exemple #1
0
    def get(self):
        """
        Get the current value of the object.  Note that the default implementation just
        raises C{NotImplementedError}, since the current value is not stored by default.

        @rtype: C{object}
        """

        raise_not_implemented_exception(self)
Exemple #2
0
    def get (self):
        """
        Get the current value of the object.  Note that the default implementation just
        raises C{NotImplementedError}, since the current value is not stored by default.

        @rtype: C{object}
        """

        raise_not_implemented_exception (self)
Exemple #3
0
 def test_raise_non_implemented_exception (self):
     self.assertRaises (NotImplementedError,
                        lambda: raise_not_implemented_exception ())
     self.assertRaises (NotImplementedError,
                        lambda: raise_not_implemented_exception (self))
     self.assertRaises (NotImplementedError,
                        lambda: raise_not_implemented_exception (self, 'foo'))
     self.assertRaises (NotImplementedError,
                        lambda: raise_not_implemented_exception (self, 1))
Exemple #4
0
    def back_value(self, value):
        """
        Apply back transformation to C{value} and return the result.  This function may
        raise any exception if mediator imposes some restrictions on C{value} and it
        doesn’t satisfy them.

        @rtype: C{object}
        """

        raise_not_implemented_exception(self)
Exemple #5
0
def protect (self, object):
    """
    Protect C{object} from being garbage-collected.  It is legal to protect same C{object}
    several times and an object is prevented from being garbage-collected if it has been
    protected at least once.  As a special case, if C{object} is C{None}, this function
    does nothing.

    For convenience, this function always returns C{object} itself.

    @rtype: C{object}
    """

    raise_not_implemented_exception (self)
Exemple #6
0
def protect(self, object):
    """
    Protect C{object} from being garbage-collected.  It is legal to protect same C{object}
    several times and an object is prevented from being garbage-collected if it has been
    protected at least once.  As a special case, if C{object} is C{None}, this function
    does nothing.

    For convenience, this function always returns C{object} itself.

    @rtype: C{object}
    """

    raise_not_implemented_exception(self)
Exemple #7
0
def unprotect (self, object):
    """
    Unprotect C{object}.  If has been protected once only or exactly one time more than
    times it has been unprotected, make it a legal target for garbage collection again.
    It is an error to call C{unprotect} more times than C{protect} for a same object, and
    descendant behaviour in this case is undefined.  It may even crash Python.  However,
    as a special case, if C{object} is C{None}, this function does nothing.  In
    particular, it is legal to ‘unprotect’ C{None} without having protected it first,
    because it will be a no-op and not lead to bugs.

    For convenience, this function always returns C{object} itself.

    @rtype: C{object}
    """

    raise_not_implemented_exception (self)
Exemple #8
0
def unprotect(self, object):
    """
    Unprotect C{object}.  If has been protected once only or exactly one time more than
    times it has been unprotected, make it a legal target for garbage collection again.
    It is an error to call C{unprotect} more times than C{protect} for a same object, and
    descendant behaviour in this case is undefined.  It may even crash Python.  However,
    as a special case, if C{object} is C{None}, this function does nothing.  In
    particular, it is legal to ‘unprotect’ C{None} without having protected it first,
    because it will be a no-op and not lead to bugs.

    For convenience, this function always returns C{object} itself.

    @rtype: C{object}
    """

    raise_not_implemented_exception(self)
Exemple #9
0
    def set (self, value):
        """
        Set the current value to C{value}, if possible.  Default implementation always
        raises C{NotImplementedError} as it is not mutable.

        @param value:                new value for C{AbstractValueObject}.

        @rtype:                      C{bool}
        @returns:                    Whether setting value had any effect, i.e. C{True}
                                     if C{value} is not equal to result of C{L{get}}
                                     method.

        @raises NotImplementedError: if the object is not mutable.
        @raises ValueError:          if C{value} is not suitable for some reason.
        """

        raise_not_implemented_exception (self)
Exemple #10
0
    def set(self, value):
        """
        Set the current value to C{value}, if possible.  Default implementation always
        raises C{NotImplementedError} as it is not mutable.

        @param value:                new value for C{AbstractValueObject}.

        @rtype:                      C{bool}
        @returns:                    Whether setting value had any effect, i.e. C{True}
                                     if C{value} is not equal to result of C{L{get}}
                                     method.

        @raises NotImplementedError: if the object is not mutable.
        @raises ValueError:          if C{value} is not suitable for some reason.
        """

        raise_not_implemented_exception(self)
 def execute (self, scale):
     raise_not_implemented_exception (self)
Exemple #12
0
 def _get_operator_name(self):
     raise_not_implemented_exception(self)
Exemple #13
0
 def _on_term2_change(self, new_state):
     raise_not_implemented_exception(self)
Exemple #14
0
 def execute(self, scale):
     raise_not_implemented_exception(self)
Exemple #15
0
 def _get_operator_name (self):
     raise_not_implemented_exception (self)
Exemple #16
0
 def _on_term2_change (self, new_state):
     raise_not_implemented_exception (self)