(self, dist)
Add `dist` if we ``can_add()`` it and it has not already been added
Add `dist` if we ``can_add()`` it and it has not already been added
Add dist if we can_add () it and it has not already been added
def add(self, dist):
        """Add `dist` if we ``can_add()`` it and it has not already been added
        """
        if self.can_add(dist) and dist.has_version():
            dists = self._distmap.setdefault(dist.key, [])
            if dist not in dists:
                dists.append(dist)
                dists.sort(key=operator.attrgetter('hashcmp'), reverse=True)
def add ( self , dist ) : if self . can_add ( dist ) and dist . has_version ( ) : dists = self . _distmap . setdefault ( dist . key , [ ] ) if dist not in dists : dists . append ( dist ) dists . sort ( key = operator . attrgetter ( 'hashcmp' ) , reverse = True )