X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=BaseTools%2FScripts%2FPackageDocumentTools%2Fplugins%2FEdkPlugins%2Fedk2%2Fmodel%2Finf.py;h=430e71af2d890e2f75508ecf94af7378c24c48f8;hb=HEAD;hp=32b26850e766fe5835dc8ebf11901b100fd8dffd;hpb=4231a8193ec0d52df7e0a101d96c51b1a2b7a996;p=mirror_edk2.git diff --git a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/inf.py b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/inf.py index 32b26850e7..430e71af2d 100644 --- a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/inf.py +++ b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/inf.py @@ -2,16 +2,10 @@ # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
# -# This program and the accompanying materials are licensed and made available -# under the terms and conditions of the BSD License which accompanies this -# distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# SPDX-License-Identifier: BSD-2-Clause-Patent # -import plugins.EdkPlugins.basemodel.ini as ini +from plugins.EdkPlugins.basemodel import ini import re, os from plugins.EdkPlugins.basemodel.message import * @@ -61,7 +55,7 @@ class INFFile(ini.BaseINIFile): classname = self.GetProduceLibraryClass() if classname is not None: libobjdict = INFFile._libobjs - if libobjdict.has_key(classname): + if classname in libobjdict: if self not in libobjdict[classname]: libobjdict[classname].append(self) else: @@ -169,7 +163,7 @@ class INFLibraryClassObject(INFSectionObject): def Parse(self): self._classname = self.GetLineByOffset(self._start).split('#')[0].strip() objdict = INFLibraryClassObject._objs - if objdict.has_key(self._classname): + if self._classname in objdict: objdict[self._classname].append(self) else: objdict[self._classname] = [self] @@ -241,7 +235,7 @@ class INFSourceObject(INFSectionObject): self.mFilename = os.path.basename(self.GetSourceFullPath()) objdict = INFSourceObject._objs - if not objdict.has_key(self.mFilename): + if self.mFilename not in objdict: objdict[self.mFilename] = [self] else: objdict[self.mFilename].append(self) @@ -303,7 +297,7 @@ class INFPcdObject(INFSectionObject): self.mDefaultValue = arr[1].strip() objdict = INFPcdObject._objs - if objdict.has_key(self.GetName()): + if self.GetName() in objdict: if self not in objdict[self.GetName()]: objdict[self.GetName()].append(self) else: