From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web11.7796.1581046106741823364 for ; Thu, 06 Feb 2020 19:28:26 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: bob.c.feng@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Feb 2020 19:28:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,411,1574150400"; d="scan'208";a="225245091" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga008.jf.intel.com with ESMTP; 06 Feb 2020 19:28:25 -0800 Received: from shsmsx605.ccr.corp.intel.com (10.109.6.215) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 6 Feb 2020 19:28:25 -0800 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX605.ccr.corp.intel.com (10.109.6.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 7 Feb 2020 11:28:23 +0800 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.1713.004; Fri, 7 Feb 2020 11:28:23 +0800 From: "Bob Feng" To: "Kinney, Michael D" , "devel@edk2.groups.io" CC: Sean Brogan , "Gao, Liming" Subject: Re: [Patch 4/4] BaseTools/WindowsVsToolChain: Clean up Python source formatting Thread-Topic: [Patch 4/4] BaseTools/WindowsVsToolChain: Clean up Python source formatting Thread-Index: AQHV3UIyDBYt45otwEWNr0uQKhlty6gPErXg Date: Fri, 7 Feb 2020 03:28:23 +0000 Message-ID: References: <20200206230715.15564-1-michael.d.kinney@intel.com> <20200206230715.15564-5-michael.d.kinney@intel.com> In-Reply-To: <20200206230715.15564-5-michael.d.kinney@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.36] MIME-Version: 1.0 Return-Path: bob.c.feng@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Bob Feng -----Original Message----- From: Kinney, Michael D=20 Sent: Friday, February 7, 2020 7:07 AM To: devel@edk2.groups.io Cc: Sean Brogan ; Feng, Bob C ; Gao, Liming Subject: [Patch 4/4] BaseTools/WindowsVsToolChain: Clean up Python source f= ormatting From: Sean Brogan https://bugzilla.tianocore.org/show_bug.cgi?id=3D2495 Cc: Sean Brogan Cc: Bob Feng Cc: Liming Gao Signed-off-by: Michael D Kinney --- .../WindowsVsToolChain/WindowsVsToolChain.py | 45 +++++++++++-------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py b/Ba= seTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py index e3c4cc94a3..c9279e1c75 100644 --- a/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py +++ b/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py @@ -1,4 +1,4 @@ -## @file WindowsVsToolChain.py +# @file WindowsVsToolChain.py # Plugin to configures paths for the VS2017 and VS2019 tool chain ## # T= his plugin works in conjuncture with the tools_def @@ -14,6 +14,7 @@ from e= dk2toollib.windows.locate_tools import FindWithVsWhere from edk2toolext.en= vironment import shell_environment from edk2toolext.environment import ver= sion_aggregator =20 + class WindowsVsToolChain(IUefiBuildPlugin): =20 def do_post_build(self, thebuilder): @@ -28,9 +29,9 @@ class WindowsVsToolChain(IUefiBuildPlugin): # # VS2017 - Follow VS2017 where there is potential for many version= s of the tools. # If a specific version is required then the user must set both en= v variables: - ## VS150INSTALLPATH: base install path on system to VC install di= r. Here you will find the VC folder, etc - ## VS150TOOLVER: version number for the VC compiler tools - ## VS2017_PREFIX: path to MSVC compiler folder with trailing s= lash (can be used instead of two vars above) + # VS150INSTALLPATH: base install path on system to VC install dir= . Here you will find the VC folder, etc + # VS150TOOLVER: version number for the VC compiler tools + # VS2017_PREFIX: path to MSVC compiler folder with trailing sl= ash (can be used instead of two vars above) if thebuilder.env.GetValue("TOOL_CHAIN_TAG") =3D=3D "VS2017": =20 # check to see if full path already configured @@ -38,11 +39,1= 3 @@ class WindowsVsToolChain(IUefiBuildPlugin): self.Logger.info("VS2017_PREFIX is already set.") =20 else: - install_path =3D self._get_vs_install_path("VS2017".lower(= ), "VS150INSTALLPATH") + install_path =3D self._get_vs_install_path( + "VS2017".lower(), "VS150INSTALLPATH") vc_ver =3D self._get_vc_version(install_path, "VS150TOOLVE= R") =20 if install_path is None or vc_ver is None: - self.Logger.error("Failed to configure environment for= VS2017") + self.Logger.error( + "Failed to configure environment for VS2017") return -1 =20 version_aggregator.GetVersionAggregator().ReportVersion( @@ -50,8 +53,9 @@ class WindowsVsToolChain(IUefiBuildPlugin): version_aggregator.GetVersionAggregator().ReportVersion( "VC Version", vc_ver, version_aggregator.VersionTypes.= TOOL) =20 - #make VS2017_PREFIX to align with tools_def.txt - prefix =3D os.path.join(install_path, "VC", "Tools", "MSVC= ", vc_ver) + # make VS2017_PREFIX to align with tools_def.txt + prefix =3D os.path.join(install_path, "VC", + "Tools", "MSVC", vc_ver) prefix =3D prefix + os.path.sep shell_environment.GetEnvironment().set_shell_var("VS2017_P= REFIX", prefix) =20 @@ -73,9 +77,9 @@ class WindowsVsToolChain(IUefiBuildPlugin): # # VS2019 - Follow VS2019 where there is potential for many version= s of the tools. # If a specific version is required then the user must set both en= v variables: - ## VS160INSTALLPATH: base install path on system to VC install di= r. Here you will find the VC folder, etc - ## VS160TOOLVER: version number for the VC compiler tools - ## VS2019_PREFIX: path to MSVC compiler folder with trailing s= lash (can be used instead of two vars above) + # VS160INSTALLPATH: base install path on system to VC install dir= . Here you will find the VC folder, etc + # VS160TOOLVER: version number for the VC compiler tools + # VS2019_PREFIX: path to MSVC compiler folder with trailing sl= ash (can be used instead of two vars above) elif thebuilder.env.GetValue("TOOL_CHAIN_TAG") =3D=3D "VS2019": =20 # check to see if full path already configured @@ -83,11 +87,1= 3 @@ class WindowsVsToolChain(IUefiBuildPlugin): self.Logger.info("VS2019_PREFIX is already set.") =20 else: - install_path =3D self._get_vs_install_path("VS2019".lower(= ), "VS160INSTALLPATH") + install_path =3D self._get_vs_install_path( + "VS2019".lower(), "VS160INSTALLPATH") vc_ver =3D self._get_vc_version(install_path, "VS160TOOLVE= R") =20 if install_path is None or vc_ver is None: - self.Logger.error("Failed to configure environment for= VS2019") + self.Logger.error( + "Failed to configure environment for VS2019") return -1 =20 version_aggregator.GetVersionAggregator().ReportVersion( @@ -95,8 +101,9 @@ class WindowsVsToolChain(IUefiBuildPlugin): version_aggregator.GetVersionAggregator().ReportVersion( "VC Version", vc_ver, version_aggregator.VersionTypes.= TOOL) =20 - #make VS2019_PREFIX to align with tools_def.txt - prefix =3D os.path.join(install_path, "VC", "Tools", "MSVC= ", vc_ver) + # make VS2019_PREFIX to align with tools_def.txt + prefix =3D os.path.join(install_path, "VC", + "Tools", "MSVC", vc_ver) prefix =3D prefix + os.path.sep shell_environment.GetEnvironment().set_shell_var("VS2019_P= REFIX", prefix) =20 @@ -126,14 +133,16 @@ class WindowsVsToolChain(IUefiBuildPlugin): if rc =3D=3D 0 and path is not None and os.path.exists(path): self.Logger.debug("Found VS instance for %s", vs_version) else: - self.Logger.error("Failed to find VS instance with VsWhere= (%d)" % rc) + self.Logger.error( + "Failed to find VS instance with VsWhere (%d)" %=20 + rc) return path =20 def _get_vc_version(self, path, varname): # check if already specified vc_ver =3D shell_environment.GetEnvironment().get_shell_var(varnam= e) if (path is None): - self.Logger.critical("Failed to find Visual Studio tools. Mig= ht need to check for VS install") + self.Logger.critical( + "Failed to find Visual Studio tools. Might need to=20 + check for VS install") return vc_ver if(vc_ver is None): # Not specified...find latest @@ -145,5 +154,3 @@ class Window= sVsToolChain(IUefiBuildPlugin): vc_ver =3D os.listdir(p2)[-1].strip() # get last in list self.Logger.debug("Found VC Tool version is %s" % vc_ver) return vc_ver - - -- 2.21.0.windows.1