def add_module_event(self, event, data):
        item = data.items[0]
        self.controller.reset_pipeline_view = False
        self.noUpdate = True
        internal_version = -1L
        reg = get_module_registry()
        if reg.is_abstraction(item.descriptor):
            internal_version = item.descriptor.module.internal_version
        adder = self.controller.add_module_from_descriptor
        module = adder(item.descriptor, 
                       event.scenePos().x(),
                       -event.scenePos().y(),
                       internal_version)
        self.reset_module_colors()
        graphics_item = self.addModule(module)
        graphics_item.update()

        if get_vistrails_configuration().check('autoConnect'):
            if self.tmp_output_conn is not None:
                if self.tmp_output_conn.isVisible():
                    self.createConnectionFromTmp(self.tmp_output_conn, module)
                self.tmp_output_conn.disconnect()
                self.removeItem(self.tmp_output_conn)
                self.tmp_output_conn = None

            if self.tmp_input_conn is not None:
                if self.tmp_input_conn.isVisible():
                    self.createConnectionFromTmp(self.tmp_input_conn, module)
                self.tmp_input_conn.disconnect()
                self.removeItem(self.tmp_input_conn)
                self.tmp_input_conn = None
        
        self.unselect_all()
        # Change selection
        graphics_item.setSelected(True)

        # controller changed pipeline: update ids
        self._old_connection_ids = \
            set(self.controller.current_pipeline.connections)
        self._old_module_ids = set(self.controller.current_pipeline.modules)

        # We are assuming the first view is the real pipeline view
        self.views()[0].setFocus()

        self.noUpdate = False
Adds a new module from a drop event
dataset/ETHPy150Open VisTrails/VisTrails/vistrails/gui/pipeline_view.py/QPipelineScene.add_module_event