Exemple #1
0
 def getRequires(self, obj):
     '''return dict: {packageObject:[require, require, ...]}'''
     if not self.indexBuilt:
         self.buildIndex()
     result = {}
     for pkgObject in self.requirePkgDict.get(obj.name, []):
         requires = PackageUtil.matchingRequire(pkgObject, obj)
         if requires:
             result[pkgObject] = requires
     return result
Exemple #2
0
 def getRequires(self, obj):
      '''return dict: {packageObject:[require, require, ...]}'''
      if not self.indexBuilt:
          self.buildIndex()
      result = {}
      for pkgObject in self.requirePkgDict.get(obj.name, []):
          requires = PackageUtil.matchingRequire(pkgObject, obj)
          if requires:
              result[pkgObject] = requires
      return result
    def getRequires(self, require):
        name, version  = require.name, require.version
        if require in self._requireCache:
            return self._requireCache[require]

        pkgs = self.searchPkgByRequire(name)
        result = {}
        for pkgObj in pkgs:
            if name[0] == '/' and version is None:
                result[pkgObj] = [Require(name, None, None, None, None)]
                continue
            requires = PackageUtil.matchingRequire(pkgObj, require)
            if requires:
                result[pkgObj] = requires
        self._requireCache[require] = result
        return result
Exemple #4
0
    def getRequires(self, require):
        name, version = require.name, require.version
        if require in self._requireCache:
            return self._requireCache[require]

        pkgs = self.searchPkgByRequire(name)
        result = {}
        for pkgObj in pkgs:
            if name[0] == '/' and version is None:
                result[pkgObj] = [Require(name, None, None, None, None)]
                continue
            requires = PackageUtil.matchingRequire(pkgObj, require)
            if requires:
                result[pkgObj] = requires
        self._requireCache[require] = result
        return result