From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id AF1AD20886F26 for ; Thu, 14 Feb 2019 06:30:39 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Feb 2019 06:30:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,369,1544515200"; d="scan'208";a="138604887" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga001.jf.intel.com with ESMTP; 14 Feb 2019 06:30:37 -0800 Received: from fmsmsx119.amr.corp.intel.com (10.18.124.207) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 14 Feb 2019 06:30:37 -0800 Received: from shsmsx153.ccr.corp.intel.com (10.239.6.53) by FMSMSX119.amr.corp.intel.com (10.18.124.207) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 14 Feb 2019 06:30:36 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.102]) by SHSMSX153.ccr.corp.intel.com ([169.254.12.190]) with mapi id 14.03.0415.000; Thu, 14 Feb 2019 22:30:34 +0800 From: "Gao, Liming" To: "Feng, Bob C" , "edk2-devel@lists.01.org" CC: "Chen, Hess" Thread-Topic: [Patch] BaseTools: Correct the error message for UPT Thread-Index: AQHUupezhtsYXtJW2EyOSXdEaLlsi6XfbnXA Date: Thu, 14 Feb 2019 14:30:34 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E3DEBAB@SHSMSX104.ccr.corp.intel.com> References: <20190202013608.6060-1-bob.c.feng@intel.com> In-Reply-To: <20190202013608.6060-1-bob.c.feng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTk0MWY5NGMtZjVkOS00YWY0LWFlZGMtOGFlMWJmYTM2MDg0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZVUyd01wbWJ2aWFncnJTd3hlWmJUVDdCVjhJd3F2azc5bjRHUklZWFVcLzZSb3loalRwZ2gxY0JYdWhXUXNcL2dwIn0= dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] BaseTools: Correct the error message for UPT X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Feb 2019 14:30:39 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao > -----Original Message----- > From: Feng, Bob C > Sent: Saturday, February 2, 2019 9:36 AM > To: edk2-devel@lists.01.org > Cc: Chen, Hess ; Gao, Liming > Subject: [Patch] BaseTools: Correct the error message for UPT >=20 > This patch is going to correct the error message > for UPT. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Hess Chen > Cc: Liming Gao > --- > .../Python/UPT/Library/UniClassObject.py | 18 ++++++++++-------- > 1 file changed, 10 insertions(+), 8 deletions(-) >=20 > diff --git a/BaseTools/Source/Python/UPT/Library/UniClassObject.py b/Base= Tools/Source/Python/UPT/Library/UniClassObject.py > index cd575d5a34..7a056b349f 100644 > --- a/BaseTools/Source/Python/UPT/Library/UniClassObject.py > +++ b/BaseTools/Source/Python/UPT/Library/UniClassObject.py > @@ -1,9 +1,9 @@ > ## @file > # Collect all defined strings in multiple uni files. > # > -# Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
> +# Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.
> # > # This program and the accompanying materials are licensed and made avai= lable > # under the terms and conditions of the BSD License which accompanies th= is > # distribution. The full text of the license may be found at > # http://opensource.org/licenses/bsd-license.php > @@ -593,10 +593,19 @@ class UniFileClassObject(object): > StringEntryExistsFlag =3D 1 > if not Line.endswith('"'): > EdkLogger.Error("Unicode File Parser", ToolError.FOR= MAT_INVALID, > ExtraData=3D'''The line %s misses '"= ' at the end of it in file %s''' > % (LineCount, File.Path)) > + > + # > + # Check the situation that there has more than 2 '"' for= the language entry > + # > + if Line.strip() and Line.replace(u'\\"', '').count(u'"')= > 2: > + EdkLogger.Error("Unicode File Parser", ToolError.FOR= MAT_INVALID, > + ExtraData=3D'''The line %s has more = than 2 '"' for language entry in file %s''' > + % (LineCount, File.Path)) > + > elif Line.startswith(u'#language'): > if StringEntryExistsFlag =3D=3D 2: > EdkLogger.Error("Unicode File Parser", ToolError.FOR= MAT_INVALID, > Message=3DST.ERR_UNI_MISS_STRING_ENT= RY % Line, ExtraData=3DFile.Path) > StringEntryExistsFlag =3D 0 > @@ -741,17 +750,10 @@ class UniFileClassObject(object): > NewLines.append((Line[:Line.find(u'"')]).strip()) > NewLines.append((Line[Line.find(u'"'):]).strip()) > else: > EdkLogger.Error("Unicode File Parser", ToolError.FOR= MAT_INVALID, ExtraData=3DFile.Path) > elif Line.startswith(u'"'): > - # > - # Check the situation that there has more than 2 '"' for= the language entry > - # > - if Line.replace(u'\\"', '').count(u'"') > 2: > - EdkLogger.Error("Unicode File Parser", ToolError.FOR= MAT_INVALID, > - ExtraData=3D'''The line %s has more = than 2 '"' for language entry in file %s''' > - % (LineCount, File.Path)) > if u'#string' in Line or u'#language' in Line: > EdkLogger.Error("Unicode File Parser", ToolError.FOR= MAT_INVALID, ExtraData=3DFile.Path) > NewLines.append(Line) > else: > print(Line) > -- > 2.19.1.windows.1