def connect(self, other, force=True):
    if (not getattr(self._modifier, 'isDone', True)):
        return self._modifier.connect(self, other, force)
    mod = om.MDGModifier()
    if force:
        for plug in other._mplug.connectedTo(True, False):
            mod.disconnect(plug, other._mplug)
    mod.connect(self._mplug, other._mplug)
    mod.doIt()
def connect(self, other, force=True):
    if (not getattr(self._modifier, 'isDone', True)):
        return self._modifier.connect(self, other, force)
    mod = om.MDGModifier()
    if force:
        for plug in other._mplug.connectedTo(True, False):
            mod.disconnect(plug, other._mplug)
    mod.connect(self._mplug, other._mplug)
    mod.doIt()