Beispiel #1
0
 def __new__(cls, *args, **kwargs):
     try:
         exception = kwargs["exception"]
         error_cls = type(xstr(exception), (cls,), {})
     except KeyError:
         error_cls = cls
     return Exception.__new__(error_cls, *args)
Beispiel #2
0
    def type(name):
        """ Return the :class:`.Relationship` subclass corresponding to a
        given name.

        :param name: relationship type name
        :returns: `type` object
        """
        for s in Relationship.__subclasses__():
            if s.__name__ == name:
                return s
        return type(xstr(name), (Relationship, ), {})
Beispiel #3
0
 def __repr__(self):
     return xstr(cypher_repr(self))