edk2toollib/uefi/edk2/guid_list.py
def parse_guids_from_dec(stream, filename: str) -> list:
        """ find all guids in a dec file contents contained with stream

        stream: lines of dec file content
        filename: abspath to dec file
        """
        results = []
        dec = DecParser()
        dec.ParseStream(stream)
        for p in dec.Protocols:
            results.append(GuidListEntry(p.name, str(p.guid).upper(), filename))
        for p in dec.PPIs:
            results.append(GuidListEntry(p.name, str(p.guid).upper(), filename))
        for p in dec.Guids:
            results.append(GuidListEntry(p.name, str(p.guid).upper(), filename))

        try:
            results.append(GuidListEntry(dec.Dict["PACKAGE_NAME"], dec.Dict["PACKAGE_GUID"], filename))
        except:
            logging.warning("Failed to find Package Guid from dec file: " + filename)
        return results
 find all guids in a dec file contents contained with stream

        stream: lines of dec file content
        filename: abspath to dec file
        
find all guids in a dec file contents contained with stream
stream: lines of dec file content
filename: abspath to dec file
find all guids in a dec file contents contained with stream stream : lines of dec file content filename : abspath to dec file
def parse_guids_from_dec(stream, filename: str) -> list:
        results = []
        dec = DecParser()
        dec.ParseStream(stream)
        for p in dec.Protocols:
            results.append(GuidListEntry(p.name, str(p.guid).upper(), filename))
        for p in dec.PPIs:
            results.append(GuidListEntry(p.name, str(p.guid).upper(), filename))
        for p in dec.Guids:
            results.append(GuidListEntry(p.name, str(p.guid).upper(), filename))
        try:
            results.append(GuidListEntry(dec.Dict["PACKAGE_NAME"], dec.Dict["PACKAGE_GUID"], filename))
        except:
            logging.warning("Failed to find Package Guid from dec file: " + filename)
        return results
def parse_guids_from_dec ( stream , filename : str ) -> list : results = [ ] dec = DecParser ( ) dec . ParseStream ( stream ) for p in dec . Protocols : results . append ( GuidListEntry ( p . name , str ( p . guid ) . upper ( ) , filename ) ) for p in dec . PPIs : results . append ( GuidListEntry ( p . name , str ( p . guid ) . upper ( ) , filename ) ) for p in dec . Guids : results . append ( GuidListEntry ( p . name , str ( p . guid ) . upper ( ) , filename ) ) try : results . append ( GuidListEntry ( dec . Dict [ "PACKAGE_NAME" ] , dec . Dict [ "PACKAGE_GUID" ] , filename ) ) except : logging . warning ( "Failed to find Package Guid from dec file: " + filename ) return results
find all guids in a dec file contents contained with stream
stream: lines of dec file content
filename: abspath to dec file
find all guids in a dec file contents contained with stream stream : lines of dec file content filename : abspath to dec file
""" find all guids in a dec file contents contained with stream

        stream: lines of dec file content
        filename: abspath to dec file
        """
stream
filename
str