from Common.BuildToolError import OPTION_MISSING\r
from Common.BuildToolError import BUILD_ERROR\r
\r
-class OrderedListDict(OrderedDict, defaultdict):\r
+class OrderedListDict(OrderedDict):\r
def __init__(self, *args, **kwargs):\r
super(OrderedListDict, self).__init__(*args, **kwargs)\r
self.default_factory = list\r
\r
+ def __missing__(self, key):\r
+ self[key] = Value = self.default_factory()\r
+ return Value\r
+\r
## Get all packages from platform for specified arch, target and toolchain\r
#\r
# @param Platform: DscBuildData instance\r
for LibraryClassName in M.LibraryClasses:\r
if LibraryClassName not in LibraryInstance:\r
# override library instance for this module\r
- if LibraryClassName in Platform.Modules[str(Module)].LibraryClasses:\r
- LibraryPath = Platform.Modules[str(Module)].LibraryClasses[LibraryClassName]\r
- else:\r
- LibraryPath = Platform.LibraryClasses[LibraryClassName, ModuleType]\r
- if LibraryPath is None or LibraryPath == "":\r
- LibraryPath = M.LibraryClasses[LibraryClassName]\r
- if LibraryPath is None or LibraryPath == "":\r
+ LibraryPath = Platform.Modules[str(Module)].LibraryClasses.get(LibraryClassName,Platform.LibraryClasses[LibraryClassName, ModuleType])\r
+ if LibraryPath is None:\r
+ LibraryPath = M.LibraryClasses.get(LibraryClassName)\r
+ if LibraryPath is None:\r
if FileName:\r
EdkLogger.error("build", RESOURCE_NOT_AVAILABLE,\r
"Instance of library class [%s] is not found" % LibraryClassName,\r