From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 03D64D80D5A for ; Mon, 22 Apr 2024 06:12:57 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=5Zx5YGDEjdXjuFqSeESbvIv93UA3+/DARJ6ct+GkQyQ=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20240206; t=1713766376; v=1; b=qJWChRpeE6oGlCIe3c8YuXffgWa5UAFMmcNtBf3vl7Y/ZTjJMWonkzPhHJ+VwXIWbM+BVYDC 6P7FD5NdDNphmnMu2hXuPMMEGMQWWRbXjz6EIaElqbEHLSUBfgAFyI5op+eU2bcbziXd9EIcobY 1p1YeXZHqGk5K+vREP0O87hUu+3WkSUWQYZVVsvppYHeUOzrI9Opspc+V0RoiUMYgrmcTD10M6/ FJ63iLKUuLPR92/E439zZfeXvLgAWCXqTyb8Ws1L28YGqPbgGR9iIBJKNWK6zaxktNy/yGmYfRI LxNc3SjeWxun1kl/Tfk4hA76xCsLmARjix77Cvv3+nXPg== X-Received: by 127.0.0.2 with SMTP id vut8YY7687511xi9FvyHNo1k; Sun, 21 Apr 2024 23:12:56 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) by mx.groups.io with SMTP id smtpd.web10.12184.1713766375105142060 for ; Sun, 21 Apr 2024 23:12:55 -0700 X-CSE-ConnectionGUID: Q7P0c7CPShe8JTDCNuqn9A== X-CSE-MsgGUID: VC6SQJjmSryHZAQ9W3y1xA== X-IronPort-AV: E=McAfee;i="6600,9927,11051"; a="9406984" X-IronPort-AV: E=Sophos;i="6.07,219,1708416000"; d="scan'208";a="9406984" X-Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2024 23:12:54 -0700 X-CSE-ConnectionGUID: zveKmqbSTK+1z53cxTLc/g== X-CSE-MsgGUID: Kz4aRb6GS1SpR9QbOZMUDA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,219,1708416000"; d="scan'208";a="28687528" X-Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orviesa005.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 21 Apr 2024 23:12:54 -0700 X-Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 21 Apr 2024 23:12:54 -0700 X-Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 21 Apr 2024 23:12:53 -0700 X-Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Sun, 21 Apr 2024 23:12:53 -0700 X-Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.172) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Sun, 21 Apr 2024 23:12:53 -0700 X-Received: from DM4PR11MB5280.namprd11.prod.outlook.com (2603:10b6:5:38b::18) by PH7PR11MB6857.namprd11.prod.outlook.com (2603:10b6:510:1ed::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.20; Mon, 22 Apr 2024 06:12:51 +0000 X-Received: from DM4PR11MB5280.namprd11.prod.outlook.com ([fe80::e797:dd8d:b92b:41ee]) by DM4PR11MB5280.namprd11.prod.outlook.com ([fe80::e797:dd8d:b92b:41ee%7]) with mapi id 15.20.7519.018; Mon, 22 Apr 2024 06:12:50 +0000 From: "Ashraf Ali S" To: "Guo, Gua" , "devel@edk2.groups.io" CC: "Chiu, Chasel" , "Desimone, Nathaniel L" , "Duggapu, Chinni B" , "Zeng, Star" , "Kuo, Ted" , Susovan Mohapatra Subject: Re: [edk2-devel] [PATCH v1 1/2] IntelFsp2Pkg/GenCfgOpt.py: Python 3.12 support Thread-Topic: [PATCH v1 1/2] IntelFsp2Pkg/GenCfgOpt.py: Python 3.12 support Thread-Index: AQHalFWYpHUFJC3hJEycX100R8ibvrFzz3lg Date: Mon, 22 Apr 2024 06:12:50 +0000 Message-ID: References: <20240422013646.1769-1-gua.guo@intel.com> <20240422013646.1769-2-gua.guo@intel.com> In-Reply-To: <20240422013646.1769-2-gua.guo@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM4PR11MB5280:EE_|PH7PR11MB6857:EE_ x-ms-office365-filtering-correlation-id: 604c7b6d-f657-432c-dead-08dc62933d5f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: =?us-ascii?Q?GXMBMn7gXLaLO/x+Jb/53Ejd/tUYnEIIl048pq45YrzNrXN1Dw0e2hjl4Psx?= =?us-ascii?Q?JbyCkAEtA0Y8NZ48GoFB4OHN5+UqTLjowHGFglxT9d8L4PuGVrnHQ5b03qWP?= =?us-ascii?Q?yUgHxXduwgK2PptsMqa169Wbci2LqoLm6yfPUf/9DCBDqQ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O0qHo3GDIux2gCC3XBA1NilQqnLQZ4U02ckYHeiQO49ITo4e/njY?= =?us-ascii?Q?/5VGS6goYDv0V4jMHXXTraeRznNFqdLK1fEo5EKo/ZtwZmvasMC0RWGyeLIs?= =?us-ascii?Q?F2OrJ2fCXj/OYd1iVwYRknUWFpLfLNMHLPwOmkO0n0MwEy371OqF9bmz2CRk?= =?us-ascii?Q?wAHxJL65mt6vRTbqbj8UR5qgRT9B2lU9fk9qDjEOkqVGURth5FklGEP1BxAb?= =?us-ascii?Q?WHlpQFctwB7J/PT77AhMGnasvPWzLWTZtJACA6mLpl+sS8MoqZzgdHuieigf?= =?us-ascii?Q?MA0WUYplL/8U5ukGRV/5/JOfAm1aMKRJ0KVpahTsXmhhRA=3D=3D?= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?YGAcxNR2KaPNE0ch1UZ130CA4S5oRsOhh2iEpClV/ylhEZTrGrzfnWjtvmks?= =?us-ascii?Q?us+JaOs//8dPaN5UsCX27rNuFealXE/En1CR2NvPFyH5V93hw7Ng7QjOIlpH?= =?us-ascii?Q?i8OONSLMa4sDnOqbiGHzknMBbVm9fxl3yb8TFKxEC45Nhn5bc47SmIHzVl1G?= =?us-ascii?Q?KGd8OIDqjtJKQDJgJBlNhJDKuX7uqrh+tpedmN1NN+6G1BwP9Ny1mmL2Nkc6?= =?us-ascii?Q?daJ5VSgaeFVDD60OS+HRMhTLiBg3red11Qt+0CFQGP3dUORaE7Icp/n+Ermg?= =?us-ascii?Q?GS43WEKrcPQJ11G+cKt9cD8KGEVBS998VMV3KFQ9rEJUcaVFUa6sXJd5SmzC?= =?us-ascii?Q?iukb9k7e95u5qyMA+JpFfJiUXZXD5Y8VlKSi7a4TDkE4xZ3H/Oo+siO/1OJ6?= =?us-ascii?Q?Q4cu/sTZRzsv5qlQH1GurJHlYVeyDr64XSBh9e1UZHtdPn3hbAgkUf3PEXva?= =?us-ascii?Q?6y4kiR7uF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?us-ascii?Q?u0zckIQ1Xox+MnmejQx3v8jvIPvuH0wKLndl3+9mHWORAC2JRfw9zvQs0w7Z?= =?us-ascii?Q?SQ1vkMUNeU9Qphalh66XjrhtVsnHbpQixQPwysCzOfUkt1yMgSwBIRqRDcvF?= =?us-ascii?Q?sRDKUKXsRV09Ihbs5THYt9NYPYhxwafk0CWjd76HnfVdEip03DCTVimcPQO8?= =?us-ascii?Q?RBEIbc10Sne/pgMw9WB/H9g8Bn8u6n3XZ3/XY3gS?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5280.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 604c7b6d-f657-432c-dead-08dc62933d5f X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Apr 2024 06:12:50.9070 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 2TXyqQ/mpqDWHT9aNxxOjD1kv+iGhK/cNqkGsikWOKERsjmBBZ0eL7kRwcpoKvzdA/de8ggIXAMN0FniUnUY5Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB6857 X-OriginatorOrg: intel.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Sun, 21 Apr 2024 23:12:55 -0700 Resent-From: ashraf.ali.s@intel.com Reply-To: devel@edk2.groups.io,ashraf.ali.s@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: ZaWKeR8Rr0NE4vUnnJZaka97x7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=qJWChRpe; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none) Reviewed-by: S, Ashraf Ali Thanks., S, Ashraf Ali -----Original Message----- From: Guo, Gua =20 Sent: Monday, April 22, 2024 7:07 AM To: devel@edk2.groups.io Cc: Guo, Gua ; Chiu, Chasel ; Des= imone, Nathaniel L ; Duggapu, Chinni B ; Zeng, Star ; Kuo, Ted ; S, Ashraf Ali ; Susovan Mohapatra Subject: [PATCH v1 1/2] IntelFsp2Pkg/GenCfgOpt.py: Python 3.12 support From: Gua Guo Ref to https://docs.python.org/3/whatsnew/3.12.html A backslash-character pair that is not a valid escape sequence now generate= s Cc: Chasel Chiu Cc: Nate DeSimone Cc: Duggapu Chinni B Cc: Star Zeng Cc: Ted Kuo Cc: Ashraf Ali S Cc: Susovan Mohapatra Signed-off-by: Gua Guo --- IntelFsp2Pkg/Tools/GenCfgOpt.py | 96 ++++++++++++++++----------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/IntelFsp2Pkg/Tools/GenCfgOpt.py b/IntelFsp2Pkg/Tools/GenCfgOpt= .py index 13be81ddbc..79923c07ed 100644 --- a/IntelFsp2Pkg/Tools/GenCfgOpt.py +++ b/IntelFsp2Pkg/Tools/GenCfgOpt.py @@ -136,7 +136,7 @@ class CLogicalExpression: var =3D var.strip() if re.match('^0x[a-fA-F0-9]+$', var)= : value =3D int(var, 16)- elif re.match('^[+-]?\d+$', va= r):+ elif re.match(r'^[+-]?\d+$', var): value =3D int(va= r, 10) else: value =3D None@@ -147,7 +147,7 @@ class CL= ogicalExpression: var =3D '' while not self.isLast(): char =3D s= elf.getCurr()- if re.match('^[\w.]', char):+ if re.ma= tch(r'^[\w.]', char): var +=3D char self.mo= veNext() else:@@ -161,7 +161,7 @@ class CLogicalExpression: def parseSingleOp(self): self.skipSpace()- if re.match= ('^NOT\W', self.getCurr(-1)):+ if re.match(r'^NOT\W', self.getCurr(-= 1)): self.moveNext(3) op =3D self.parseBrace() = val =3D self.getNumber (op)@@ -225,7 +225,7 @@ class CLogicalExpre= ssion: value =3D self.parseCompare() while True: self= .skipSpace()- if re.match('^AND\W', self.getCurr(-1)):+ = if re.match(r'^AND\W', self.getCurr(-1)): self.moveNext(= 3) result =3D self.parseCompare() test =3D = self.getNonNumber(result, value)@@ -243,10 +243,10 @@ class CLogicalExpress= ion: while True: self.skipSpace() op =3D None- = if re.match('^XOR\W', self.getCurr(-1)):+ if re.match= (r'^XOR\W', self.getCurr(-1)): self.moveNext(3) = op =3D '^'- elif re.match('^OR\W', self.getCurr(-1)):+ = elif re.match(r'^OR\W', self.getCurr(-1)): self.move= Next(2) op =3D '|' else:@@ -330,11 +330,11 @@ E= ndList continue if IsExpression: = IsExpression =3D False- Match =3D re.match("(\w+)=3D(.+)", M= acro)+ Match =3D re.match(r"(\w+)=3D(.+)", Macro) = if Match: self._MacroDict[Match.group(1)] =3D Mat= ch.group(2) else:- Match =3D re.match("(= \w+)", Macro)+ Match =3D re.match(r"(\w+)", Macro) = if Match: self._MacroDict[Match.grou= p(1)] =3D '' if len(self._MacroDict) =3D=3D 0:@@ -355,7 +355,7 @@ E= ndList def ExpandMacros (self, Input, Preserve =3D False): Line =3D = Input- Match =3D re.findall("\$\(\w+\)", Input)+ Match =3D re= .findall(r"\$\(\w+\)", Input) if Match: for Each in Mat= ch: Variable =3D Each[2:-1]@@ -370,7 +370,7 @@ EndList def ExpandPcds (self, Input): Line =3D Input- Match = =3D re.findall("(\w+\.\w+)", Input)+ Match =3D re.findall(r"(\w+\.\w= +)", Input) if Match: for PcdName in Match: = if PcdName in self._PcdsDict:@@ -390,7 +390,7 @@ EndList return Result def ValueToByteArray (self, ValueStr, Length):-= Match =3D re.match("\{\s*FILE:(.+)\}", ValueStr)+ Match =3D = re.match(r"\{\s*FILE:(.+)\}", ValueStr) if Match: FileLis= t =3D Match.group(1).split(',') Result =3D bytearray()@@ -427,7 = +427,7 @@ EndList if Each[0] in ['"', "'"]: Resu= lt.extend(list(bytearray(Each[1:-1], 'utf-8'))) elif ':= ' in Each:- Match =3D re.match("(.+):(\d+)b", Eac= h)+ Match =3D re.match(r"(.+):(\d+)b", Each) = if Match is None: raise Exc= eption("Invald value list format '%s' !" % Each) In= BitField =3D True@@ -539,7 +539,7 @@ EndList continue Handle =3D False- Match = =3D re.match("^\[(.+)\]", DscLine)+ Match =3D re.match(r"^\= [(.+)\]", DscLine) if Match is not None: IsDefS= ect =3D False IsPcdSect =3D False@@ -575,7 +575,7 @@ EndLis= t Match =3D False if DscLine[0] !=3D '!' else True = if Match:- Match =3D re.match("^!(el= se|endif|ifdef|ifndef|if|elseif|include)\s*(.+)?$", DscLine.split("#")[0])+= Match =3D re.match(r"^!(else|endif|ifdef|ifndef|if|= elseif|include)\s*(.+)?$", DscLine.split("#")[0]) Keywo= rd =3D Match.group(1) if Match else '' Remaining =3D = Match.group(2) if Match else '' Remaining =3D '' if Rem= aining is None else Remaining.strip()@@ -620,7 +620,7 @@ EndList else: Handle =3D True = if Handle:- Match =3D re= .match("!include\s+(.+)", DscLine)+ Match =3D re= .match(r"!include\s+(.+)", DscLine) if Match: = IncludeFilePath =3D Match.group(1) = IncludeFilePath =3D self.ExpandMacros(IncludeFilePat= h)@@ -660,7 +660,7 @@ EndList #DEFINE FSP_T_UPD_TOOL_GUID =3D 34686CA3-34F9-4901-B82A-BA= 630F0714C6 #DEFINE FSP_M_UPD_TOOL_GUID =3D 39A250DB-E465-4D= D1-A2AC-E2BD3C0E2385 #DEFINE FSP_S_UPD_TOOL_GUID =3D CAE360= 5B-5B34-4C85-B3D7-27D54273C40F- Match =3D re.match("^\s*(?:D= EFINE\s+)*(\w+)\s*=3D\s*(.+)", DscLine)+ Match =3D re.match(= r"^\s*(?:DEFINE\s+)*(\w+)\s*=3D\s*(.+)", DscLine) if Match:= self._MacroDict[Match.group(1)] =3D self.ExpandMacros(= Match.group(2)) if self.Debug:@@ -668,21 +668,21 @@ End= List elif IsPcdSect: #gSiPkgTokenSpaceGuid.PcdTxtEn= able|FALSE #gSiPkgTokenSpaceGuid.PcdOverclockEnable|TRUE- = Match =3D re.match("^\s*([\w\.]+)\s*\|\s*(\w+)", DscLine)+ = Match =3D re.match(r"^\s*([\w\.]+)\s*\|\s*(\w+)", DscLine) = if Match: self._PcdsDict[Match.group(1)] = =3D Match.group(2) if self.Debug: = print ("INFO : PCD %s =3D [ %s ]" % (Match.group(1), Match.group(2))) = i =3D 0 while i < len(BuildOptionPcd)= :- Match =3D re.match("\s*([\w\.]+)\s*\=3D\s*(\w+)",= BuildOptionPcd[i])+ Match =3D re.match(r"\s*([\w\.]= +)\s*\=3D\s*(\w+)", BuildOptionPcd[i]) if Match: = self._PcdsDict[Match.group(1)] =3D Match.group(2)= i +=3D 1 elif IsTmpSect: = # !BSF DEFT:{GPIO_TMPL:START}- Match =3D re.match("^\s*#= \s+(!BSF)\s+DEFT:{(.+?):(START|END)}", DscLine)+ Match =3D r= e.match(r"^\s*#\s+(!BSF)\s+DEFT:{(.+?):(START|END)}", DscLine) = if Match: if Match.group(3) =3D=3D 'START' and not = TemplateName: TemplateName =3D Match.group(2).strip= ()@@ -691,33 +691,33 @@ EndList TemplateName =3D '' else: = if TemplateName:- Match =3D re.match("^!= include\s*(.+)?$", DscLine)+ Match =3D re.match(r"^!= include\s*(.+)?$", DscLine) if Match: = continue self._BsfTempDict[TemplateN= ame].append(DscLine) else:- Match =3D re.match(= "^\s*#\s+(!BSF|@Bsf|!HDR)\s+(.+)", DscLine)+ Match =3D re.ma= tch(r"^\s*#\s+(!BSF|@Bsf|!HDR)\s+(.+)", DscLine) if Match: = Remaining =3D Match.group(2) if Mat= ch.group(1) =3D=3D '!BSF' or Match.group(1) =3D=3D '@Bsf':- = Match =3D re.match("(?:^|.+\s+)PAGES:{(.+?)}", Remaining)+ = Match =3D re.match(r"(?:^|.+\s+)PAGES:{(.+?)}", Remaining) = if Match: # !BSF PAGES:{= HSW:"Haswell System Agent", LPT:"Lynx Point PCH"} = PageList =3D Match.group(1).split(',') for P= age in PageList: Page =3D Page.strip()- = Match =3D re.match("(\w+):\"(.+)\"", Page)+ = Match =3D re.match(r"(\w+):\"(.+)\"", Page) = if Match !=3D None: = self._CfgPageDict[Match.group(1)] =3D Match.group(2) - = Match =3D re.match("(?:^|.+\s+)BLOCK:{NAME:\"(.+)\"\s*,\s*VER= :\"(.+)\"\s*}", Remaining)+ Match =3D re.match(r"(?:= ^|.+\s+)BLOCK:{NAME:\"(.+)\"\s*,\s*VER:\"(.+)\"\s*}", Remaining) = if Match: self._CfgBlkDict['name'= ] =3D Match.group(1) self._CfgBlkDict['ver'] = =3D Match.group(2) for Key in self._BsfKeyList:- = Match =3D re.match("(?:^|.+\s+)%s:{(.+?)}" % Key,= Remaining)+ Match =3D re.match(r"(?:^|.+\s+)%s:= {(.+?)}" % Key, Remaining) if Match: = if Key in ['NAME', 'HELP', 'OPTION'] and Match.group(= 1).startswith('+'): ConfigDict[Key.lowe= r()] +=3D Match.group(1)[1:]@@ -725,15 +725,15 @@ EndList ConfigDict[Key.lower()] =3D Match.gro= up(1) else: for Key in self._Hd= rKeyList:- Match =3D re.match("(?:^|.+\s+)%s:{(.= +?)}" % Key, Remaining)+ Match =3D re.match(r"(?= :^|.+\s+)%s:{(.+?)}" % Key, Remaining) if Match= : ConfigDict[Key.lower()] =3D Match.group(= 1) - Match =3D re.match("^\s*#\s+@Prompt\s+(.+)", DscLine)+ = Match =3D re.match(r"^\s*#\s+@Prompt\s+(.+)", DscLine) = if Match: ConfigDict['name'] =3D Match.group= (1) - Match =3D re.match("^\s*#\s*@ValidList\s*(.+)\s*\|\s*(= .+)\s*\|\s*(.+)\s*", DscLine)+ Match =3D re.match(r"^\s*#\s*= @ValidList\s*(.+)\s*\|\s*(.+)\s*\|\s*(.+)\s*", DscLine) if = Match: if Match.group(2).strip() in self._BuidinOption:= ConfigDict['option'] =3D Match.group(2).strip()@@ = -749,22 +749,22 @@ EndList ConfigDict['option'] +=3D ', ' = ConfigDict['type'] =3D "Combo" - Match =3D re.matc= h("^\s*#\s*@ValidRange\s*(.+)\s*\|\s*(.+)\s*-\s*(.+)\s*", DscLine)+ = Match =3D re.match(r"^\s*#\s*@ValidRange\s*(.+)\s*\|\s*(.+)\s*-\s*(= .+)\s*", DscLine) if Match: if "0x" in = Match.group(2) or "0x" in Match.group(3): ConfigDic= t['type'] =3D "EditNum, HEX, (%s,%s)" % (Match.group(2), Match.group(3)) = else: ConfigDict['type'] =3D "Edi= tNum, DEC, (%s,%s)" % (Match.group(2), Match.group(3)) - Mat= ch =3D re.match("^\s*##\s+(.+)", DscLine)+ Match =3D re.matc= h(r"^\s*##\s+(.+)", DscLine) if Match: = ConfigDict['help'] =3D Match.group(1) # Check VPD/UPD = if IsUpdSect:- Match =3D re.match("^([_a-zA-= Z0-9]+).([_a-zA-Z0-9]+)\s*\|\s*(0x[0-9A-F]+|\*)\s*\|\s*(\d+|0x[0-9a-fA-F]+)= \s*\|\s*(.+)",DscLine)+ Match =3D re.match(r"^([_a-zA-Z0= -9]+).([_a-zA-Z0-9]+)\s*\|\s*(0x[0-9A-F]+|\*)\s*\|\s*(\d+|0x[0-9a-fA-F]+)\s= *\|\s*(.+)",DscLine) else:- Match =3D re= .match("^([_a-zA-Z0-9]+).([_a-zA-Z0-9]+)\s*\|\s*(0x[0-9A-F]+)(?:\s*\|\s*(.+= ))?", DscLine)+ Match =3D re.match(r"^([_a-zA-Z0-9]+).(= [_a-zA-Z0-9]+)\s*\|\s*(0x[0-9A-F]+)(?:\s*\|\s*(.+))?", DscLine) = if Match: ConfigDict['space'] =3D Match.group(1)= ConfigDict['cname'] =3D Match.group(2)@@ -796,13 +796= ,13 @@ EndList Value =3D '' Value =3D= Value.strip() if '|' in Value:- = Match =3D re.match("^.+\s*\|\s*(.+)", Value)+ = Match =3D re.match(r"^.+\s*\|\s*(.+)", Value) = if Match: Value =3D Match.group(1) = Length =3D -1 ConfigDict['length= '] =3D Length- Match =3D re.match("\$\((\w+)\)", Value)+= Match =3D re.match(r"\$\((\w+)\)", Value) = if Match: if Match.group(1) in self._MacroDi= ct: Value =3D self._MacroDict[Match.group(1)]@@= -879,7 +879,7 @@ EndList # !BSF FIELD:{SerialDebugPortAddress0:1} = # or # @Bsf FIELD:{SerialDebugPortAddress0:1b}- = Match =3D re.match("^\s*#\s+(!BSF|@Bsf)\s+FIELD:{(.+):(\= d+)([Bb])?}", DscLine)+ Match =3D re.match(r"^\s*#\s+(!B= SF|@Bsf)\s+FIELD:{(.+):(\d+)([Bb])?}", DscLine) if Matc= h: SubCfgDict =3D ConfigDict.copy() = if (Match.group(4) =3D=3D None) or (Match.group(4) =3D=3D 'B'):@@ = -1023,7 +1023,7 @@ EndList self._VarDict['_LENGTH_'] =3D '%d' % (Item['offset'] + Item['l= ength']) for Item in self._CfgItemList: Embed =3D Item[= 'embed']- Match =3D re.match("^(\w+):(\w+):(START|END)", Embed)+= Match =3D re.match(r"^(\w+):(\w+):(START|END)", Embed) = if Match: StructName =3D Match.group(1) = VarName =3D '_%s_%s_' % (Match.group(3), StructName)@@ -1215,7 +1215,7 @@ = EndList IsUpdHeader =3D False for Line in TextBody: Spl= itToLines =3D Line.splitlines()- MatchComment =3D re.match("^/\*\= sCOMMENT:(\w+):([\w|\W|\s]+)\s\*/\s([\s\S]*)", SplitToLines[0])+ = MatchComment =3D re.match(r"^/\*\sCOMMENT:(\w+):([\w|\W|\s]+)\s\*/\s([\s\S]= *)", SplitToLines[0]) if MatchComment: if MatchCom= ment.group(1) =3D=3D 'FSP_UPD_HEADER': IsUpdHeader =3D Tr= ue@@ -1226,7 +1226,7 @@ EndList NewTextBody.append("/**" + CommentLine + "**/\n") = Line =3D Line[(len(SplitToLines[0]) + 1):] - Match =3D re.m= atch("^/\*\sEMBED_STRUCT:(\w+):(\w+):(START|END)\s\*/\s([\s\S]*)", Line)+ = Match =3D re.match(r"^/\*\sEMBED_STRUCT:(\w+):(\w+):(START|END)\s\= */\s([\s\S]*)", Line) if Match: Line =3D Match.gr= oup(4) if Match.group(1) =3D=3D 'FSP_UPD_HEADER':@@ -1239,7 = +1239,7 @@ EndList NewTextBody.append ('typedef struct {\n') = StructName =3D Match.group(1) VariableName =3D Match.gro= up(2)- MatchOffset =3D re.search('/\*\*\sOffset\s0x([a-fA-F0-= 9]+)', Line)+ MatchOffset =3D re.search(r'/\*\*\sOffset\s0x([= a-fA-F0-9]+)', Line) if MatchOffset: Offs= et =3D int(MatchOffset.group(1), 16) else:@@ -1318,12 +1318,= 12 @@ EndList CommentLine =3D "" for Item in self._CfgIt= emList: if Item["comment"] !=3D '' and Item["offset"] >= =3D UpdOffsetTable[UpdIdx]:- MatchComment =3D re.mat= ch("^(U|V)PD_DATA_REGION:([\w|\W|\s]+)", Item["comment"])+ = MatchComment =3D re.match(r"^(U|V)PD_DATA_REGION:([\w|\W|\s]+)", Ite= m["comment"]) if MatchComment and MatchComment.grou= p(1) =3D=3D Region[0]: CommentLine =3D " " + Ma= tchComment.group(2) + "\n" TxtBody.append("/**"= + CommentLine + "**/\n") elif Item["offset"] >=3D UpdO= ffsetTable[UpdIdx] and Item["comment"] =3D=3D '':- M= atch =3D re.match("^FSP([\w|\W|\s])_UPD", UpdStructure[UpdIdx])+ = Match =3D re.match(r"^FSP([\w|\W|\s])_UPD", UpdStructure[UpdId= x]) if Match: TxtBody.a= ppend("/** Fsp " + Match.group(1) + " UPD Configuration\n**/\n") = TxtBody.append("typedef struct {\n")@@ -1441,7 +1441,7 @@ EndList Export =3D False for Line in IncLines:- = Match =3D re.search ("!EXPORT\s+([A-Z]+)\s+EXTERNAL_BOOTLOADER_STRUCT= _(BEGIN|END)\s+", Line)+ Match =3D re.search (r"!EXPORT\s+([= A-Z]+)\s+EXTERNAL_BOOTLOADER_STRUCT_(BEGIN|END)\s+", Line) = if Match: if Match.group(2) =3D=3D "BEGIN" and Match.gr= oup(1) =3D=3D UpdRegionCheck[item]: Export =3D True= @@ -1464,7 +1464,7 @@ EndList Match =3D re.match("(typedef struct {)", Line) = if Match: StartIndex =3D Index - 1- = Match =3D re.match("}\s([_A-Z0-9]+);", Line)+ Match =3D re.= match(r"}\s([_A-Z0-9]+);", Line) if Match and (UpdRegionChe= ck[item] in Match.group(1) or UpdConfigCheck[item] in Match.group(1)) and (= ExcludedSpecificUpd[item] not in Match.group(1)) and (ExcludedSpecificUpd1[= item] not in Match.group(1)): EndIndex =3D Index = StructStart.append(StartIndex)@@ -1474,7 +1474,7 @@ EndList Index +=3D 1 for Item in range(len(StructS= tart)): if Index =3D=3D StructStart[Item]:- = Match =3D re.match("^(/\*\*\s*)", Line)+ = Match =3D re.match(r"^(/\*\*\s*)", Line) if Match:= StructStartWithComment.append(StructStart[Item= ]) else:@@ -1510,7 +1510,7 @@ EndList Match =3D re.match("(typedef struct {)", Line) = if Match: StartIndex =3D Index - 1- = Match =3D re.match("#define\s([_A-Z0-9]+)\s*", Line)+ Match= =3D re.match(r"#define\s([_A-Z0-9]+)\s*", Line) if Match a= nd (UpdSignatureCheck[item] in Match.group(1) or UpdSignatureCheck[item] in= Match.group(1)): StructStart.append(Index - 1) = StructEnd.append(Index)@@ -1519,7 +1519,7 @@ EndList Index +=3D 1 for Item in range(len(StructS= tart)): if Index =3D=3D StructStart[Item]:- = Match =3D re.match("^(/\*\*\s*)", Line)+ = Match =3D re.match(r"^(/\*\*\s*)", Line) if Match:= StructStartWithComment.append(StructStart[Item= ]) else:@@ -1543,7 +1543,7 @@ EndList else: Space =3D Item['space'] Line =3D " $%= s_%s" % (Space, Item['cname'])- Match =3D re.match("\s*\{([x0-9a-fA-= F,\s]+)\}\s*", Item['value'])+ Match =3D re.match(r"\s*\{([x0-9a-fA-= F,\s]+)\}\s*", Item['value']) if Match: DefaultValue = =3D Match.group(1).strip() else:@@ -1576,7 +1576,7 @@ EndList BsfFd.write(' %s $%s, "%s", &%s,\n' % (Item['type'], PcdNam= e, Item['name'], Options)) WriteHelp =3D 1 elif Item['t= ype'].startswith("EditNum"):- Match =3D re.match("EditNum\s*,\s*= (HEX|DEC)\s*,\s*\((\d+|0x[0-9A-Fa-f]+)\s*,\s*(\d+|0x[0-9A-Fa-f]+)\)", Item[= 'type'])+ Match =3D re.match(r"EditNum\s*,\s*(HEX|DEC)\s*,\s*\((= \d+|0x[0-9A-Fa-f]+)\s*,\s*(\d+|0x[0-9A-Fa-f]+)\)", Item['type']) = if Match: BsfFd.write(' EditNum $%s, "%s", %s,\n' % (P= cdName, Item['name'], Match.group(1))) WriteHelp =3D 2--=20 2.39.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118066): https://edk2.groups.io/g/devel/message/118066 Mute This Topic: https://groups.io/mt/105662400/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-