#\r
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>\r
#\r
-# This program and the accompanying materials are licensed and made available\r
-# under the terms and conditions of the BSD License which accompanies this\r
-# distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+# SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
-import plugins.EdkPlugins.basemodel.ini as ini\r
-import plugins.EdkPlugins.edk2.model.dsc as dsc\r
-import plugins.EdkPlugins.edk2.model.inf as inf\r
-import plugins.EdkPlugins.edk2.model.dec as dec\r
+from plugins.EdkPlugins.basemodel import ini\r
+from plugins.EdkPlugins.edk2.model import dsc\r
+from plugins.EdkPlugins.edk2.model import inf\r
+from plugins.EdkPlugins.edk2.model import dec\r
import os\r
from plugins.EdkPlugins.basemodel.message import *\r
\r
@return: instance of this class\r
\r
"""\r
- obj = object.__new__(cls, *args, **kwargs)\r
- if not cls._objs.has_key("None"):\r
+ obj = object.__new__(cls)\r
+ if "None" not in cls._objs:\r
cls._objs["None"] = []\r
cls._objs["None"].append(obj)\r
\r
self.GetFileObj().Destroy(self)\r
del self._fileObj\r
# dereference self from _objs arrary\r
- assert self._objs.has_key(key), "when destory, object is not in obj list"\r
+ assert key in self._objs, "when destory, object is not in obj list"\r
assert self in self._objs[key], "when destory, object is not in obj list"\r
self._objs[key].remove(self)\r
if len(self._objs[key]) == 0:\r
if self not in cls._objs["None"]:\r
ErrorMsg("Sufrace object does not be create into None list")\r
cls._objs["None"].remove(self)\r
- if not cls._objs.has_key(relativePath):\r
+ if relativePath not in cls._objs:\r
cls._objs[relativePath] = []\r
cls._objs[relativePath].append(self)\r
\r
return self._pcds\r
\r
def GetPpis(self):\r
- return self._ppis.values()\r
+ return list(self._ppis.values())\r
\r
def GetProtocols(self):\r
- return self._protocols.values()\r
+ return list(self._protocols.values())\r
\r
def GetGuids(self):\r
- return self._guids.values()\r
+ return list(self._guids.values())\r
\r
def Destroy(self):\r
for pcd in self._pcds.values():\r
ErrorMsg("%s item is duplicated defined in packages: %s and %s" %\r
(name, parent.GetFilename(), cls._objs[name].GetParent().GetFilename()))\r
return None\r
- obj = object.__new__(cls, *args, **kwargs)\r
+ obj = object.__new__(cls)\r
cls._objs[name] = obj\r
return obj\r
elif issubclass(parent.__class__, Module):\r