From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 CFF6521BADAB2 for ; Tue, 14 Aug 2018 07:58:35 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Aug 2018 07:58:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,238,1531810800"; d="scan'208";a="83296530" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga002.jf.intel.com with ESMTP; 14 Aug 2018 07:58:11 -0700 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 14 Aug 2018 07:58:05 -0700 Received: from fmsmsx103.amr.corp.intel.com ([169.254.2.126]) by fmsmsx158.amr.corp.intel.com ([169.254.15.57]) with mapi id 14.03.0319.002; Tue, 14 Aug 2018 07:58:05 -0700 From: "Carsey, Jaben" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" CC: "Gao, Liming" Thread-Topic: [Patch V2] BaseTools: Clean up not used code in BuildClassObject Thread-Index: AQHUMt1Swvc3CSrbdEyGwQDmKh+19qS/WCxg Date: Tue, 14 Aug 2018 14:58:04 +0000 Message-ID: References: <1534147908-12300-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1534147908-12300-1-git-send-email-yonghong.zhu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZTliMjZkODEtMGZlMC00YjNiLTgzNzgtNDA4ZTI4Y2VjMWFjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiQklaZE4zQ2YyUTV1enpWWFFnRWd1XC9cL08wTm44WE56U0o0N0Z4c2lyK2g3N2FpYXdIMVlGVERLblJoU1VJZDR6In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.1.200.108] MIME-Version: 1.0 Subject: Re: [Patch V2] BaseTools: Clean up not used code in BuildClassObject X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Aug 2018 14:58:36 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I believe that we should try to move more towards specific imports rather t= han import * or entire modules. I would therefore prefer we do the Ordered= Dict change in the other direction and remove the collections.OrderedDict i= tems. That being said, opinions... The code is still better with this chan= ge. Reviewed-by: Jaben Carsey > -----Original Message----- > From: Zhu, Yonghong > Sent: Monday, August 13, 2018 1:12 AM > To: edk2-devel@lists.01.org > Cc: Gao, Liming ; Carsey, Jaben > > Subject: [Patch V2] BaseTools: Clean up not used code in BuildClassObject > Importance: High >=20 > V2: Add back "from Common.DataType import *" >=20 > 1. Remove some import statement that are not used. > 2. Remove the Type value in the LibraryClassObject because we don't > actually use it. >=20 > Cc: Liming Gao > Cc: Jaben Carsey > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Yonghong Zhu > --- > BaseTools/Source/Python/Workspace/BuildClassObject.py | 13 ++----------- > 1 file changed, 2 insertions(+), 11 deletions(-) >=20 > diff --git a/BaseTools/Source/Python/Workspace/BuildClassObject.py > b/BaseTools/Source/Python/Workspace/BuildClassObject.py > index 3b47715..88465c5 100644 > --- a/BaseTools/Source/Python/Workspace/BuildClassObject.py > +++ b/BaseTools/Source/Python/Workspace/BuildClassObject.py > @@ -9,15 +9,10 @@ > # > # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" > BASIS, > # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER > EXPRESS OR IMPLIED. > # >=20 > -import Common.LongFilePathOs as os > - > -from collections import OrderedDict > -from Common.Misc import RealPath2 > -from Common.BuildToolError import * > from Common.DataType import * > import collections >=20 > ## PcdClassObject > # > @@ -251,22 +246,18 @@ class StructurePcd(PcdClassObject): > # This Class defines LibraryClassObject used in BuildDatabase > # > # @param object: Inherited from object class > # @param Name: Input value for LibraryClassName, default is None > # @param SupModList: Input value for SupModList, default is [] > -# @param Type: Input value for Type, default is None > # > # @var LibraryClass: To store value for LibraryClass > # @var SupModList: To store value for SupModList > -# @var Type: To store value for Type > # > class LibraryClassObject(object): > - def __init__(self, Name =3D None, SupModList =3D [], Type =3D None): > + def __init__(self, Name =3D None, SupModList =3D []): > self.LibraryClass =3D Name > self.SupModList =3D SupModList > - if Type is not None: > - self.SupModList =3D > CleanString(Type).split(DataType.TAB_SPACE_SPLIT) >=20 > ## ModuleBuildClassObject > # > # This Class defines ModuleBuildClass > # > @@ -330,11 +321,11 @@ class ModuleBuildClassObject(object): > self.ConstructorList =3D [] > self.DestructorList =3D [] >=20 > self.Binaries =3D [] > self.Sources =3D [] > - self.LibraryClasses =3D OrderedDict() > + self.LibraryClasses =3D collections.OrderedDict() > self.Libraries =3D [] > self.Protocols =3D [] > self.Ppis =3D [] > self.Guids =3D [] > self.Includes =3D [] > -- > 2.6.1.windows.1