# Path: omelette/fromage/common.py
# class DrawableNode(Drawable):
#     """Base class for node-like diagram elements (e.g. classes, use cases)."""
# 
#     def __init__(self, uml_object):
#         super(DrawableNode, self).__init__(uml_object)
# 
# class DrawableEdge(Drawable):
#     """Base class for edgy things (e.g. lines, relations)."""
# 
#     def __init__(self, uml_object):
#         super(DrawableEdge, self).__init__(uml_object)
# 
#         self.source_anchor = None
#         self.target_anchor = None
# 
# class Anchor(object):
#     """
#     Class representing connection between edge (connector) and something else
#     (slot).
#     """
# 
#     def __init__(self):
#         self.connector = None
#         self.slot = None


import inspect
from omelette.fromage.common import DrawableNode, DrawableEdge, Anchor

            edge.source_anchor = source_anchor
            edge.target_anchor = target_anchor

            source.anchors.append(source_anchor)
            target.anchors.append(target_anchor)

    def __create_anchors(self, edge):
        target_anchor = Anchor()
        source_anchor = Anchor()
        source, target = self.__get_slots(edge)

        source_anchor.connector = target_anchor.connector = edge
        source_anchor.slot = source
        target_anchor.slot = target

        return source_anchor, target_anchor

    def __get_slots(self, edge):
        source = self.__get_object(edge, "source-object")
        target = self.__get_object(edge, "target-object")
        return source, target

    def __get_object(self, edge, key):
        try:
            return self.nodes[edge.uml_object[key]]
        except KeyError:
            return self.edges[edge.uml_object[key]]

    def clear(self):

# Path: omelette/fromage/common.py
# class DrawableNode(Drawable):
#     """Base class for node-like diagram elements (e.g. classes, use cases)."""
# 
#     def __init__(self, uml_object):
#         super(DrawableNode, self).__init__(uml_object)
# 
# class DrawableEdge(Drawable):
#     """Base class for edgy things (e.g. lines, relations)."""
# 
#     def __init__(self, uml_object):
#         super(DrawableEdge, self).__init__(uml_object)
# 
#         self.source_anchor = None
#         self.target_anchor = None
# 
# class Anchor(object):
#     """
#     Class representing connection between edge (connector) and something else
#     (slot).
#     """
# 
#     def __init__(self):
#         self.connector = None
#         self.slot = None


# Path: omelette/fromage/diagram.py
import inspect
from omelette.fromage.common import DrawableNode, DrawableEdge, Anchor


            edge.source_anchor = source_anchor
            edge.target_anchor = target_anchor

            source.anchors.append(source_anchor)
            target.anchors.append(target_anchor)

    def __create_anchors(self, edge):
        target_anchor = Anchor()
        source_anchor = Anchor()
        source, target = self.__get_slots(edge)

        source_anchor.connector = target_anchor.connector = edge
        source_anchor.slot = source
        target_anchor.slot = target

        return source_anchor, target_anchor

    def __get_slots(self, edge):
        source = self.__get_object(edge, "source-object")
        target = self.__get_object(edge, "target-object")
        return source, target

    def __get_object(self, edge, key):
        try:
            return self.nodes[edge.uml_object[key]]
        except KeyError:
            return self.edges[edge.uml_object[key]]

    def clear(self):

        self.nodes.clear()