def __call__()

in xar/pip_installer.py [0:0]


    def __call__(self, requirement):
        """
        Attempts to download the requirement (and its dependencies) and add the
        wheel(s) to the downloads directory and the working set. Returns the
        distribution on success and None on failure.
        """
        # Remove non-wheels from the download directory
        self.clean()
        # Attempt to download the wheel/sdist
        try:
            self.download(requirement)
        except PipException as e:
            if self._log:
                self._log.exception(e)
            return None
        # Build wheels for the sdists (and remove the sdist)
        for entry in os.listdir(self._dest):
            if py_util.Wheel.is_wheel_archive(entry):
                continue
            try:
                sdist = os.path.join(self._dest, entry)
                self.build_wheel_from_sdist(sdist)
                xar_util.safe_remove(sdist)
            except BuildException as e:
                if self._log:
                    self._log.exception(e)
                return None
        # Return the wheel distribution
        return self.find(requirement)