public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Oram, Isaac W" <isaac.w.oram@intel.com>
To: devel@edk2.groups.io
Cc: Chasel Chiu <chasel.chiu@intel.com>,
	Nate DeSimone <nathaniel.l.desimone@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>,
	Eric Dong <eric.dong@intel.com>
Subject: [edk2-devel][edk2-platforms][PATCH V1 1/8] MinPlatformPkg/AmlGenOffset: Update for python 3
Date: Mon,  7 Feb 2022 11:02:38 -0800	[thread overview]
Message-ID: <661e68fa9ad9455333d989afb3171824d99f598e.1644259969.git.isaac.w.oram@intel.com> (raw)
In-Reply-To: <cover.1644259969.git.isaac.w.oram@intel.com>

Update for library changes.
Remove version.
Changed to not open files as bytes.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
---
 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


  reply	other threads:[~2022-02-07 19:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-07 19:02 [edk2-devel][edk2-platforms][PATCH V1 0/8] Whitley ACPI Tables Oram, Isaac W
2022-02-07 19:02 ` Oram, Isaac W [this message]
2022-02-09  3:20   ` [edk2-devel][edk2-platforms][PATCH V1 1/8] MinPlatformPkg/AmlGenOffset: Update for python 3 Nate DeSimone
2022-02-07 19:02 ` [edk2-devel][edk2-platforms][PATCH V1 2/8] WhitleyOpenBoardPkg/AcpiTables: Add ACPI Table definitions Oram, Isaac W
2022-02-09  3:20   ` Nate DeSimone
2022-02-07 19:02 ` [edk2-devel][edk2-platforms][PATCH V1 3/8] WhitleyOpenBoardPkg/AcpiTables: South Cluster ASL Oram, Isaac W
2022-02-09  3:21   ` Nate DeSimone
2022-02-07 19:02 ` [edk2-devel][edk2-platforms][PATCH V1 4/8] WhitleyOpenBoardPkg/AcpiTables10nm: Add Static ACPI tables Oram, Isaac W
2022-02-09  3:21   ` Nate DeSimone
2022-02-07 19:02 ` [edk2-devel][edk2-platforms][PATCH V1 5/8] WhitleyOpenBoardPkg/AcpiTables10nm: Add DSDT ACPI table Oram, Isaac W
2022-02-09  3:21   ` Nate DeSimone
2022-02-07 19:02 ` [edk2-devel][edk2-platforms][PATCH V1 6/8] WhitleyOpenBoardPkg/Build: Enable includable build options Oram, Isaac W
2022-02-09  3:21   ` Nate DeSimone
2022-02-07 19:02 ` [edk2-devel][edk2-platforms][PATCH V1 7/8] WhitleyOpenBoardPkg/WilsonCityRvp: Generate AML offset table Oram, Isaac W
2022-02-09  3:21   ` Nate DeSimone
2022-02-07 19:02 ` [edk2-devel][edk2-platforms][PATCH V1 8/8] WhitleyOpenBoardPkg/StaticSkuDataDxe: Add open source driver Oram, Isaac W
2022-02-09  3:20   ` Nate DeSimone

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=661e68fa9ad9455333d989afb3171824d99f598e.1644259969.git.isaac.w.oram@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox