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
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)
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
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
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