From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web09.428.1644260571881110988 for ; Mon, 07 Feb 2022 11:02:52 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=IYQpmGdL; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: isaac.w.oram@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644260571; x=1675796571; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=13BOSFQqc7IazzRXmQSJuUefKl1fuCbLOwskP39w5jQ=; b=IYQpmGdLARqguDvBeZ4S0+LP4JwqalvaFGuYVqH7cGSrxTwkAYNHTvh8 PhxL0qw11L+PG1zsPa18HLieGbJAdxTu09WwhbRGIKMM/CzyZqLsU4ZJx /+2h9WMeO9klKQR0cltHjlqS/ClHjAkD5tcrZFeRm1x8jVe5KUHZxt9VN 35ZeziYGAzs2ldGSOG975Sk2PWt5JHBWzpuBbJ5nKyJqS38KOgjjH07RX mkTNaBkUdjrt2WO5EBRgkxrfFqHrY7nnX69AQh9UWQDCp8nsYkQeGZzkD JCV6QjwusVumdmmNAPifSDKRq50T1SV7W2aAhyC7Pc5qU2XJO+FIlhaE/ A==; X-IronPort-AV: E=McAfee;i="6200,9189,10250"; a="309532835" X-IronPort-AV: E=Sophos;i="5.88,350,1635231600"; d="scan'208";a="309532835" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2022 11:02:50 -0800 X-IronPort-AV: E=Sophos;i="5.88,350,1635231600"; d="scan'208";a="567583937" Received: from iworam-desk.amr.corp.intel.com ([10.7.150.79]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2022 11:02:50 -0800 From: "Oram, Isaac W" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone , Liming Gao , Eric Dong Subject: [edk2-devel][edk2-platforms][PATCH V1 1/8] MinPlatformPkg/AmlGenOffset: Update for python 3 Date: Mon, 7 Feb 2022 11:02:38 -0800 Message-Id: <661e68fa9ad9455333d989afb3171824d99f598e.1644259969.git.isaac.w.oram@intel.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Update for library changes. Remove version. Changed to not open files as bytes. Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Cc: Eric Dong Signed-off-by: Isaac Oram --- Platform/Intel/MinPlatformPkg/Tools/AmlGenOffset/AmlGenOffset.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Tools/AmlGenOffset/AmlGenOffset.py b/Platform/Intel/MinPlatformPkg/Tools/AmlGenOffset/AmlGenOffset.py index e13ca06471..4799eee1a9 100644 --- a/Platform/Intel/MinPlatformPkg/Tools/AmlGenOffset/AmlGenOffset.py +++ b/Platform/Intel/MinPlatformPkg/Tools/AmlGenOffset/AmlGenOffset.py @@ -32,16 +32,16 @@ if __name__ == '__main__': # # Create command line argument parser object # - parser = argparse.ArgumentParser(prog=__prog__, version=__version__, usage=__usage__, description=__copyright__, conflict_handler='resolve') + parser = argparse.ArgumentParser(prog=__prog__, usage=__usage__, description=__copyright__, conflict_handler='resolve') group = parser.add_mutually_exclusive_group(required=True) group.add_argument("-e", action="store_true", dest='Encode', help='encode file') group.add_argument("-d", action="store_true", dest='Decode', help='decode file') - parser.add_argument("-o", "--output", dest='OutputFile', type=str, metavar='filename', help="specify the output filename", required=True) + parser.add_argument("-o", "--output", dest='OutputFileName', type=str, metavar='filename', help="specify the output filename", required=True) parser.add_argument("-v", "--verbose", dest='Verbose', action="store_true", help="increase output messages") parser.add_argument("-q", "--quiet", dest='Quiet', action="store_true", help="reduce output messages") parser.add_argument("--debug", dest='Debug', type=int, metavar='[0-9]', choices=range(0,10), default=0, help="set debug level") parser.add_argument("--aml_filter", dest='AmlFilterStr', type=str, help="specify the AML filter.") - parser.add_argument(metavar="input_file", dest='InputFile', type=argparse.FileType('rb'), help="specify the input filename") + parser.add_argument(metavar="input_file", dest='InputFile', type=argparse.FileType('r'), help="specify the input filename") # # Parse command line arguments @@ -49,11 +49,11 @@ if __name__ == '__main__': args = parser.parse_args() if args.Encode: - print 'Unsupported' + print('Unsupported') if args.Decode: - args.OutputFileName = args.OutputFile - args.OutputFile = open(args.OutputFileName, 'wb') + args.OutputFileName = os.path.normpath(args.OutputFileName) + args.OutputFile = open(args.OutputFileName, 'w') AmlFilter = args.AmlFilterStr filter_pattern = '|'.join(AmlFilter.split(' ')) @@ -69,4 +69,3 @@ if __name__ == '__main__': if match_obj is not None: args.OutputFile.write(line) args.OutputFile.close() - -- 2.27.0.windows.1