Ejemplo n.º 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)
Ejemplo n.º 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, ), {})
Ejemplo n.º 3
0
 def __repr__(self):
     return xstr(cypher_repr(self))