'Attach to main instance and register ourself and all our staff in it.'

def PlugIn(self, owner):

    self._owner = owner
    if (self.DBG_LINE not in owner.debug_flags):
        owner.debug_flags.append(self.DBG_LINE)
    self.DEBUG(('Plugging    %s    into    %s' % (self, self._owner)), 'start')
    if owner.__dict__.has_key(self.__class__.__name__):
        return self.DEBUG('Plugging    ignored:    another    instance    already    plugged.', 'error')
    self._old_owners_methods = []
    for method in self._exported_methods:
        if owner.__dict__.has_key(method.__name__):
            self._old_owners_methods.append(owner.__dict__[method.__name__])
        owner.__dict__[method.__name__] = method
    owner.__dict__[self.__class__.__name__] = self
    if self.__class__.__dict__.has_key('plugin'):
        return self.plugin(owner)
