示例#1
0
 def LocateInputFiles(self, files: List[str]) -> List[PackageFile]:
     oldFiles = files
     resultFileList = []  # type: List[PackageFile]
     for file in oldFiles:
         location = self.__LocateInputFileLocation(file)
         resultFileList.append(PackageFile(file, None, location))
     return resultFileList
示例#2
0
 def TryLocatePackageFileByName(self,
                                packageName: str) -> Optional[PackageFile]:
     foundLocation = self.PackageLocationCache.TryLocatePackage(packageName)
     if foundLocation is None:
         return None
     return PackageFile(cast(str, foundLocation.FoundPackageFilePath),
                        packageName, foundLocation.SourceLocation)
示例#3
0
 def LocateMissingPackages(self, missingDict: Dict[str, XmlGenFile]) -> List[PackageFile]:
     """ Given a dict of missing package requests, try to locate them """
     files = []
     for packageName in sorted(missingDict.keys()):
         foundLocation = self.__LocateMissingPackage(packageName, missingDict)
         files.append(PackageFile(cast(str, foundLocation.FoundPackageFilePath), packageName, foundLocation.SourceLocation))
     return files
示例#4
0
 def TryLocateMissingPackagesByName(
         self, packageName: str) -> Optional[PackageFile]:
     # Check to see if the package can be found
     foundLocation = self.PackageLocationCache.TryLocatePackage(packageName)
     if foundLocation is not None and foundLocation.FoundPackageFilePath is not None:
         return PackageFile(foundLocation.FoundPackageFilePath, packageName,
                            foundLocation.SourceLocation)
     return None
示例#5
0
    def GetKnownPackageFiles(self, theFiles: List[PackageFile]) -> List[PackageFile]:
        """ Get all the files associated with the typeId then merge it with the supplied file list.
        """

        knownPackageLocationList = self.PackageLocationCache.GetKnownPackageLocations()  # type: List[PackageLocationCachePath]
        result = list(theFiles)
        for packageLocation in knownPackageLocationList:
            result.append(PackageFile(cast(str, packageLocation.FoundPackageFilePath), packageLocation.PackageName, packageLocation.SourceLocation))

        return result