## @file\r
# This file is used to define each component of the build database\r
#\r
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
##\r
# Import Modules\r
#\r
-import os, string, copy, pdb, copy\r
+import Common.LongFilePathOs as os, string, copy, pdb, copy\r
import EdkLogger\r
import DataType\r
from InfClassObject import *\r
# @retval True The two pcds are the same\r
#\r
def __eq__(self, Other):\r
- return Other != None and self.TokenCName == Other.TokenCName and self.TokenSpaceGuidCName == Other.TokenSpaceGuidCName\r
+ return Other is not None and self.TokenCName == Other.TokenCName and self.TokenSpaceGuidCName == Other.TokenSpaceGuidCName\r
\r
## Override __hash__ function\r
#\r
def __init__(self, Name = None, SupModList = [], Type = None):\r
self.LibraryClass = Name\r
self.SupModList = SupModList\r
- if Type != None:\r
+ if Type is not None:\r
self.SupModList = CleanString(Type).split(DataType.TAB_SPACE_SPLIT)\r
\r
## ModuleBuildClassObject\r
for Libs in Pb.LibraryClass:\r
for Type in Libs.SupModList:\r
Instance = self.FindLibraryClassInstanceOfLibrary(Lib, Arch, Type)\r
- if Instance == None:\r
+ if Instance is None:\r
Instance = RecommendedInstance\r
Pb.LibraryClasses[(Lib, Type)] = Instance\r
else:\r
# For Module\r
#\r
Instance = self.FindLibraryClassInstanceOfModule(Lib, Arch, Pb.ModuleType, Inf)\r
- if Instance == None:\r
+ if Instance is None:\r
Instance = RecommendedInstance\r
Pb.LibraryClasses[(Lib, Pb.ModuleType)] = Instance\r
\r
if not self.IsModuleDefinedInPlatform(Inf, Arch, InfList):\r
continue\r
Module = self.Build[Arch].ModuleDatabase[Inf]\r
- if Module.LibraryClass == None or Module.LibraryClass == []:\r
+ if Module.LibraryClass is None or Module.LibraryClass == []:\r
self.UpdateLibrariesOfModule(Platform, Module, Arch)\r
for Key in Module.LibraryClasses:\r
Lib = Module.LibraryClasses[Key]\r
continue\r
\r
LibraryClassName = Key[0]\r
- if LibraryClassName not in LibraryInstance or LibraryInstance[LibraryClassName] == None:\r
- if LibraryPath == None or LibraryPath == "":\r
+ if LibraryClassName not in LibraryInstance or LibraryInstance[LibraryClassName] is None:\r
+ if LibraryPath is None or LibraryPath == "":\r
LibraryInstance[LibraryClassName] = None\r
continue\r
LibraryModule = ModuleDatabase[LibraryPath]\r
LibraryInstance[LibraryClassName] = LibraryModule\r
LibraryConsumerList.append(LibraryModule)\r
EdkLogger.verbose("\t" + LibraryClassName + " : " + str(LibraryModule))\r
- elif LibraryPath == None or LibraryPath == "":\r
+ elif LibraryPath is None or LibraryPath == "":\r
continue\r
else:\r
LibraryModule = LibraryInstance[LibraryClassName]\r
Q = []\r
for LibraryClassName in LibraryInstance:\r
M = LibraryInstance[LibraryClassName]\r
- if M == None:\r
+ if M is None:\r
EdkLogger.error("AutoGen", AUTOGEN_ERROR,\r
"Library instance for library class [%s] is not found" % LibraryClassName,\r
ExtraData="\t%s [%s]" % (str(Module), Arch))\r
# check if there're duplicate library classes\r
#\r
for Lc in M.LibraryClass:\r
- if Lc.SupModList != None and ModuleType not in Lc.SupModList:\r
+ if Lc.SupModList is not None and ModuleType not in Lc.SupModList:\r
EdkLogger.error("AutoGen", AUTOGEN_ERROR,\r
"Module type [%s] is not supported by library instance [%s]" % (ModuleType, str(M)),\r
ExtraData="\t%s" % str(Module))\r
if (Name, Guid) in Pcds:\r
OwnerPlatform = Dsc\r
Pcd = Pcds[(Name, Guid)]\r
- if Pcd.Type != '' and Pcd.Type != None:\r
+ if Pcd.Type != '' and Pcd.Type is not None:\r
NewType = Pcd.Type\r
if NewType in DataType.PCD_DYNAMIC_TYPE_LIST:\r
NewType = DataType.TAB_PCDS_DYNAMIC\r
EdkLogger.error("AutoGen", PARSER_ERROR, ErrorMsg)\r
\r
\r
- if Pcd.DatumType != '' and Pcd.DatumType != None:\r
+ if Pcd.DatumType != '' and Pcd.DatumType is not None:\r
DatumType = Pcd.DatumType\r
- if Pcd.TokenValue != '' and Pcd.TokenValue != None:\r
+ if Pcd.TokenValue != '' and Pcd.TokenValue is not None:\r
Token = Pcd.TokenValue\r
- if Pcd.DefaultValue != '' and Pcd.DefaultValue != None:\r
+ if Pcd.DefaultValue != '' and Pcd.DefaultValue is not None:\r
Value = Pcd.DefaultValue\r
- if Pcd.MaxDatumSize != '' and Pcd.MaxDatumSize != None:\r
+ if Pcd.MaxDatumSize != '' and Pcd.MaxDatumSize is not None:\r
MaxDatumSize = Pcd.MaxDatumSize\r
SkuInfoList = Pcd.SkuInfoList\r
\r