def package_added(self, codepath):
        # package was added, we need to update list
        av = self._available_packages_list
        inst = self._enabled_packages_list
        items = av.findItems(codepath, QtCore.Qt.MatchExactly)
        if len(items) < 1:
            # this is required for basic_modules and abstraction since
            # they are not in available_package_names_list initially
            self.populate_lists()
            items = av.findItems(codepath, QtCore.Qt.MatchExactly)
        for item in items:
            pos = av.indexFromItem(item).row()
            av.takeItem(pos)
            inst.addItem(item)
            inst.sortItems()
            self.select_package_after_update(codepath)
dataset/ETHPy150Open VisTrails/VisTrails/vistrails/gui/preferences.py/QPackagesWidget.package_added/original