def __TryFindFileInPath(self, rErrorRecordList: List[ErrorRecord], installationPath: Optional[str], commandFileName: str, commandExpectedPath: Optional[str]) -> Tuple[bool, Optional[str]]: if self.__BasicConfig.Verbosity >= 4: self.__BasicConfig.LogPrint("FindFileInPath: '{0}'".format(commandFileName)) path = IOUtil.TryFindFileInPath(commandFileName) if path is None: rErrorRecordList.append(ErrorRecord(ErrorClassification.Environment, "File '{0}' could not be found in path.".format(commandFileName))) return False, path if self.__BasicConfig.Verbosity >= 4: self.__BasicConfig.LogPrint("Found at '{0}'".format(path)) path = IOUtil.NormalizePath(path) if commandExpectedPath is not None: result, expectedPath = self.__TryResolvePath(rErrorRecordList, installationPath, commandExpectedPath) if not result or expectedPath is None: return False, path expectedPath = IOUtil.Join(expectedPath, commandFileName) if path != expectedPath: rErrorRecordList.append(ErrorRecord(ErrorClassification.Environment, "File '{0}' was not found at the expected path '{1}' which resolves to '{2}' but at '{3}' instead".format(commandFileName, commandExpectedPath, expectedPath, path))) if expectedPath.lower() == path.lower(): rErrorRecordList.append(ErrorRecord(ErrorClassification.Help, "Please beware that '{0}'=='{1}' if you ignore character case".format(expectedPath, path))) return False, path return True, path