edk2toollib/uefi/edk2/parsers/base_parser.py
def FindPath(self, *p):
        """
        Given a path, it will find it relative to the root, the current target file, or the packages path
        Args:
          *p: any number of strings or path like objects

        Returns: a full absolute path if the file exists, None on failure

        """
        # check if we're getting a None
        if p is None or (len(p) == 1 and p[0] is None):
            return None

        Path = os.path.join(*p)
        # check if it it is absolute
        if os.path.isabs(Path) and os.path.exists(Path):
            return Path

        # If the absolute path exists, return it.
        Path = os.path.join(self.RootPath, *p)
        if os.path.exists(Path):
            return os.path.abspath(Path)

        # If that fails, check a path relative to the target file.
        if self.TargetFilePath is not None:
            Path = os.path.abspath(os.path.join(os.path.dirname(self.TargetFilePath), *p))
            if os.path.exists(Path):
                return os.path.abspath(Path)

        # If that fails, check in every possible Pkg path.
        if self._Edk2PathUtil is not None:
            target_path = os.path.join(*p)
            Path = self._Edk2PathUtil.GetAbsolutePathOnThisSystemFromEdk2RelativePath(target_path, False)
            if Path is not None:
                return Path

        # log invalid file path
        self.Logger.error(f"Invalid file path: {p}")
        return None

        Given a path, it will find it relative to the root, the current target file, or the packages path
        Args:
          *p: any number of strings or path like objects

        Returns: a full absolute path if the file exists, None on failure

        
Given a path, it will find it relative to the root, the current target file, or the packages path
Given a path it will find it relative to the root the current target file or the packages path
def FindPath(self, *p):
        if p is None or (len(p) == 1 and p[0] is None):
            return None
        Path = os.path.join(*p)
        if os.path.isabs(Path) and os.path.exists(Path):
            return Path
        Path = os.path.join(self.RootPath, *p)
        if os.path.exists(Path):
            return os.path.abspath(Path)
        if self.TargetFilePath is not None:
            Path = os.path.abspath(os.path.join(os.path.dirname(self.TargetFilePath), *p))
            if os.path.exists(Path):
                return os.path.abspath(Path)
        if self._Edk2PathUtil is not None:
            target_path = os.path.join(*p)
            Path = self._Edk2PathUtil.GetAbsolutePathOnThisSystemFromEdk2RelativePath(target_path, False)
            if Path is not None:
                return Path
        self.Logger.error(f"Invalid file path: {p}")
        return None
def FindPath ( self , * p ) : if p is None or ( len ( p ) == 1 and p [ 0 ] is None ) : return None Path = os . path . join ( * p ) if os . path . isabs ( Path ) and os . path . exists ( Path ) : return Path Path = os . path . join ( self . RootPath , * p ) if os . path . exists ( Path ) : return os . path . abspath ( Path ) if self . TargetFilePath is not None : Path = os . path . abspath ( os . path . join ( os . path . dirname ( self . TargetFilePath ) , * p ) ) if os . path . exists ( Path ) : return os . path . abspath ( Path ) if self . _Edk2PathUtil is not None : target_path = os . path . join ( * p ) Path = self . _Edk2PathUtil . GetAbsolutePathOnThisSystemFromEdk2RelativePath ( target_path , False ) if Path is not None : return Path self . Logger . error ( f"Invalid file path: {p}" ) return None
Given a path, it will find it relative to the root, the current target file, or the packages path
Given a path it will find it relative to the root the current target file or the packages path
"""
        Given a path, it will find it relative to the root, the current target file, or the packages path
        Args:
          *p: any number of strings or path like objects

        Returns: a full absolute path if the file exists, None on failure

        """ # check if we're getting a None # check if it it is absolute # If the absolute path exists, return it. # If that fails, check a path relative to the target file. # If that fails, check in every possible Pkg path. # log invalid file path
self
*p
any number of strings or path like objects
any number of strings or path like objects