]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Workspace/DecBuildData.py
BaseTools: use predefined constants instead of local strings
[mirror_edk2.git] / BaseTools / Source / Python / Workspace / DecBuildData.py
index 49ef1df4aa76bb8e11e06b70e18fb9a826899f5d..31870e078cec3004ee26adc8cc4a0948a6700134 100644 (file)
@@ -63,7 +63,7 @@ class DecBuildData(PackageBuildClassObject):
     #   @param      Platform        (not used for DecBuildData)\r
     #   @param      Macros          Macros used for replacement in DSC file\r
     #\r
-    def __init__(self, File, RawData, BuildDataBase, Arch='COMMON', Target=None, Toolchain=None):\r
+    def __init__(self, File, RawData, BuildDataBase, Arch=TAB_ARCH_COMMON, Target=None, Toolchain=None):\r
         self.MetaFile = File\r
         self._PackageDir = File.Dir\r
         self._RawData = RawData\r
@@ -199,9 +199,9 @@ class DecBuildData(PackageBuildClassObject):
                 if Name not in NameList:\r
                     NameList.append(Name)\r
                 ProtocolDict[Arch, Name] = Guid\r
-            # use sdict to keep the order\r
-            self._Protocols = sdict()\r
-            self._PrivateProtocols = sdict()\r
+            # use OrderedDict to keep the order\r
+            self._Protocols = OrderedDict()\r
+            self._PrivateProtocols = OrderedDict()\r
             for Name in NameList:\r
                 #\r
                 # limit the ARCH to self._Arch, if no self._Arch found, tdict\r
@@ -241,9 +241,9 @@ class DecBuildData(PackageBuildClassObject):
                 if Name not in NameList:\r
                     NameList.append(Name)\r
                 PpiDict[Arch, Name] = Guid\r
-            # use sdict to keep the order\r
-            self._Ppis = sdict()\r
-            self._PrivatePpis = sdict()\r
+            # use OrderedDict to keep the order\r
+            self._Ppis = OrderedDict()\r
+            self._PrivatePpis = OrderedDict()\r
             for Name in NameList:\r
                 #\r
                 # limit the ARCH to self._Arch, if no self._Arch found, tdict\r
@@ -283,9 +283,9 @@ class DecBuildData(PackageBuildClassObject):
                 if Name not in NameList:\r
                     NameList.append(Name)\r
                 GuidDict[Arch, Name] = Guid\r
-            # use sdict to keep the order\r
-            self._Guids = sdict()\r
-            self._PrivateGuids = sdict()\r
+            # use OrderedDict to keep the order\r
+            self._Guids = OrderedDict()\r
+            self._PrivateGuids = OrderedDict()\r
             for Name in NameList:\r
                 #\r
                 # limit the ARCH to self._Arch, if no self._Arch found, tdict\r
@@ -327,7 +327,7 @@ class DecBuildData(PackageBuildClassObject):
                         PublicInclues.append(File)\r
                     if File in self._PrivateIncludes:\r
                         EdkLogger.error('build', OPTION_CONFLICT, "Can't determine %s's attribute, it is both defined as Private and non-Private attribute in DEC file." % File, File=self.MetaFile, Line=LineNo)\r
-                if Record[3] == "COMMON":\r
+                if Record[3] == TAB_COMMON:\r
                     self._CommonIncludes.append(File)\r
         return self._Includes\r
 \r
@@ -350,7 +350,7 @@ class DecBuildData(PackageBuildClassObject):
                     EdkLogger.error('build', ErrorCode, ExtraData=ErrorInfo, File=self.MetaFile, Line=LineNo)\r
                 LibraryClassSet.add(LibraryClass)\r
                 LibraryClassDict[Arch, LibraryClass] = File\r
-            self._LibraryClasses = sdict()\r
+            self._LibraryClasses = OrderedDict()\r
             for LibraryClass in LibraryClassSet:\r
                 self._LibraryClasses[LibraryClass] = LibraryClassDict[self._Arch, LibraryClass]\r
         return self._LibraryClasses\r
@@ -358,7 +358,7 @@ class DecBuildData(PackageBuildClassObject):
     ## Retrieve PCD declarations\r
     def _GetPcds(self):\r
         if self._Pcds is None:\r
-            self._Pcds = sdict()\r
+            self._Pcds = OrderedDict()\r
             self._Pcds.update(self._GetPcd(MODEL_PCD_FIXED_AT_BUILD))\r
             self._Pcds.update(self._GetPcd(MODEL_PCD_PATCHABLE_IN_MODULE))\r
             self._Pcds.update(self._GetPcd(MODEL_PCD_FEATURE_FLAG))\r
@@ -399,7 +399,7 @@ class DecBuildData(PackageBuildClassObject):
 \r
     ## Retrieve PCD declarations for given type\r
     def _GetPcd(self, Type):\r
-        Pcds = sdict()\r
+        Pcds = OrderedDict()\r
         #\r
         # tdict is a special kind of dict, used for selecting correct\r
         # PCD declaration for given ARCH\r