def add(self,dist):
if self.can_add(dist) and dist.has_version():<EOL><INDENT>dists = self._distmap.setdefault(dist.key,[])<EOL>if dist not in dists:<EOL><INDENT>dists.append(dist)<EOL>if dist.key in self._cache:<EOL><INDENT>_sort_dists(self._cache[dist.key])<EOL><DEDENT><DEDENT><DEDENT>
Add `dist` if we ``can_add()`` it and it isn't already added