X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FScripts%2FBinToPcd.py;h=25b74f60049335d57f0878ed69e40fe0c6f0c5d9;hp=10b5043325cc23d8872b99e2d8397d409019fd89;hb=76c09700edc67686b29662e81a3ca7d947594ce5;hpb=72443dd25014a8b6209895640af36dec33da51e0 diff --git a/BaseTools/Scripts/BinToPcd.py b/BaseTools/Scripts/BinToPcd.py index 10b5043325..25b74f6004 100644 --- a/BaseTools/Scripts/BinToPcd.py +++ b/BaseTools/Scripts/BinToPcd.py @@ -41,13 +41,13 @@ if __name__ == '__main__': return Value def ValidatePcdName (Argument): - if re.split ('[a-zA-Z\_][a-zA-Z0-9\_]*\.[a-zA-Z\_][a-zA-Z0-9\_]*', Argument) != ['','']: + if re.split ('[a-zA-Z\_][a-zA-Z0-9\_]*\.[a-zA-Z\_][a-zA-Z0-9\_]*', Argument) != ['', '']: Message = '{Argument} is not in the form .'.format (Argument = Argument) raise argparse.ArgumentTypeError (Message) return Argument def ValidateGuidName (Argument): - if re.split ('[a-zA-Z\_][a-zA-Z0-9\_]*', Argument) != ['','']: + if re.split ('[a-zA-Z\_][a-zA-Z0-9\_]*', Argument) != ['', '']: Message = '{Argument} is not a valid GUID C name'.format (Argument = Argument) raise argparse.ArgumentTypeError (Message) return Argument @@ -66,7 +66,7 @@ if __name__ == '__main__': # # If Xdr flag is not set, then concatenate all the data # - Buffer = b''.join (Buffer) + Buffer = bytearray (b''.join (Buffer)) # # Return a PCD value of the form '{0x01, 0x02, ...}' along with the PCD length in bytes # @@ -84,7 +84,7 @@ if __name__ == '__main__': help = "Output filename for PCD value or PCD statement") parser.add_argument ("-p", "--pcd", dest = 'PcdName', type = ValidatePcdName, help = "Name of the PCD in the form .") - parser.add_argument ("-t", "--type", dest = 'PcdType', default = None, choices = ['VPD','HII'], + parser.add_argument ("-t", "--type", dest = 'PcdType', default = None, choices = ['VPD', 'HII'], help = "PCD statement type (HII or VPD). Default is standard.") parser.add_argument ("-m", "--max-size", dest = 'MaxSize', type = ValidateUnsignedInteger, help = "Maximum size of the PCD. Ignored with --type HII.")