From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com []) by mx.groups.io with SMTP id smtpd.web10.4851.1581030438653795231 for ; Thu, 06 Feb 2020 15:07:19 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: michael.d.kinney@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Feb 2020 15:07:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,411,1574150400"; d="scan'208";a="379222373" Received: from unknown (HELO mdkinney-MOBL2.amr.corp.intel.com) ([10.241.98.74]) by orsmga004.jf.intel.com with ESMTP; 06 Feb 2020 15:07:17 -0800 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Sean Brogan , Bob Feng , Liming Gao Subject: [Patch 4/4] BaseTools/WindowsVsToolChain: Clean up Python source formatting Date: Thu, 6 Feb 2020 15:07:15 -0800 Message-Id: <20200206230715.15564-5-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20200206230715.15564-1-michael.d.kinney@intel.com> References: <20200206230715.15564-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Sean Brogan https://bugzilla.tianocore.org/show_bug.cgi?id=2495 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/BaseTools/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 ## # This plugin works in conjuncture with the tools_def @@ -14,6 +14,7 @@ from edk2toollib.windows.locate_tools import FindWithVsWhere from edk2toolext.environment import shell_environment from edk2toolext.environment import version_aggregator + class WindowsVsToolChain(IUefiBuildPlugin): def do_post_build(self, thebuilder): @@ -28,9 +29,9 @@ class WindowsVsToolChain(IUefiBuildPlugin): # # VS2017 - Follow VS2017 where there is potential for many versions of the tools. # If a specific version is required then the user must set both env variables: - ## 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 slash (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 slash (can be used instead of two vars above) if thebuilder.env.GetValue("TOOL_CHAIN_TAG") == "VS2017": # check to see if full path already configured @@ -38,11 +39,13 @@ class WindowsVsToolChain(IUefiBuildPlugin): self.Logger.info("VS2017_PREFIX is already set.") else: - install_path = self._get_vs_install_path("VS2017".lower(), "VS150INSTALLPATH") + install_path = self._get_vs_install_path( + "VS2017".lower(), "VS150INSTALLPATH") vc_ver = self._get_vc_version(install_path, "VS150TOOLVER") 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 version_aggregator.GetVersionAggregator().ReportVersion( @@ -50,8 +53,9 @@ class WindowsVsToolChain(IUefiBuildPlugin): version_aggregator.GetVersionAggregator().ReportVersion( "VC Version", vc_ver, version_aggregator.VersionTypes.TOOL) - #make VS2017_PREFIX to align with tools_def.txt - prefix = os.path.join(install_path, "VC", "Tools", "MSVC", vc_ver) + # make VS2017_PREFIX to align with tools_def.txt + prefix = os.path.join(install_path, "VC", + "Tools", "MSVC", vc_ver) prefix = prefix + os.path.sep shell_environment.GetEnvironment().set_shell_var("VS2017_PREFIX", prefix) @@ -73,9 +77,9 @@ class WindowsVsToolChain(IUefiBuildPlugin): # # VS2019 - Follow VS2019 where there is potential for many versions of the tools. # If a specific version is required then the user must set both env variables: - ## 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 slash (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 slash (can be used instead of two vars above) elif thebuilder.env.GetValue("TOOL_CHAIN_TAG") == "VS2019": # check to see if full path already configured @@ -83,11 +87,13 @@ class WindowsVsToolChain(IUefiBuildPlugin): self.Logger.info("VS2019_PREFIX is already set.") else: - install_path = self._get_vs_install_path("VS2019".lower(), "VS160INSTALLPATH") + install_path = self._get_vs_install_path( + "VS2019".lower(), "VS160INSTALLPATH") vc_ver = self._get_vc_version(install_path, "VS160TOOLVER") 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 version_aggregator.GetVersionAggregator().ReportVersion( @@ -95,8 +101,9 @@ class WindowsVsToolChain(IUefiBuildPlugin): version_aggregator.GetVersionAggregator().ReportVersion( "VC Version", vc_ver, version_aggregator.VersionTypes.TOOL) - #make VS2019_PREFIX to align with tools_def.txt - prefix = os.path.join(install_path, "VC", "Tools", "MSVC", vc_ver) + # make VS2019_PREFIX to align with tools_def.txt + prefix = os.path.join(install_path, "VC", + "Tools", "MSVC", vc_ver) prefix = prefix + os.path.sep shell_environment.GetEnvironment().set_shell_var("VS2019_PREFIX", prefix) @@ -126,14 +133,16 @@ class WindowsVsToolChain(IUefiBuildPlugin): if rc == 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)" % rc) return path def _get_vc_version(self, path, varname): # check if already specified vc_ver = shell_environment.GetEnvironment().get_shell_var(varname) if (path is None): - self.Logger.critical("Failed to find Visual Studio tools. Might need to check for VS install") + self.Logger.critical( + "Failed to find Visual Studio tools. Might need to check for VS install") return vc_ver if(vc_ver is None): # Not specified...find latest @@ -145,5 +154,3 @@ class WindowsVsToolChain(IUefiBuildPlugin): vc_ver = 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