def __init__(self, context_model=None, parent=None, callback=None):
        """
        Args:
            callback (callable): If supplied, this will be called and passed
            a `Package` for each package in the versions list. If the callable
            returns False, that package will be disabled for selection.
        """
        super(PackageVersionsTable, self).__init__(0, 2, parent)
        ContextViewMixin.__init__(self, context_model)

        self.package_name = None
        self.callback = callback
        self.packages = {}

        self.setGridStyle(QtCore.Qt.DotLine)
        self.setSelectionMode(QtGui.QAbstractItemView.SingleSelection)
        self.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
        self.setVerticalScrollMode(QtGui.QAbstractItemView.ScrollPerPixel)

        hh = self.horizontalHeader()
        hh.setStretchLastSection(True)
        vh = self.verticalHeader()
        vh.setResizeMode(QtGui.QHeaderView.ResizeToContents)
        self.clear()
def __init__ ( self , context_model = None , parent = None , callback = None ) : super ( PackageVersionsTable , self ) . __init__ ( 0 , 2 , parent ) ContextViewMixin . __init__ ( self , context_model ) self . package_name = None self . callback = callback self . packages = { } self . setGridStyle ( QtCore . Qt . DotLine ) self . setSelectionMode ( QtGui . QAbstractItemView . SingleSelection ) self . setSelectionBehavior ( QtGui . QAbstractItemView . SelectRows ) self . setVerticalScrollMode ( QtGui . QAbstractItemView . ScrollPerPixel ) hh = self . horizontalHeader ( ) hh . setStretchLastSection ( True ) vh = self . verticalHeader ( ) vh . setResizeMode ( QtGui . QHeaderView . ResizeToContents ) self . clear ( )
Args:
            callback (callable): If supplied, this will be called and passed
            a `Package` for each package in the versions list. If the callable
            returns False, that package will be disabled for selection.