'Called after a terminal has been renamed
Causes sigTerminalRenamed to be emitted.'

def terminalRenamed(self, term, oldName):

    newName = term.name()
    for d in [self.terminals, self._inputs, self._outputs]:
        if (oldName not in d):
            continue
        d[newName] = d[oldName]
        del d[oldName]
    self.graphicsItem().updateTerminals()
    self.sigTerminalRenamed.emit(term, oldName)
