'Delete link from model.'

def deleteLink(self, link):

    pair = self.links.get(link, None)
    if (pair is not None):
        source = pair['src']
        dest = pair['dest']
        del source.links[dest]
        del dest.links[source]
        stags = self.canvas.gettags(self.widgetToItem[source])
        ltags = self.canvas.gettags(link)
        if ('control' in ltags):
            controllerName = ''
            switchName = ''
            if ('Controller' in stags):
                controllerName = source['text']
                switchName = dest['text']
            else:
                controllerName = dest['text']
                switchName = source['text']
            if (controllerName in self.switchOpts[switchName]['controllers']):
                self.switchOpts[switchName]['controllers'].remove(controllerName)
    if (link is not None):
        del self.links[link]
