コード例 #1
0
ファイル: chain.py プロジェクト: dhruvbaldawa/enstaller
 def get_repo(self, req):
     """
     return the first repository in which the requirement matches at least
     one distribution
     """
     for dist in self.iter_dists(req):
         return dist_naming.repo_dist(dist)
     return None
コード例 #2
0
ファイル: chain.py プロジェクト: jdmarch/enstaller
 def get_repo(self, req):
     """
     return the first repository in which the requirement matches at least
     one distribution
     """
     for dist in self.iter_dists(req):
         return dist_naming.repo_dist(dist)
     return None
コード例 #3
0
 def get_matches_repo(self, req, repo):
     """
     Return the set of distributions which match the requirement from a
     specified repository.
     """
     matches = set()
     for dist, spec in self.index.iteritems():
         if dist_naming.repo_dist(dist) == repo and req.matches(spec):
             matches.add(dist)
     return matches
コード例 #4
0
ファイル: chain.py プロジェクト: ilanschnell/ironpkg
 def get_matches_repo(self, req, repo):
     """
     Return the set of distributions which match the requirement from a
     specified repository.
     """
     matches = set()
     for dist, spec in self.index.iteritems():
         if dist_naming.repo_dist(dist) == repo and req.matches(spec):
             matches.add(dist)
     return matches
コード例 #5
0
ファイル: chain.py プロジェクト: dhruvbaldawa/enstaller
    def get_dist(self, req):
        """
        return the distributions with the largest version and build number
        from the first repository which contains any matches
        """
        repo = self.get_repo(req)
        if repo is None:
            return None

        matches = []
        for dist in self.iter_dists(req):
            if dist_naming.repo_dist(dist) == repo:
                matches.append(dist)
        return max(matches, key=self.get_version_build)
コード例 #6
0
ファイル: chain.py プロジェクト: jdmarch/enstaller
    def get_dist(self, req):
        """
        return the distributions with the largest version and build number
        from the first repository which contains any matches
        """
        repo = self.get_repo(req)
        if repo is None:
            return None

        matches = []
        for dist in self.iter_dists(req):
            if dist_naming.repo_dist(dist) == repo:
                matches.append(dist)
        return max(matches, key=self.get_version_build)