git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@140 7335b...
authorhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 14 Jun 2007 04:57:20 +0000 (04:57 +0000)
committerhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 14 Jun 2007 04:57:20 +0000 (04:57 +0000)
Source/Python/DecClassObject.py
Source/Python/DscClassObject.py
Source/Python/EdkIIWorkspace.py
Source/Python/EdkIIWorkspaceBuild.py
Source/Python/InfClassObject.py
Source/Python/String.py

index b4c1398..df48d00 100644 (file)
@@ -1,7 +1,7 @@
 # Copyright (c) 2007, Intel Corporation\r
 # All rights reserved. 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
+# which accompanies this 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
@@ -18,107 +18,107 @@ from Identification import *
 from Dictionary import *\r
 \r
 class DecObject(object):\r
-  def __init__(self):\r
-    object.__init__()\r
+    def __init__(self):\r
+        object.__init__()\r
 \r
 class DecDefines(DecObject):\r
-  def __init__(self):\r
-    self.DefinesDictionary = {\r
-      #Req\r
-      TAB_DEC_DEFINES_DEC_SPECIFICATION   : '',\r
-      TAB_DEC_DEFINES_PACKAGE_NAME        : '',\r
-      TAB_DEC_DEFINES_PACKAGE_GUID        : '',\r
-      TAB_DEC_DEFINES_PACKAGE_VERSION     : ''\r
-    }\r
-    \r
+    def __init__(self):\r
+        self.DefinesDictionary = {\r
+            #Req\r
+            TAB_DEC_DEFINES_DEC_SPECIFICATION           : [''],\r
+            TAB_DEC_DEFINES_PACKAGE_NAME                : [''],\r
+            TAB_DEC_DEFINES_PACKAGE_GUID                : [''],\r
+            TAB_DEC_DEFINES_PACKAGE_VERSION             : ['']\r
+        }\r
+        \r
 class DecContents(DecObject):\r
-  def __init__(self):\r
-    self.Includes = []\r
-    self.Guids = []\r
-    self.Protocols = []\r
-    self.Ppis = []\r
-    self.LibraryClasses = []\r
-    self.PcdsFixedAtBuild = []\r
-    self.PcdsPatchableInModule = []\r
-    self.PcdsFeatureFlag = []\r
-    self.PcdsDynamic = []\r
-    self.PcdsDynamicEx = []\r
+    def __init__(self):\r
+        self.Includes = []\r
+        self.Guids = []\r
+        self.Protocols = []\r
+        self.Ppis = []\r
+        self.LibraryClasses = []\r
+        self.PcdsFixedAtBuild = []\r
+        self.PcdsPatchableInModule = []\r
+        self.PcdsFeatureFlag = []\r
+        self.PcdsDynamic = []\r
+        self.PcdsDynamicEx = []\r
 \r
 class Dec(DecObject):\r
-  def __init__(self, filename = None, isMergeAllArches = False):\r
-    self.identification = Identification()\r
-    self.Defines = DecDefines()\r
+    def __init__(self, filename = None, isMergeAllArches = False):\r
+        self.identification = Identification()\r
+        self.Defines = DecDefines()\r
+        \r
+        self.Contents = {}\r
+        for key in DataType.ARCH_LIST_FULL:\r
+            self.Contents[key] = DecContents()\r
+        \r
+        self.KeyList = [\r
+            TAB_INCLUDES, TAB_GUIDS, TAB_PROTOCOLS, TAB_PPIS, TAB_LIBRARY_CLASSES, \\r
+            TAB_PCDS_FIXED_AT_BUILD_NULL, TAB_PCDS_PATCHABLE_IN_MODULE_NULL, TAB_PCDS_FEATURE_FLAG_NULL, \\r
+            TAB_PCDS_DYNAMIC_NULL, TAB_PCDS_DYNAMIC_EX_NULL\r
+        ]\r
     \r
-    self.Contents = {}\r
-    for key in DataType.ARCH_LIST_FULL:\r
-      self.Contents[key] = DecContents()\r
+        if filename != None:\r
+            self.LoadDecFile(filename)\r
+            \r
+        if isMergeAllArches:\r
+            self.MergeAllArches()            \r
     \r
-    self.KeyList = [\r
-      TAB_INCLUDES, TAB_GUIDS, TAB_PROTOCOLS, TAB_PPIS, TAB_LIBRARY_CLASSES, \\r
-      TAB_PCDS_FIXED_AT_BUILD_NULL, TAB_PCDS_PATCHABLE_IN_MODULE_NULL, TAB_PCDS_FEATURE_FLAG_NULL, \\r
-      TAB_PCDS_DYNAMIC_NULL, TAB_PCDS_DYNAMIC_EX_NULL\r
-    ]\r
-  \r
-    if filename != None:\r
-      self.LoadDecFile(filename)\r
-      \r
-    if isMergeAllArches:\r
-      self.MergeAllArches()      \r
-  \r
-  def ParseDec(self, Lines, Key, KeyField):\r
-    GetMultipleValuesOfKeyFromLines(Lines, Key, KeyField, TAB_COMMENT_SPLIT)\r
-      \r
-  def MergeAllArches(self):\r
-    for key in self.KeyList:\r
-      for arch in DataType.ARCH_LIST:\r
-        Command = "self.Contents[arch]." + key + ".extend(" + "self.Contents['" + DataType.TAB_ARCH_COMMON + "']." + key + ")"\r
-        eval(Command)\r
-\r
-  def LoadDecFile(self, filename):\r
-    f = open(filename, 'r').read()\r
-    sects = f.split('[')\r
-    for sect in sects:\r
-      tab = (sect.split(TAB_SECTION_END, 1)[0]).upper()\r
-      if tab == TAB_INF_DEFINES.upper():\r
-        GetSingleValueOfKeyFromLines(sect, self.Defines.DefinesDictionary, TAB_COMMENT_SPLIT, TAB_EQUAL_SPLIT, True, TAB_VALUE_SPLIT)\r
-        continue\r
-      for arch in DataType.ARCH_LIST_FULL + [DataType.TAB_ARCH_NULL]:\r
+    def ParseDec(self, Lines, Key, KeyField):\r
+        GetMultipleValuesOfKeyFromLines(Lines, Key, KeyField, TAB_COMMENT_SPLIT)\r
+            \r
+    def MergeAllArches(self):\r
         for key in self.KeyList:\r
-          if arch != DataType.TAB_ARCH_NULL:\r
-            target = (key + DataType.TAB_SPLIT + arch).upper()\r
-          else:\r
-            target = key.upper()\r
-          if tab == target:\r
-            if arch != DataType.TAB_ARCH_NULL:\r
-              Command = 'self.ParseDec(sect, tab, self.Contents[arch].' + key + ')'\r
-              eval(Command)\r
-              continue\r
-            else:\r
-              Command = "self.ParseDec(sect, tab, self.Contents['" + DataType.TAB_ARCH_COMMON + "']." + key + ')'\r
-              eval(Command)\r
-              continue\r
-    #EndFor\r
+            for arch in DataType.ARCH_LIST:\r
+                Command = "self.Contents[arch]." + key + ".extend(" + "self.Contents['" + DataType.TAB_ARCH_COMMON + "']." + key + ")"\r
+                eval(Command)\r
 \r
-  def showDec(self):\r
-    print TAB_SECTION_START + TAB_INF_DEFINES + TAB_SECTION_END\r
-    printDict(self.Defines.DefinesDictionary)\r
+    def LoadDecFile(self, filename):\r
+        f = open(filename, 'r').read()\r
+        sects = f.split('[')\r
+        for sect in sects:\r
+            tab = (sect.split(TAB_SECTION_END, 1)[0]).upper()\r
+            if tab == TAB_INF_DEFINES.upper():\r
+                GetSingleValueOfKeyFromLines(sect, self.Defines.DefinesDictionary, TAB_COMMENT_SPLIT, TAB_EQUAL_SPLIT, True, TAB_VALUE_SPLIT)\r
+                continue\r
+            for arch in DataType.ARCH_LIST_FULL + [DataType.TAB_ARCH_NULL]:\r
+                for key in self.KeyList:\r
+                    if arch != DataType.TAB_ARCH_NULL:\r
+                        target = (key + DataType.TAB_SPLIT + arch).upper()\r
+                    else:\r
+                        target = key.upper()\r
+                    if tab == target:\r
+                        if arch != DataType.TAB_ARCH_NULL:\r
+                            Command = 'self.ParseDec(sect, tab, self.Contents[arch].' + key + ')'\r
+                            eval(Command)\r
+                            continue\r
+                        else:\r
+                            Command = "self.ParseDec(sect, tab, self.Contents['" + DataType.TAB_ARCH_COMMON + "']." + key + ')'\r
+                            eval(Command)\r
+                            continue\r
+        #EndFor\r
 \r
-    for key in self.KeyList:\r
-      for arch in DataType.ARCH_LIST_FULL:\r
-        Command = "printList(TAB_SECTION_START + '" + \\r
-                  key + DataType.TAB_SPLIT + arch + \\r
-                  "' + TAB_SECTION_END, self.Contents[arch]." + key + ')'\r
-        eval(Command)\r
+    def showDec(self):\r
+        print TAB_SECTION_START + TAB_INF_DEFINES + TAB_SECTION_END\r
+        printDict(self.Defines.DefinesDictionary)\r
+\r
+        for key in self.KeyList:\r
+            for arch in DataType.ARCH_LIST_FULL:\r
+                Command = "printList(TAB_SECTION_START + '" + \\r
+                                    key + DataType.TAB_SPLIT + arch + \\r
+                                    "' + TAB_SECTION_END, self.Contents[arch]." + key + ')'\r
+                eval(Command)\r
 \r
 if __name__ == '__main__':\r
-  p = Dec()\r
-  directory = 'C:\Documents and Settings\\hchen30\\Desktop\\prototype\\dec'\r
-  fileList = []\r
-  for f in os.listdir(directory):\r
-    if os.path.splitext(os.path.normcase(f))[1] == '.dec':\r
-      fileList.append(os.path.join(directory, os.path.normcase(f)))\r
-      \r
-      \r
-  for f in fileList:\r
-    p.LoadDecFile(f)\r
-    p.showDec()\r
+    p = Dec()\r
+    directory = 'C:\Documents and Settings\\hchen30\\Desktop\\prototype\\dec'\r
+    fileList = []\r
+    for f in os.listdir(directory):\r
+        if os.path.splitext(os.path.normcase(f))[1] == '.dec':\r
+            fileList.append(os.path.join(directory, os.path.normcase(f)))\r
+            \r
+            \r
+    for f in fileList:\r
+        p.LoadDecFile(f)\r
+        p.showDec()\r
index ab4f7ae..861724f 100644 (file)
@@ -1,7 +1,7 @@
 # Copyright (c) 2007, Intel Corporation\r
 # All rights reserved. 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
+# which accompanies this 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
@@ -18,120 +18,120 @@ from Identification import *
 from Dictionary import *\r
 \r
 class DscObject(object):\r
-  def __init__(self):\r
-    object.__init__()\r
+    def __init__(self):\r
+        object.__init__()\r
 \r
 class DscDefines(DscObject):\r
-  def __init__(self):\r
-    self.DefinesDictionary = {\r
-      #Req\r
-      TAB_DSC_DEFINES_PLATFORM_NAME             : '',\r
-      TAB_DSC_DEFINES_PLATFORM_GUID             : '',\r
-      TAB_DSC_DEFINES_PLATFORM_VERSION          : '',\r
-      TAB_DSC_DEFINES_DSC_SPECIFICATION         : '',\r
-      TAB_DSC_DEFINES_OUTPUT_DIRECTORY          : '',\r
-      TAB_DSC_DEFINES_SUPPORTED_ARCHITECTURES   : [],\r
-      TAB_DSC_DEFINES_BUILD_TARGETS             : [],\r
-      TAB_DSC_DEFINES_SKUID_IDENTIFIER          : []\r
-    }\r
+    def __init__(self):\r
+        self.DefinesDictionary = {\r
+            #Req\r
+            TAB_DSC_DEFINES_PLATFORM_NAME                         : [''],\r
+            TAB_DSC_DEFINES_PLATFORM_GUID                         : [''],\r
+            TAB_DSC_DEFINES_PLATFORM_VERSION                      : [''],\r
+            TAB_DSC_DEFINES_DSC_SPECIFICATION                     : [''],\r
+            TAB_DSC_DEFINES_OUTPUT_DIRECTORY                      : [''],\r
+            TAB_DSC_DEFINES_SUPPORTED_ARCHITECTURES               : [''],\r
+            TAB_DSC_DEFINES_BUILD_TARGETS                         : [''],\r
+            TAB_DSC_DEFINES_SKUID_IDENTIFIER                      : ['']\r
+        }\r
 \r
 class DscSkuId(DscObject):\r
-  def __init__(self):\r
-    self.SkuId = {}     #{ [skuid : skuname], [skuid : skuname], ...}\r
+    def __init__(self):\r
+        self.SkuId = {}         #{ [skuid : skuname], [skuid : skuname], ...}\r
 \r
 class DscContents(DscObject):\r
-  def __init__(self):\r
-    self.Libraries = []\r
-    self.Components = []        #[['component name', [lib1, lib2, lib3], [bo1, bo2, bo3]], ...]\r
-    self.LibraryClasses = []\r
-    self.PcdsFixedAtBuild = []\r
-    self.PcdsPatchableInModule = []\r
-    self.PcdsFeatureFlag = []\r
-    self.PcdsDynamic = []\r
-    self.PcdsDynamicEx = []\r
-    self.BuildOptions = []\r
+    def __init__(self):\r
+        self.Libraries = []\r
+        self.Components = []                #[['component name', [lib1, lib2, lib3], [bo1, bo2, bo3]], ...]\r
+        self.LibraryClasses = []\r
+        self.PcdsFixedAtBuild = []\r
+        self.PcdsPatchableInModule = []\r
+        self.PcdsFeatureFlag = []\r
+        self.PcdsDynamic = []\r
+        self.PcdsDynamicEx = []\r
+        self.BuildOptions = []\r
 \r
 class Dsc(DscObject):\r
-  def __init__(self, filename = None, isMergeAllArches = False):\r
-    self.identification = Identification()\r
-    self.Defines = DscDefines()\r
-    self.Contents = {}\r
+    def __init__(self, filename = None, isMergeAllArches = False):\r
+        self.identification = Identification()\r
+        self.Defines = DscDefines()\r
+        self.Contents = {}\r
 \r
-    for key in DataType.ARCH_LIST_FULL:\r
-      self.Contents[key] = DscContents()\r
+        for key in DataType.ARCH_LIST_FULL:\r
+            self.Contents[key] = DscContents()\r
+        \r
+        self.KeyList = [\r
+            TAB_LIBRARIES, TAB_LIBRARY_CLASSES, TAB_BUILD_OPTIONS, TAB_PCDS_FIXED_AT_BUILD_NULL, \\r
+            TAB_PCDS_PATCHABLE_IN_MODULE_NULL, TAB_PCDS_FEATURE_FLAG_NULL, \\r
+            TAB_PCDS_DYNAMIC_NULL, TAB_PCDS_DYNAMIC_EX_NULL, TAB_COMPONENTS, TAB_BUILD_OPTIONS\r
+        ]\r
+        \r
+        if filename != None:\r
+            self.LoadDscFile(filename)\r
+            \r
+        if isMergeAllArches:\r
+            self.MergeAllArches()\r
+        \r
+    def ParseDsc(self, Lines, Key, KeyField):\r
+        newKey = SplitModuleType(Key)     \r
+        if newKey[0].find(TAB_LIBRARY_CLASSES.upper()) != -1:\r
+            GetLibraryClassesWithModuleType(Lines, Key, KeyField, TAB_COMMENT_SPLIT)\r
+        elif newKey[0].find(TAB_COMPONENTS.upper()) != -1:\r
+            GetComponents(Lines, Key, KeyField, TAB_COMMENT_SPLIT)\r
+        else:\r
+            GetMultipleValuesOfKeyFromLines(Lines, Key, KeyField, TAB_COMMENT_SPLIT)\r
     \r
-    self.KeyList = [\r
-      TAB_LIBRARIES, TAB_LIBRARY_CLASSES, TAB_BUILD_OPTIONS, TAB_PCDS_FIXED_AT_BUILD_NULL, \\r
-      TAB_PCDS_PATCHABLE_IN_MODULE_NULL, TAB_PCDS_FEATURE_FLAG_NULL, \\r
-      TAB_PCDS_DYNAMIC_NULL, TAB_PCDS_DYNAMIC_EX_NULL, TAB_COMPONENTS, TAB_BUILD_OPTIONS\r
-    ]\r
-    \r
-    if filename != None:\r
-      self.LoadDscFile(filename)\r
-      \r
-    if isMergeAllArches:\r
-      self.MergeAllArches()\r
-    \r
-  def ParseDsc(self, Lines, Key, KeyField):\r
-    newKey = SplitModuleType(Key)   \r
-    if newKey[0].find(TAB_LIBRARY_CLASSES.upper()) != -1:\r
-      GetLibraryClassesWithModuleType(Lines, Key, KeyField, TAB_COMMENT_SPLIT)\r
-    elif newKey[0].find(TAB_COMPONENTS.upper()) != -1:\r
-      GetComponents(Lines, Key, KeyField, TAB_COMMENT_SPLIT)\r
-    else:\r
-      GetMultipleValuesOfKeyFromLines(Lines, Key, KeyField, TAB_COMMENT_SPLIT)\r
-  \r
-  def MergeAllArches(self):\r
-    for key in self.KeyList:\r
-      for arch in DataType.ARCH_LIST:\r
-        Command = "self.Contents[arch]." + key + ".extend(" + "self.Contents['" + DataType.TAB_ARCH_COMMON + "']." + key + ")"\r
-        eval(Command)\r
-      \r
-  def LoadDscFile(self, filename):\r
-    EdkLogger.info('Open Dsc File:' + filename)\r
-    f = open(filename, 'r').read()\r
-    sects = f.split('[')\r
-    for sect in sects:\r
-      tab = (sect.split(TAB_SECTION_END, 1)[0]).upper()\r
-      if tab == TAB_INF_DEFINES.upper():\r
-        GetSingleValueOfKeyFromLines(sect, self.Defines.DefinesDictionary, TAB_COMMENT_SPLIT, TAB_EQUAL_SPLIT, True, TAB_VALUE_SPLIT)\r
-        continue\r
-      for arch in DataType.ARCH_LIST_FULL + [DataType.TAB_ARCH_NULL]:\r
+    def MergeAllArches(self):\r
         for key in self.KeyList:\r
-          if arch != DataType.TAB_ARCH_NULL:\r
-            target = (key + DataType.TAB_SPLIT + arch).upper()\r
-          else:\r
-            target = key.upper()\r
-          if SplitModuleType(tab)[0] == target:\r
-            if arch != DataType.TAB_ARCH_NULL:\r
-              Command = 'self.ParseDsc(sect, tab, self.Contents[arch].' + key + ')'\r
-              eval(Command)\r
-              continue\r
-            else:\r
-              Command = "self.ParseDsc(sect, tab, self.Contents['" + DataType.TAB_ARCH_COMMON + "']." + key + ')'\r
-              eval(Command)\r
-              continue\r
+            for arch in DataType.ARCH_LIST:\r
+                Command = "self.Contents[arch]." + key + ".extend(" + "self.Contents['" + DataType.TAB_ARCH_COMMON + "']." + key + ")"\r
+                eval(Command)\r
+            \r
+    def LoadDscFile(self, filename):\r
+        EdkLogger.info('Open Dsc File:' + filename)\r
+        f = open(filename, 'r').read()\r
+        sects = f.split('[')\r
+        for sect in sects:\r
+            tab = (sect.split(TAB_SECTION_END, 1)[0]).upper()\r
+            if tab == TAB_INF_DEFINES.upper():\r
+                GetSingleValueOfKeyFromLines(sect, self.Defines.DefinesDictionary, TAB_COMMENT_SPLIT, TAB_EQUAL_SPLIT, True, TAB_VALUE_SPLIT)\r
+                continue\r
+            for arch in DataType.ARCH_LIST_FULL + [DataType.TAB_ARCH_NULL]:\r
+                for key in self.KeyList:\r
+                    if arch != DataType.TAB_ARCH_NULL:\r
+                        target = (key + DataType.TAB_SPLIT + arch).upper()\r
+                    else:\r
+                        target = key.upper()\r
+                    if SplitModuleType(tab)[0] == target:\r
+                        if arch != DataType.TAB_ARCH_NULL:\r
+                            Command = 'self.ParseDsc(sect, tab, self.Contents[arch].' + key + ')'\r
+                            eval(Command)\r
+                            continue\r
+                        else:\r
+                            Command = "self.ParseDsc(sect, tab, self.Contents['" + DataType.TAB_ARCH_COMMON + "']." + key + ')'\r
+                            eval(Command)\r
+                            continue\r
 \r
-  def showDsc(self):\r
-    print TAB_SECTION_START + TAB_INF_DEFINES + TAB_SECTION_END\r
-    printDict(self.Defines.DefinesDictionary)\r
+    def showDsc(self):\r
+        print TAB_SECTION_START + TAB_INF_DEFINES + TAB_SECTION_END\r
+        printDict(self.Defines.DefinesDictionary)\r
 \r
-    for key in self.KeyList:\r
-      for arch in DataType.ARCH_LIST_FULL:\r
-        Command = "printList(TAB_SECTION_START + '" + \\r
-                  key + DataType.TAB_SPLIT + arch + \\r
-                  "' + TAB_SECTION_END, self.Contents[arch]." + key + ')'\r
-        eval(Command)\r
-    \r
+        for key in self.KeyList:\r
+            for arch in DataType.ARCH_LIST_FULL:\r
+                Command = "printList(TAB_SECTION_START + '" + \\r
+                                    key + DataType.TAB_SPLIT + arch + \\r
+                                    "' + TAB_SECTION_END, self.Contents[arch]." + key + ')'\r
+                eval(Command)\r
+        \r
 if __name__ == '__main__':\r
-  p = Dsc()\r
-  directory = 'C:\MyWorkspace\\EdkModulePkg'\r
-  fileList = []\r
-  for f in os.listdir(directory):\r
-    if os.path.splitext(os.path.normcase(f))[1] == '.dsc':\r
-      fileList.append(os.path.join(directory, os.path.normcase(f)))\r
-      \r
-  for f in fileList:\r
-    p.LoadDscFile(f)\r
-    p.MergeAllArches()\r
-    p.showDsc()\r
+    p = Dsc()\r
+    directory = 'C:\MyWorkspace\\EdkModulePkg'\r
+    fileList = []\r
+    for f in os.listdir(directory):\r
+        if os.path.splitext(os.path.normcase(f))[1] == '.dsc':\r
+            fileList.append(os.path.join(directory, os.path.normcase(f)))\r
+            \r
+    for f in fileList:\r
+        p.LoadDscFile(f)\r
+        p.MergeAllArches()\r
+        p.showDsc()\r
index fcd54e7..c0062c7 100644 (file)
@@ -1,7 +1,7 @@
 # Copyright (c) 2007, Intel Corporation\r
 # All rights reserved. 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
+# which accompanies this 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
@@ -15,181 +15,181 @@ import os, sys, time
 from DataType import *\r
 \r
 class EdkIIWorkspace:\r
-  def __init__(self):\r
-    """Collect WorkspaceDir from the environment, the Verbose command line flag, and detect an icon bitmap file."""\r
-\r
-    self.StartTime = time.time()\r
-    self.PrintRunTime   = False\r
-    self.PrintRunStatus = False\r
-    self.RunStatus      = ''\r
-    \r
-    if os.environ.get('WORKSPACE') == None:\r
-      print 'ERROR: WORKSPACE not defined.  Please run EdkSetup from the EDK II install directory.'\r
-      return False\r
-\r
-    self.CurrentWorkingDir = os.getcwd()\r
-    \r
-    self.WorkspaceDir = os.path.realpath(os.environ.get('WORKSPACE'))\r
-    (Drive, Path) = os.path.splitdrive(self.WorkspaceDir)\r
-    if Drive == '':\r
-      (Drive, CwdPath) = os.path.splitdrive(self.CurrentWorkingDir)\r
-      if Drive != '':\r
-        self.WorkspaceDir = Drive + Path\r
-    else:\r
-      self.WorkspaceDir = Drive.upper() + Path\r
-\r
-    self.WorkspaceRelativeWorkingDir = self.WorkspaceRelativePath (self.CurrentWorkingDir)\r
-      \r
-    try:\r
-      self.Icon = wx.Icon(self.WorkspaceFile('tools/Python/TianoCoreOrgLogo.gif'),wx.BITMAP_TYPE_GIF)\r
-    except:\r
-      self.Icon = None\r
-      \r
-    self.Verbose = False\r
-    for arg in sys.argv:\r
-      if arg.lower() == '-v':\r
-        self.Verbose = True      \r
-\r
-    #return True\r
-\r
-  def Close(self):\r
-    if self.PrintRunTime:\r
-      Seconds = int(time.time() - self.StartTime)\r
-      if Seconds < 60:\r
-        print 'Run Time: %d seconds' % (Seconds)\r
-      else:\r
-        Minutes = Seconds / 60\r
-        Seconds = Seconds % 60\r
-        if Minutes < 60:\r
-          print 'Run Time: %d minutes %d seconds' % (Minutes, Seconds)\r
+    def __init__(self):\r
+        """Collect WorkspaceDir from the environment, the Verbose command line flag, and detect an icon bitmap file."""\r
+\r
+        self.StartTime = time.time()\r
+        self.PrintRunTime     = False\r
+        self.PrintRunStatus = False\r
+        self.RunStatus            = ''\r
+        \r
+        if os.environ.get('WORKSPACE') == None:\r
+            print 'ERROR: WORKSPACE not defined.    Please run EdkSetup from the EDK II install directory.'\r
+            return False\r
+\r
+        self.CurrentWorkingDir = os.getcwd()\r
+        \r
+        self.WorkspaceDir = os.path.realpath(os.environ.get('WORKSPACE'))\r
+        (Drive, Path) = os.path.splitdrive(self.WorkspaceDir)\r
+        if Drive == '':\r
+            (Drive, CwdPath) = os.path.splitdrive(self.CurrentWorkingDir)\r
+            if Drive != '':\r
+                self.WorkspaceDir = Drive + Path\r
         else:\r
-          Hours = Minutes / 60\r
-          Minutes = Minutes % 60\r
-          print 'Run Time: %d hours %d minutes %d seconds' % (Hours, Minutes, Seconds)\r
-    if self.RunStatus != '':\r
-      print self.RunStatus\r
-    \r
-  def WorkspaceRelativePath(self, FileName):\r
-    """Convert a full path filename to a workspace relative filename."""\r
-    FileName = os.path.realpath(FileName)\r
-    if FileName.find(self.WorkspaceDir) != 0:\r
-      return None\r
-    return FileName.replace (self.WorkspaceDir, '').strip('\\').strip('/')\r
-\r
-  def WorkspaceFile(self, FileName):\r
-    """Convert a workspace relative filename to a full path filename."""\r
-    return os.path.realpath(os.path.join(self.WorkspaceDir,FileName))\r
-\r
-  def WorkspacePathConvert(self, FileName):\r
-    """Convert ${WORKSPACE} to real path"""\r
-    return os.path.realpath(FileName.replace(TAB_WORKSPACE, self.WorkspaceDir))\r
-    \r
-  def XmlParseFile (self, FileName):\r
-    """Parse an XML file into a DOM and return the DOM."""\r
-    if self.Verbose:\r
-      print FileName\r
-    return XmlParseFile (self.WorkspaceFile(FileName))\r
+            self.WorkspaceDir = Drive.upper() + Path\r
+\r
+        self.WorkspaceRelativeWorkingDir = self.WorkspaceRelativePath (self.CurrentWorkingDir)\r
+            \r
+        try:\r
+            self.Icon = wx.Icon(self.WorkspaceFile('tools/Python/TianoCoreOrgLogo.gif'),wx.BITMAP_TYPE_GIF)\r
+        except:\r
+            self.Icon = None\r
+            \r
+        self.Verbose = False\r
+        for arg in sys.argv:\r
+            if arg.lower() == '-v':\r
+                self.Verbose = True            \r
+\r
+        #return True\r
+\r
+    def Close(self):\r
+        if self.PrintRunTime:\r
+            Seconds = int(time.time() - self.StartTime)\r
+            if Seconds < 60:\r
+                print 'Run Time: %d seconds' % (Seconds)\r
+            else:\r
+                Minutes = Seconds / 60\r
+                Seconds = Seconds % 60\r
+                if Minutes < 60:\r
+                    print 'Run Time: %d minutes %d seconds' % (Minutes, Seconds)\r
+                else:\r
+                    Hours = Minutes / 60\r
+                    Minutes = Minutes % 60\r
+                    print 'Run Time: %d hours %d minutes %d seconds' % (Hours, Minutes, Seconds)\r
+        if self.RunStatus != '':\r
+            print self.RunStatus\r
+        \r
+    def WorkspaceRelativePath(self, FileName):\r
+        """Convert a full path filename to a workspace relative filename."""\r
+        FileName = os.path.realpath(FileName)\r
+        if FileName.find(self.WorkspaceDir) != 0:\r
+            return None\r
+        return FileName.replace (self.WorkspaceDir, '').strip('\\').strip('/')\r
+\r
+    def WorkspaceFile(self, FileName):\r
+        """Convert a workspace relative filename to a full path filename."""\r
+        return os.path.realpath(os.path.join(self.WorkspaceDir,FileName))\r
+\r
+    def WorkspacePathConvert(self, FileName):\r
+        """Convert ${WORKSPACE} to real path"""\r
+        return os.path.realpath(FileName.replace(TAB_WORKSPACE, self.WorkspaceDir))\r
+        \r
+    def XmlParseFile (self, FileName):\r
+        """Parse an XML file into a DOM and return the DOM."""\r
+        if self.Verbose:\r
+            print FileName\r
+        return XmlParseFile (self.WorkspaceFile(FileName))\r
+        \r
+    def XmlParseFileSection (self, FileName, SectionTag):\r
+        """Parse a section of an XML file into a DOM(Document Object Model) and return the DOM."""\r
+        if self.Verbose:\r
+            print FileName\r
+        return XmlParseFileSection (self.WorkspaceFile(FileName), SectionTag)        \r
+\r
+    def XmlSaveFile (self, Dom, FileName):\r
+        """Save a DOM(Document Object Model) into an XML file."""\r
+        if self.Verbose:\r
+            print FileName\r
+        return XmlSaveFile (Dom, self.WorkspaceFile(FileName))\r
+\r
+    def ConvertTextFileToDictionary(self, FileName, Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter):\r
+        """Convert a workspace relative text file to a dictionary of (name:value) pairs."""\r
+        if self.Verbose:\r
+            print FileName\r
+        return ConvertTextFileToDictionary(self.WorkspaceFile(FileName), Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter)\r
     \r
-  def XmlParseFileSection (self, FileName, SectionTag):\r
-    """Parse a section of an XML file into a DOM(Document Object Model) and return the DOM."""\r
-    if self.Verbose:\r
-      print FileName\r
-    return XmlParseFileSection (self.WorkspaceFile(FileName), SectionTag)    \r
-\r
-  def XmlSaveFile (self, Dom, FileName):\r
-    """Save a DOM(Document Object Model) into an XML file."""\r
-    if self.Verbose:\r
-      print FileName\r
-    return XmlSaveFile (Dom, self.WorkspaceFile(FileName))\r
-\r
-  def ConvertTextFileToDictionary(self, FileName, Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter):\r
-    """Convert a workspace relative text file to a dictionary of (name:value) pairs."""\r
-    if self.Verbose:\r
-      print FileName\r
-    return ConvertTextFileToDictionary(self.WorkspaceFile(FileName), Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter)\r
-  \r
-  def ConvertDictionaryToTextFile(self, FileName, Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter):\r
-    """Convert a dictionary of (name:value) pairs to a workspace relative text file."""\r
-    if self.Verbose:\r
-      print FileName\r
-    return ConvertDictionaryToTextFile(self.WorkspaceFile(FileName), Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter)\r
+    def ConvertDictionaryToTextFile(self, FileName, Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter):\r
+        """Convert a dictionary of (name:value) pairs to a workspace relative text file."""\r
+        if self.Verbose:\r
+            print FileName\r
+        return ConvertDictionaryToTextFile(self.WorkspaceFile(FileName), Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter)\r
 \r
 #\r
 # Convert a text file to a dictionary\r
 #\r
 def ConvertTextFileToDictionary(FileName, Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter):\r
-  """Convert a text file to a dictionary of (name:value) pairs."""\r
-  try:\r
-    f = open(FileName,'r')\r
-  except:\r
-    return False\r
-  Keys = []\r
-  for Line in f:\r
-    LineList = Line.split(KeySplitCharacter,1)\r
-    if len(LineList) >= 2:\r
-      Key = LineList[0].split()\r
-      if len(Key) == 1 and Key[0][0] != CommentCharacter and Key[0] not in Keys: \r
-        if ValueSplitFlag:\r
-          Dictionary[Key[0]] = LineList[1].replace('\\','/').split(ValueSplitCharacter)\r
-        else:\r
-          Dictionary[Key[0]] = LineList[1].strip().replace('\\','/')\r
-        Keys += [Key[0]]\r
-  f.close()\r
-  return True\r
+    """Convert a text file to a dictionary of (name:value) pairs."""\r
+    try:\r
+        f = open(FileName,'r')\r
+    except:\r
+        return False\r
+    Keys = []\r
+    for Line in f:\r
+        LineList = Line.split(KeySplitCharacter,1)\r
+        if len(LineList) >= 2:\r
+            Key = LineList[0].split()\r
+            if len(Key) == 1 and Key[0][0] != CommentCharacter and Key[0] not in Keys: \r
+                if ValueSplitFlag:\r
+                    Dictionary[Key[0]] = LineList[1].replace('\\','/').split(ValueSplitCharacter)\r
+                else:\r
+                    Dictionary[Key[0]] = LineList[1].strip().replace('\\','/')\r
+                Keys += [Key[0]]\r
+    f.close()\r
+    return True\r
 \r
 def ConvertDictionaryToTextFile(FileName, Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter):\r
-  """Convert a dictionary of (name:value) pairs to a text file."""\r
-  try:\r
-    f = open(FileName,'r')\r
-    Lines = []\r
-    Lines = f.readlines()\r
-    f.close()\r
-  except:\r
-    Lines = []\r
-  Keys = Dictionary.keys()\r
-  MaxLength = 0\r
-  for Key in Keys:\r
-    if len(Key) > MaxLength:\r
-      MaxLength = len(Key)\r
-  Index = 0\r
-  for Line in Lines:\r
-    LineList = Line.split(KeySplitCharacter,1)\r
-    if len(LineList) >= 2:\r
-      Key = LineList[0].split()\r
-      if len(Key) == 1 and Key[0][0] != CommentCharacter and Key[0] in Dictionary:\r
+    """Convert a dictionary of (name:value) pairs to a text file."""\r
+    try:\r
+        f = open(FileName,'r')\r
+        Lines = []\r
+        Lines = f.readlines()\r
+        f.close()\r
+    except:\r
+        Lines = []\r
+    Keys = Dictionary.keys()\r
+    MaxLength = 0\r
+    for Key in Keys:\r
+        if len(Key) > MaxLength:\r
+            MaxLength = len(Key)\r
+    Index = 0\r
+    for Line in Lines:\r
+        LineList = Line.split(KeySplitCharacter,1)\r
+        if len(LineList) >= 2:\r
+            Key = LineList[0].split()\r
+            if len(Key) == 1 and Key[0][0] != CommentCharacter and Key[0] in Dictionary:\r
+                if ValueSplitFlag:\r
+                    Line = '%-*s %c %s\n' % (MaxLength, Key[0], KeySplitCharacter, ' '.join(Dictionary[Key[0]]))\r
+                else:\r
+                    Line = '%-*s %c %s\n' % (MaxLength, Key[0], KeySplitCharacter, Dictionary[Key[0]])\r
+                Lines.pop(Index)\r
+                if Key[0] in Keys:\r
+                    Lines.insert(Index,Line)\r
+                    Keys.remove(Key[0])\r
+        Index += 1\r
+    for RemainingKey in Keys:\r
         if ValueSplitFlag:\r
-          Line = '%-*s %c %s\n' % (MaxLength, Key[0], KeySplitCharacter, ' '.join(Dictionary[Key[0]]))\r
+            Line = '%-*s %c %s\n' % (MaxLength, RemainingKey, KeySplitCharacter,' '.join(Dictionary[RemainingKey])) \r
         else:\r
-          Line = '%-*s %c %s\n' % (MaxLength, Key[0], KeySplitCharacter, Dictionary[Key[0]])\r
-        Lines.pop(Index)\r
-        if Key[0] in Keys:\r
-          Lines.insert(Index,Line)\r
-          Keys.remove(Key[0])\r
-    Index += 1\r
-  for RemainingKey in Keys:\r
-    if ValueSplitFlag:\r
-      Line = '%-*s %c %s\n' % (MaxLength, RemainingKey, KeySplitCharacter,' '.join(Dictionary[RemainingKey])) \r
-    else:\r
-      Line = '%-*s %c %s\n' % (MaxLength, RemainingKey, KeySplitCharacter, Dictionary[RemainingKey])\r
-    Lines.append(Line)\r
-  try:\r
-    f = open(FileName,'w')\r
-  except:\r
-    return False\r
-  f.writelines(Lines)\r
-  f.close()\r
-  return True\r
+            Line = '%-*s %c %s\n' % (MaxLength, RemainingKey, KeySplitCharacter, Dictionary[RemainingKey])\r
+        Lines.append(Line)\r
+    try:\r
+        f = open(FileName,'w')\r
+    except:\r
+        return False\r
+    f.writelines(Lines)\r
+    f.close()\r
+    return True\r
 \r
 def CreateDirectory(Directory):\r
-  if not os.access(Directory, os.F_OK):\r
-    os.makedirs (Directory)\r
-  \r
+    if not os.access(Directory, os.F_OK):\r
+        os.makedirs (Directory)\r
+    \r
 def CreateFile(Directory, FileName, mode='w'):\r
-  CreateDirectory (Directory)\r
-  return open(os.path.join(Directory, FileName), mode)\r
+    CreateDirectory (Directory)\r
+    return open(os.path.join(Directory, FileName), mode)\r
 \r
 # This acts like the main() function for the script, unless it is 'import'ed into another\r
 # script.\r
 if __name__ == '__main__':\r
-  # Nothing to do here. Could do some unit tests\r
-  pass
\ No newline at end of file
+    # Nothing to do here. Could do some unit tests\r
+    pass
\ No newline at end of file
index ba681ae..64fbb90 100644 (file)
@@ -1,7 +1,7 @@
 # Copyright (c) 2007, Intel Corporation\r
 # All rights reserved. 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
+# which accompanies this 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
@@ -26,537 +26,539 @@ from DscClassObject import *
 from String import *\r
 \r
 class ModuleSourceFilesClassObject(object):\r
-  def __init__(self, Item):\r
-    self.SourceFile            = Item\r
-    self.TagName               = ''\r
-    self.ToolCode              = ''\r
-    self.ToolChainFamily       = ''\r
-    \r
+    def __init__(self, Item):\r
+        self.SourceFile         = Item\r
+        self.TagName            = ''\r
+        self.ToolCode           = ''\r
+        self.ToolChainFamily    = ''\r
+        \r
 class PcdClassObject(object):\r
-  def __init__(self, Name = None, Guid = None, Type = None, DatumType = None, Value = None, Token = None, MaxDatumSize = None):\r
-    self.TokenCName = Name\r
-    self.TokenSpaceGuidCName = Guid\r
-    self.Type = Type\r
-    self.DatumType = DatumType\r
-    self.DefaultValue = Value\r
-    self.TokenValue = Token\r
-    self.MaxDatumSize = MaxDatumSize\r
+    def __init__(self, Name = None, Guid = None, Type = None, DatumType = None, Value = None, Token = None, MaxDatumSize = None):\r
+        self.TokenCName = Name\r
+        self.TokenSpaceGuidCName = Guid\r
+        self.Type = Type\r
+        self.DatumType = DatumType\r
+        self.DefaultValue = Value\r
+        self.TokenValue = Token\r
+        self.MaxDatumSize = MaxDatumSize\r
 \r
 class LibraryClassObject(object):\r
-  def __init__(self, Name = None, Type = None):\r
-    self.LibraryClass = Name\r
-    self.SupModList = []\r
-    if Type != None:\r
-      self.SupModList = CleanString(Type).split(DataType.TAB_SPACE_SPLIT)\r
-    \r
+    def __init__(self, Name = None, Type = None):\r
+        self.LibraryClass = Name\r
+        self.SupModList = []\r
+        if Type != None:\r
+            self.SupModList = CleanString(Type).split(DataType.TAB_SPACE_SPLIT)\r
+        \r
 class ModuleBuildClassObject(object):\r
-  def __init__(self):\r
-    self.DescFilePath          = ''\r
-    self.BaseName              = ''\r
-    self.ModuleType            = ''\r
-    self.Guid                  = ''\r
-    self.Version               = ''\r
-    self.Specification         = ''\r
-    self.LibraryClass          = None      # LibraryClassObject\r
-    self.ModuleEntryPointList  = []\r
-    self.ModuleUnloadImageList = []\r
-    self.ConstructorList       = []\r
-    self.DestructorList        = []\r
-    \r
-    self.Sources               = []        #[ SourcesClassObject, ... ]\r
-    self.LibraryClasses        = {}        #{ [LibraryClassName, ModuleType] : LibraryClassInfFile }\r
-    self.Protocols             = []        #[ ProtocolName, ... ]\r
-    self.Ppis                  = []        #[ PpiName, ... ]\r
-    self.Guids                 = []        #[ GuidName, ... ]\r
-    self.Includes              = []        #[ IncludePath, ... ]\r
-    self.Packages              = []        #[ DecFileName, ... ]\r
-    self.Pcds                  = {}        #{ [(PcdCName, PcdGuidCName)] : PcdClassObject}\r
-    self.BuildOptions          = {}        #{ [BuildOptionKey] : BuildOptionValue}\r
+    def __init__(self):\r
+        self.DescFilePath            = ''\r
+        self.BaseName                = ''\r
+        self.ModuleType              = ''\r
+        self.Guid                    = ''\r
+        self.Version                 = ''\r
+        self.Specification           = {}\r
+        self.LibraryClass            = None      # LibraryClassObject\r
+        self.ModuleEntryPointList    = []\r
+        self.ModuleUnloadImageList   = []\r
+        self.ConstructorList         = []\r
+        self.DestructorList          = []\r
+        \r
+        self.Sources                 = []        #[ SourcesClassObject, ... ]\r
+        self.LibraryClasses          = {}        #{ [LibraryClassName, ModuleType] : LibraryClassInfFile }\r
+        self.Protocols               = []        #[ ProtocolName, ... ]\r
+        self.Ppis                    = []        #[ PpiName, ... ]\r
+        self.Guids                   = []        #[ GuidName, ... ]\r
+        self.Includes                = []        #[ IncludePath, ... ]\r
+        self.Packages                = []        #[ DecFileName, ... ]\r
+        self.Pcds                    = {}        #{ [(PcdCName, PcdGuidCName)] : PcdClassObject}\r
+        self.BuildOptions            = {}        #{ [BuildOptionKey] : BuildOptionValue}\r
 \r
-  def __str__(self):\r
-    return self.DescFilePath\r
+    def __str__(self):\r
+        return self.DescFilePath\r
 \r
-  def __eq__(self, other):\r
-    return self.DescFilePath == other.DescFilePath\r
+    def __eq__(self, other):\r
+        return self.DescFilePath == other.DescFilePath\r
 \r
-  def __hash__(self):\r
-    return hash(self.DescFilePath)\r
+    def __hash__(self):\r
+        return hash(self.DescFilePath)\r
 \r
 class PackageBuildClassObject(object):\r
-  def __init__(self):\r
-    self.DescFilePath          = ''\r
-    self.PackageName           = ''\r
-    self.Guid                  = ''\r
-    self.Version               = ''\r
-    \r
-    self.Protocols             = {}        #{ [ProtocolName] : Protocol Guid, ... }\r
-    self.Ppis                  = {}        #{ [PpiName] : Ppi Guid, ... }\r
-    self.Guids                 = {}        #{ [GuidName] : Guid, ... }\r
-    self.Includes              = []        #[ IncludePath, ... ]    \r
-    self.LibraryClasses        = {}        #{ [LibraryClassName] : LibraryClassInfFile }\r
-    self.Pcds                  = {}        #{ [(PcdCName, PcdGuidCName)] : PcdClassObject}\r
-    \r
-  def __str__(self):\r
-    return self.DescFilePath\r
+    def __init__(self):\r
+        self.DescFilePath            = ''\r
+        self.PackageName             = ''\r
+        self.Guid                    = ''\r
+        self.Version                 = ''\r
+        \r
+        self.Protocols               = {}       #{ [ProtocolName] : Protocol Guid, ... }\r
+        self.Ppis                    = {}       #{ [PpiName] : Ppi Guid, ... }\r
+        self.Guids                   = {}       #{ [GuidName] : Guid, ... }\r
+        self.Includes                = []       #[ IncludePath, ... ]        \r
+        self.LibraryClasses          = {}       #{ [LibraryClassName] : LibraryClassInfFile }\r
+        self.Pcds                    = {}       #{ [(PcdCName, PcdGuidCName)] : PcdClassObject}\r
+        \r
+    def __str__(self):\r
+        return self.DescFilePath\r
 \r
-  def __eq__(self, other):\r
-    return self.DescFilePath == other.DescFilePath\r
+    def __eq__(self, other):\r
+        return self.DescFilePath == other.DescFilePath\r
 \r
-  def __hash__(self):\r
-    return hash(self.DescFilePath)\r
+    def __hash__(self):\r
+        return hash(self.DescFilePath)\r
 \r
 class PlatformBuildClassObject(object):\r
-  def __init__(self):\r
-    self.DescFilePath          = ''\r
-    self.PlatformName          = ''\r
-    self.Guid                  = ''\r
-    self.Version               = ''\r
-    self.OutputDirectory       = ''\r
-    \r
-    self.Modules               = []        #[ InfFileName, ... ]\r
-    self.LibraryClasses        = {}        #{ (LibraryClassName, ModuleType) : LibraryClassInfFile }\r
-    self.Pcds                  = {}        #{ [(PcdCName, PcdGuidCName)] : PcdClassObject }\r
-    self.BuildOptions          = {}        #{ [BuildOptionKey] : BuildOptionValue }  \r
+    def __init__(self):\r
+        self.DescFilePath            = ''\r
+        self.PlatformName            = ''\r
+        self.Guid                    = ''\r
+        self.Version                 = ''\r
+        self.OutputDirectory         = ''\r
+        \r
+        self.Modules                 = []       #[ InfFileName, ... ]\r
+        self.LibraryClasses          = {}       #{ (LibraryClassName, ModuleType) : LibraryClassInfFile }\r
+        self.Pcds                    = {}       #{ [(PcdCName, PcdGuidCName)] : PcdClassObject }\r
+        self.BuildOptions            = {}       #{ [BuildOptionKey] : BuildOptionValue }    \r
 \r
-  def __str__(self):\r
-    return self.DescFilePath\r
+    def __str__(self):\r
+        return self.DescFilePath\r
 \r
-  def __eq__(self, other):\r
-    return self.DescFilePath == other.DescFilePath\r
+    def __eq__(self, other):\r
+        return self.DescFilePath == other.DescFilePath\r
 \r
-  def __hash__(self):\r
-    return hash(self.DescFilePath)\r
+    def __hash__(self):\r
+        return hash(self.DescFilePath)\r
 \r
 class ItemBuild(object):\r
-  def __init__(self, arch, platform = None, package = None, module = None):\r
-    self.Arch                  = arch\r
-    self.PlatformDatabase      = {}        #{ [DscFileName] : PlatformBuildClassObject, ...}\r
-    self.PackageDatabase       = {}        #{ [DecFileName] : PacakgeBuildClassObject, ...}\r
-    self.ModuleDatabase        = {}        #{ [InfFileName] : ModuleBuildClassObject, ...}\r
-    \r
+    def __init__(self, arch, platform = None, package = None, module = None):\r
+        self.Arch                    = arch\r
+        self.PlatformDatabase        = {}        #{ [DscFileName] : PlatformBuildClassObject, ...}\r
+        self.PackageDatabase         = {}        #{ [DecFileName] : PacakgeBuildClassObject, ...}\r
+        self.ModuleDatabase          = {}        #{ [InfFileName] : ModuleBuildClassObject, ...}\r
+        \r
 class WorkspaceBuild(object):\r
-  def __init__(self):\r
-    self.Workspace              = EdkIIWorkspace()\r
-    self.PrintRunTime           = True\r
-    self.PlatformBuild          = True\r
-    self.TargetTxt              = TargetTxtClassObject()\r
-    self.ToolDef                = ToolDefClassObject()\r
-    self.InfDatabase            = {}       #{ [InfFileName] : InfClassObject}    \r
-    self.DecDatabase            = {}       #{ [DecFileName] : DecClassObject}\r
-    self.DscDatabase            = {}       #{ [DscFileName] : DscClassObject}\r
-    \r
-    self.Build                  = {}\r
-    for key in DataType.ARCH_LIST:\r
-      self.Build[key] = ItemBuild(key)\r
-    \r
-    self.TargetTxt.LoadTargetTxtFile(self.Workspace.WorkspaceFile('Tools/Conf/target.txt'))\r
-    self.ToolDef.LoadToolDefFile(self.Workspace.WorkspaceFile('Tools/Conf/tools_def.txt'))\r
-    \r
-    #get active platform\r
-    dscFileName = NormPath(self.TargetTxt.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_ACTIVE_PLATFORM][0])\r
-    file = self.Workspace.WorkspaceFile(dscFileName)\r
-    if os.path.exists(file) and os.path.isfile(file):\r
-      self.DscDatabase[dscFileName] = Dsc(file, True)\r
-    else:\r
-      EdkLogger.error('No Active Platform')\r
-      return\r
-    \r
-    #parse platform to get module\r
-    for dsc in self.DscDatabase.keys():\r
-      dscObj = self.DscDatabase[dsc]\r
-      #Get all inf\r
-      for key in DataType.ARCH_LIST:\r
-        for index in range(len(dscObj.Contents[key].LibraryClasses)):\r
-          self.AddToInfDatabase(dscObj.Contents[key].LibraryClasses[index][0].split(DataType.TAB_VALUE_SPLIT, 1)[1])\r
-        for index in range(len(dscObj.Contents[key].Components)):\r
-          self.AddToInfDatabase(dscObj.Contents[key].Components[index][0])\r
+    def __init__(self):\r
+        self.Workspace               = EdkIIWorkspace()\r
+        self.PrintRunTime            = True\r
+        self.PlatformBuild           = True\r
+        self.TargetTxt               = TargetTxtClassObject()\r
+        self.ToolDef                 = ToolDefClassObject()\r
+        self.InfDatabase             = {}        #{ [InfFileName] : InfClassObject}        \r
+        self.DecDatabase             = {}        #{ [DecFileName] : DecClassObject}\r
+        self.DscDatabase             = {}        #{ [DscFileName] : DscClassObject}\r
         \r
-    #End For of Dsc\r
-    \r
-    #parse module to get package\r
-    for inf in self.InfDatabase.keys():\r
-      infObj = self.InfDatabase[inf]\r
-      #Get all dec\r
-      for key in DataType.ARCH_LIST:\r
-        for index in range(len(infObj.Contents[key].Packages)):\r
-          self.AddToDecDatabase(infObj.Contents[key].Packages[index])\r
-    \r
-    #Build databases\r
-    #Build PlatformDatabase\r
-    for dsc in self.DscDatabase.keys():\r
-      dscObj = self.DscDatabase[dsc]\r
-      \r
-      for key in DataType.ARCH_LIST:\r
-        pb = PlatformBuildClassObject()\r
-        pb.DescFilePath = dsc\r
-        pb.PlatformName = dscObj.Defines.DefinesDictionary[DataType.TAB_DSC_DEFINES_PLATFORM_NAME]\r
-        pb.Guid = dscObj.Defines.DefinesDictionary[DataType.TAB_DSC_DEFINES_PLATFORM_GUID]\r
-        pb.Version = dscObj.Defines.DefinesDictionary[DataType.TAB_DSC_DEFINES_PLATFORM_VERSION]\r
-        pb.OutputDirectory = NormPath(dscObj.Defines.DefinesDictionary[DataType.TAB_DSC_DEFINES_OUTPUT_DIRECTORY])\r
-      \r
-        #Module\r
-        for index in range(len(dscObj.Contents[key].Components)):\r
-          pb.Modules.append(NormPath(dscObj.Contents[key].Components[index][0]))\r
+        self.Build                   = {}\r
+        for key in DataType.ARCH_LIST:\r
+            self.Build[key] = ItemBuild(key)\r
         \r
-        #BuildOptions\r
-        for index in range(len(dscObj.Contents[key].BuildOptions)):\r
-          b = desObj.Contents[key].BuildOptions[index]\r
-          pb.BuildOptions[CleanString(b.split(DataType.TAB_EQUAL_SPLIT)[0])] = CleanString(b.split(DataType.TAB_EQUAL_SPLIT)[1])\r
-          \r
-        #LibraryClass\r
-        for index in range(len(dscObj.Contents[key].LibraryClasses)):\r
-          #['DebugLib|MdePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf', 'DXE_CORE']\r
-          list = dscObj.Contents[key].LibraryClasses[index][0].split(DataType.TAB_VALUE_SPLIT, 1)\r
-          type = dscObj.Contents[key].LibraryClasses[index][1]\r
-          pb.LibraryClasses[(list[0], type)] = NormPath(list[1])\r
-\r
-        #Pcds\r
-        for index in range(len(dscObj.Contents[key].PcdsFixedAtBuild)):\r
-          pcd = dscObj.Contents[key].PcdsFixedAtBuild[index].split(DataType.TAB_VALUE_SPLIT)\r
-          pb.Pcds[(pcd[0], pcd[1])] = PcdClassObject(pcd[0], pcd[1], DataType.TAB_PCDS_FIXED_AT_BUILD, None, pcd[2], None, None)\r
-        for index in range(len(dscObj.Contents[key].PcdsPatchableInModule)):\r
-          pcd = dscObj.Contents[key].PcdsPatchableInModule[index].split(DataType.TAB_VALUE_SPLIT)\r
-          pb.Pcds[(pcd[0], pcd[1])] = PcdClassObject(pcd[0], pcd[1], DataType.TAB_PCDS_PATCHABLE_IN_MODULE, None, pcd[2], None, None)\r
-        for index in range(len(dscObj.Contents[key].PcdsFeatureFlag)):\r
-          pcd = dscObj.Contents[key].PcdsFeatureFlag[index].split(DataType.TAB_VALUE_SPLIT)\r
-          pb.Pcds[(pcd[0], pcd[1])] = PcdClassObject(pcd[0], pcd[1], DataType.TAB_PCDS_FEATURE_FLAG, None, pcd[2], None, None)\r
-        for index in range(len(dscObj.Contents[key].PcdsDynamic)):\r
-          pcd = dscObj.Contents[key].PcdsDynamic[index].split(DataType.TAB_VALUE_SPLIT)\r
-          pb.Pcds[(pcd[0], pcd[1])] = PcdClassObject(pcd[0], pcd[1], DataType.TAB_PCDS_DYNAMIC, None, pcd[2], None, None)\r
-        for index in range(len(dscObj.Contents[key].PcdsDynamicEx)):\r
-          pcd = dscObj.Contents[key].PcdsDynamicEx[index].split(DataType.TAB_VALUE_SPLIT)\r
-          pb.Pcds[(pcd[0], pcd[1])] = PcdClassObject(pcd[0], pcd[1], DataType.TAB_PCDS_DYNAMIC_EX, None, pcd[2], None, None)\r
+        self.TargetTxt.LoadTargetTxtFile(self.Workspace.WorkspaceFile('Tools/Conf/target.txt'))\r
+        self.ToolDef.LoadToolDefFile(self.Workspace.WorkspaceFile('Tools/Conf/tools_def.txt'))\r
         \r
-        self.Build[key].PlatformDatabase[dsc] = pb\r
-        pb = None  \r
-      #End of Arch List Go Through  \r
+        #get active platform\r
+        dscFileName = NormPath(self.TargetTxt.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_ACTIVE_PLATFORM][0])\r
+        file = self.Workspace.WorkspaceFile(dscFileName)\r
+        if os.path.exists(file) and os.path.isfile(file):\r
+            self.DscDatabase[dscFileName] = Dsc(file, True)\r
+        else:\r
+            EdkLogger.error('No Active Platform')\r
+            return\r
         \r
-    #End of Dsc Go Through\r
-    \r
-    #End of build PlatformDatabase\r
-    \r
-    #Build PackageDatabase\r
-    for dec in self.DecDatabase.keys():\r
-      decObj = self.DecDatabase[dec]\r
-\r
-      for key in DataType.ARCH_LIST:\r
-        pb = PackageBuildClassObject()\r
-        #Defines\r
-        pb.DescFilePath = dec\r
-        pb.PackageName = decObj.Defines.DefinesDictionary[TAB_DEC_DEFINES_PACKAGE_NAME]\r
-        pb.Guid = decObj.Defines.DefinesDictionary[TAB_DEC_DEFINES_PACKAGE_GUID]\r
-        pb.Version = decObj.Defines.DefinesDictionary[TAB_DEC_DEFINES_PACKAGE_VERSION]\r
+        #parse platform to get module\r
+        for dsc in self.DscDatabase.keys():\r
+            dscObj = self.DscDatabase[dsc]\r
+            #Get all inf\r
+            for key in DataType.ARCH_LIST:\r
+                for index in range(len(dscObj.Contents[key].LibraryClasses)):\r
+                    self.AddToInfDatabase(dscObj.Contents[key].LibraryClasses[index][0].split(DataType.TAB_VALUE_SPLIT, 1)[1])\r
+                for index in range(len(dscObj.Contents[key].Components)):\r
+                    self.AddToInfDatabase(dscObj.Contents[key].Components[index][0])\r
+                \r
+        #End For of Dsc\r
         \r
-        #Protocols\r
-        for index in range(len(decObj.Contents[key].Protocols)):\r
-          list = decObj.Contents[key].Protocols[index].split(DataType.TAB_EQUAL_SPLIT)\r
-          pb.Protocols[CleanString(list[0])] = CleanString(list[1])\r
-\r
-        #Ppis\r
-        for index in range(len(decObj.Contents[key].Ppis)):\r
-          list = decObj.Contents[key].Ppis[index].split(DataType.TAB_EQUAL_SPLIT)\r
-          pb.Ppis[CleanString(list[0])] = CleanString(list[1])      \r
+        #parse module to get package\r
+        for inf in self.InfDatabase.keys():\r
+            infObj = self.InfDatabase[inf]\r
+            #Get all dec\r
+            for key in DataType.ARCH_LIST:\r
+                for index in range(len(infObj.Contents[key].Packages)):\r
+                    self.AddToDecDatabase(infObj.Contents[key].Packages[index])\r
+        \r
+        #Build databases\r
+        #Build PlatformDatabase\r
+        for dsc in self.DscDatabase.keys():\r
+            dscObj = self.DscDatabase[dsc]\r
+            \r
+            for key in DataType.ARCH_LIST:\r
+                pb = PlatformBuildClassObject()\r
+                pb.DescFilePath = dsc\r
+                pb.PlatformName = dscObj.Defines.DefinesDictionary[DataType.TAB_DSC_DEFINES_PLATFORM_NAME][0]\r
+                pb.Guid = dscObj.Defines.DefinesDictionary[DataType.TAB_DSC_DEFINES_PLATFORM_GUID][0]\r
+                pb.Version = dscObj.Defines.DefinesDictionary[DataType.TAB_DSC_DEFINES_PLATFORM_VERSION][0]\r
+                pb.OutputDirectory = NormPath(dscObj.Defines.DefinesDictionary[DataType.TAB_DSC_DEFINES_OUTPUT_DIRECTORY][0])\r
+            \r
+                #Module\r
+                for index in range(len(dscObj.Contents[key].Components)):\r
+                    pb.Modules.append(NormPath(dscObj.Contents[key].Components[index][0]))\r
+                \r
+                #BuildOptions\r
+                for index in range(len(dscObj.Contents[key].BuildOptions)):\r
+                    b = desObj.Contents[key].BuildOptions[index]\r
+                    pb.BuildOptions[CleanString(b.split(DataType.TAB_EQUAL_SPLIT)[0])] = CleanString(b.split(DataType.TAB_EQUAL_SPLIT)[1])\r
+                    \r
+                #LibraryClass\r
+                for index in range(len(dscObj.Contents[key].LibraryClasses)):\r
+                    #['DebugLib|MdePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf', 'DXE_CORE']\r
+                    list = dscObj.Contents[key].LibraryClasses[index][0].split(DataType.TAB_VALUE_SPLIT, 1)\r
+                    type = dscObj.Contents[key].LibraryClasses[index][1]\r
+                    pb.LibraryClasses[(list[0], type)] = NormPath(list[1])\r
 \r
-        #Guids\r
-        for index in range(len(decObj.Contents[key].Guids)):\r
-          list = decObj.Contents[key].Guids[index].split(DataType.TAB_EQUAL_SPLIT)\r
-          pb.Guids[CleanString(list[0])] = CleanString(list[1])    \r
+                #Pcds\r
+                for index in range(len(dscObj.Contents[key].PcdsFixedAtBuild)):\r
+                    pcd = dscObj.Contents[key].PcdsFixedAtBuild[index].split(DataType.TAB_VALUE_SPLIT)\r
+                    pb.Pcds[(pcd[0], pcd[1])] = PcdClassObject(pcd[0], pcd[1], DataType.TAB_PCDS_FIXED_AT_BUILD, None, pcd[2], None, None)\r
+                for index in range(len(dscObj.Contents[key].PcdsPatchableInModule)):\r
+                    pcd = dscObj.Contents[key].PcdsPatchableInModule[index].split(DataType.TAB_VALUE_SPLIT)\r
+                    pb.Pcds[(pcd[0], pcd[1])] = PcdClassObject(pcd[0], pcd[1], DataType.TAB_PCDS_PATCHABLE_IN_MODULE, None, pcd[2], None, None)\r
+                for index in range(len(dscObj.Contents[key].PcdsFeatureFlag)):\r
+                    pcd = dscObj.Contents[key].PcdsFeatureFlag[index].split(DataType.TAB_VALUE_SPLIT)\r
+                    pb.Pcds[(pcd[0], pcd[1])] = PcdClassObject(pcd[0], pcd[1], DataType.TAB_PCDS_FEATURE_FLAG, None, pcd[2], None, None)\r
+                for index in range(len(dscObj.Contents[key].PcdsDynamic)):\r
+                    pcd = dscObj.Contents[key].PcdsDynamic[index].split(DataType.TAB_VALUE_SPLIT)\r
+                    pb.Pcds[(pcd[0], pcd[1])] = PcdClassObject(pcd[0], pcd[1], DataType.TAB_PCDS_DYNAMIC, None, pcd[2], None, None)\r
+                for index in range(len(dscObj.Contents[key].PcdsDynamicEx)):\r
+                    pcd = dscObj.Contents[key].PcdsDynamicEx[index].split(DataType.TAB_VALUE_SPLIT)\r
+                    pb.Pcds[(pcd[0], pcd[1])] = PcdClassObject(pcd[0], pcd[1], DataType.TAB_PCDS_DYNAMIC_EX, None, pcd[2], None, None)\r
+                \r
+                self.Build[key].PlatformDatabase[dsc] = pb\r
+                pb = None    \r
+            #End of Arch List Go Through    \r
+                \r
+        #End of Dsc Go Through\r
         \r
-        #Includes\r
-        for index in range(len(decObj.Contents[key].Includes)):\r
-          pb.Includes.append(NormPath(decObj.Contents[key].Includes[index]))\r
-      \r
-        #LibraryClasses\r
-        for index in range(len(decObj.Contents[key].LibraryClasses)):\r
-          list = decObj.Contents[key].LibraryClasses[index].split(DataType.TAB_VALUE_SPLIT)\r
-          pb.LibraryClasses[CleanString(list[0])] = NormPath(CleanString(list[1]))\r
-                        \r
-        #Pcds\r
-        for index in range(len(decObj.Contents[key].PcdsFixedAtBuild)):\r
-          pcd = decObj.Contents[key].PcdsFixedAtBuild[index].split(DataType.TAB_VALUE_SPLIT)\r
-          pb.Pcds[(pcd[0], pcd[2])] = PcdClassObject(pcd[0], pcd[2], DataType.TAB_PCDS_FIXED_AT_BUILD, pcd[3], pcd[4], pcd[1], None)\r
-        for index in range(len(decObj.Contents[key].PcdsPatchableInModule)):\r
-          pcd = decObj.Contents[key].PcdsPatchableInModule[index].split(DataType.TAB_VALUE_SPLIT)\r
-          pb.Pcds[(pcd[0], pcd[2])] = PcdClassObject(pcd[0], pcd[2], DataType.TAB_PCDS_PATCHABLE_IN_MODULE, pcd[3], pcd[4], pcd[1], None)\r
-        for index in range(len(decObj.Contents[key].PcdsFeatureFlag)):\r
-          pcd = decObj.Contents[key].PcdsFeatureFlag[index].split(DataType.TAB_VALUE_SPLIT)\r
-          pb.Pcds[(pcd[0], pcd[2])] = PcdClassObject(pcd[0], pcd[2], DataType.TAB_PCDS_FEATURE_FLAG, pcd[3], pcd[4], pcd[1], None)\r
-        for index in range(len(decObj.Contents[key].PcdsDynamic)):\r
-          pcd = decObj.Contents[key].PcdsDynamic[index].split(DataType.TAB_VALUE_SPLIT)\r
-          pb.Pcds[(pcd[0], pcd[2])] = PcdClassObject(pcd[0], pcd[2], DataType.TAB_PCDS_DYNAMIC, pcd[3], pcd[4], pcd[1], None)\r
-        for index in range(len(decObj.Contents[key].PcdsDynamicEx)):\r
-          pcd = decObj.Contents[key].PcdsDynamicEx[index].split(DataType.TAB_VALUE_SPLIT)\r
-          pb.Pcds[(pcd[0], pcd[2])] = PcdClassObject(pcd[0], pcd[2], DataType.TAB_PCDS_DYNAMIC_EX, pcd[3], pcd[4], pcd[1], None)\r
-      \r
-        #Add to database\r
-        self.Build[key].PackageDatabase[dec] = pb\r
-        pb = None  \r
-      #End of Arch List Go Through\r
-    \r
-    #End of Dec Go Through  \r
-    \r
-    #End of build PackageDatabase\r
-  \r
-    #Build ModuleDatabase\r
-    for inf in self.InfDatabase.keys():\r
-      infObj = self.InfDatabase[inf]\r
-      \r
-      for key in DataType.ARCH_LIST:\r
-        #Defines\r
-        pb = ModuleBuildClassObject()\r
-        pb.DescFilePath = inf\r
-        pb.BaseName = infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_BASE_NAME]\r
-        pb.Guid = infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_FILE_GUID]\r
-        pb.Version = infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_VERSION_STRING]\r
-        pb.ModuleType = infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_MODULE_TYPE]\r
-        pb.Specification = infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_EFI_SPECIFICATION_VERSION]\r
+        #End of build PlatformDatabase\r
         \r
-        LibraryClass = infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_LIBRARY_CLASS]\r
-        if LibraryClass != '':\r
-          l = LibraryClass.split(DataType.TAB_VALUE_SPLIT)\r
-          if len(l) == 2:\r
-            pb.LibraryClass = LibraryClassObject(l[0], l[1])\r
-          elif len(l) == 1:\r
-            pb.LibraryClass = LibraryClassObject(l[0], DataType.SUP_MODULE_LIST_STRING)\r
+        #Build PackageDatabase\r
+        for dec in self.DecDatabase.keys():\r
+            decObj = self.DecDatabase[dec]\r
 \r
-        pb.ModuleEntryPointList.extend(infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_ENTRY_POINT])\r
-        pb.ModuleUnloadImageList.extend(infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_UNLOAD_IMAGE])\r
-        pb.ConstructorList.extend(infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_CONSTRUCTOR])\r
-        pb.DestructorList.extend(infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_DESTRUCTOR])\r
+            for key in DataType.ARCH_LIST:\r
+                pb = PackageBuildClassObject()\r
+                #Defines\r
+                pb.DescFilePath = dec\r
+                pb.PackageName = decObj.Defines.DefinesDictionary[TAB_DEC_DEFINES_PACKAGE_NAME][0]\r
+                pb.Guid = decObj.Defines.DefinesDictionary[TAB_DEC_DEFINES_PACKAGE_GUID][0]\r
+                pb.Version = decObj.Defines.DefinesDictionary[TAB_DEC_DEFINES_PACKAGE_VERSION][0]\r
+                \r
+                #Protocols\r
+                for index in range(len(decObj.Contents[key].Protocols)):\r
+                    list = decObj.Contents[key].Protocols[index].split(DataType.TAB_EQUAL_SPLIT)\r
+                    pb.Protocols[CleanString(list[0])] = CleanString(list[1])\r
 \r
-        #Sources\r
-        for index in range(len(infObj.Contents[key].Sources)):\r
-          pb.Sources.append(ModuleSourceFilesClassObject(NormPath(infObj.Contents[key].Sources[index])))\r
+                #Ppis\r
+                for index in range(len(decObj.Contents[key].Ppis)):\r
+                    list = decObj.Contents[key].Ppis[index].split(DataType.TAB_EQUAL_SPLIT)\r
+                    pb.Ppis[CleanString(list[0])] = CleanString(list[1])            \r
 \r
-        #Protocols\r
-        for index in range(len(infObj.Contents[key].Protocols)):\r
-          pb.Protocols.append(infObj.Contents[key].Protocols[index])\r
-      \r
-        #Ppis\r
-        for index in range(len(infObj.Contents[key].Ppis)):\r
-          pb.Ppis.append(infObj.Contents[key].Ppis[index])\r
+                #Guids\r
+                for index in range(len(decObj.Contents[key].Guids)):\r
+                    list = decObj.Contents[key].Guids[index].split(DataType.TAB_EQUAL_SPLIT)\r
+                    pb.Guids[CleanString(list[0])] = CleanString(list[1])        \r
                 \r
-        #Guids\r
-        for index in range(len(infObj.Contents[key].Guids)):\r
-          pb.Guids.append(infObj.Contents[key].Guids[index])\r
-      \r
-        #Includes\r
-        for index in range(len(infObj.Contents[key].Includes)):\r
-          pb.Includes.append(NormPath(infObj.Contents[key].Includes[index]))\r
-      \r
-        #Packages\r
-        for index in range(len(infObj.Contents[key].Packages)):\r
-          pb.Packages.append(NormPath(infObj.Contents[key].Packages[index]))\r
-          \r
-        #BuildOptions\r
-        for index in range(len(infObj.Contents[key].BuildOptions)):\r
-          b = infObj.Contents[key].BuildOptions[index]\r
-          pb.BuildOptions[CleanString(b.split(DataType.TAB_EQUAL_SPLIT)[0])] = CleanString(b.split(DataType.TAB_EQUAL_SPLIT)[1])\r
-        self.FindBuildOptions(key, inf, pb.BuildOptions)\r
+                #Includes\r
+                for index in range(len(decObj.Contents[key].Includes)):\r
+                    pb.Includes.append(NormPath(decObj.Contents[key].Includes[index]))\r
+            \r
+                #LibraryClasses\r
+                for index in range(len(decObj.Contents[key].LibraryClasses)):\r
+                    list = decObj.Contents[key].LibraryClasses[index].split(DataType.TAB_VALUE_SPLIT)\r
+                    pb.LibraryClasses[CleanString(list[0])] = NormPath(CleanString(list[1]))\r
+                                                \r
+                #Pcds\r
+                for index in range(len(decObj.Contents[key].PcdsFixedAtBuild)):\r
+                    pcd = decObj.Contents[key].PcdsFixedAtBuild[index].split(DataType.TAB_VALUE_SPLIT)\r
+                    pb.Pcds[(pcd[0], pcd[2])] = PcdClassObject(pcd[0], pcd[2], DataType.TAB_PCDS_FIXED_AT_BUILD, pcd[3], pcd[4], pcd[1], None)\r
+                for index in range(len(decObj.Contents[key].PcdsPatchableInModule)):\r
+                    pcd = decObj.Contents[key].PcdsPatchableInModule[index].split(DataType.TAB_VALUE_SPLIT)\r
+                    pb.Pcds[(pcd[0], pcd[2])] = PcdClassObject(pcd[0], pcd[2], DataType.TAB_PCDS_PATCHABLE_IN_MODULE, pcd[3], pcd[4], pcd[1], None)\r
+                for index in range(len(decObj.Contents[key].PcdsFeatureFlag)):\r
+                    pcd = decObj.Contents[key].PcdsFeatureFlag[index].split(DataType.TAB_VALUE_SPLIT)\r
+                    pb.Pcds[(pcd[0], pcd[2])] = PcdClassObject(pcd[0], pcd[2], DataType.TAB_PCDS_FEATURE_FLAG, pcd[3], pcd[4], pcd[1], None)\r
+                for index in range(len(decObj.Contents[key].PcdsDynamic)):\r
+                    pcd = decObj.Contents[key].PcdsDynamic[index].split(DataType.TAB_VALUE_SPLIT)\r
+                    pb.Pcds[(pcd[0], pcd[2])] = PcdClassObject(pcd[0], pcd[2], DataType.TAB_PCDS_DYNAMIC, pcd[3], pcd[4], pcd[1], None)\r
+                for index in range(len(decObj.Contents[key].PcdsDynamicEx)):\r
+                    pcd = decObj.Contents[key].PcdsDynamicEx[index].split(DataType.TAB_VALUE_SPLIT)\r
+                    pb.Pcds[(pcd[0], pcd[2])] = PcdClassObject(pcd[0], pcd[2], DataType.TAB_PCDS_DYNAMIC_EX, pcd[3], pcd[4], pcd[1], None)\r
+            \r
+                #Add to database\r
+                self.Build[key].PackageDatabase[dec] = pb\r
+                pb = None    \r
+            #End of Arch List Go Through\r
+        \r
+        #End of Dec Go Through    \r
         \r
-        #LibraryClasses\r
-        for index in range(len(infObj.Contents[key].LibraryClasses)):\r
-          #Get LibraryClass name and default instance if existing\r
-          list = infObj.Contents[key].LibraryClasses[index].split(DataType.TAB_VALUE_SPLIT)\r
-          if len(list) < 2:\r
-            v = ''\r
-          else:\r
-            v = list[1]\r
-          \r
-          if pb.LibraryClass != None:\r
-            #For Library\r
-            for type in pb.LibraryClass.SupModList:\r
-              instance = self.FindLibraryClassInstanceOfLibrary(CleanString(list[0]), key, type)\r
-              if instance != None:\r
-                v = instance\r
-                pb.LibraryClasses[(CleanString(list[0]), type)] = NormPath(CleanString(v))\r
-          else:\r
-            #For Module            \r
-            instance = self.FindLibraryClassInstanceOfModule(CleanString(list[0]), key, pb.ModuleType, inf) \r
-            if instance != None:\r
-              v = instance\r
-              pb.LibraryClasses[(CleanString(list[0]), pb.ModuleType)] = NormPath(CleanString(v))\r
+        #End of build PackageDatabase\r
+    \r
+        #Build ModuleDatabase\r
+        for inf in self.InfDatabase.keys():\r
+            infObj = self.InfDatabase[inf]\r
+            \r
+            for key in DataType.ARCH_LIST:\r
+                #Defines\r
+                pb = ModuleBuildClassObject()\r
+                pb.DescFilePath = inf\r
+                pb.BaseName = infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_BASE_NAME][0]\r
+                pb.Guid = infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_FILE_GUID][0]\r
+                pb.Version = infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_VERSION_STRING][0]\r
+                pb.ModuleType = infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_MODULE_TYPE][0]\r
+                if infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_EDK_RELEASE_VERSION][0] != '':\r
+                    pb.Specification[TAB_INF_DEFINES_EDK_RELEASE_VERSION] = infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_EDK_RELEASE_VERSION][0]\r
+                if infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_EFI_SPECIFICATION_VERSION][0] != '':\r
+                    pb.Specification[TAB_INF_DEFINES_EFI_SPECIFICATION_VERSION] = infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_EFI_SPECIFICATION_VERSION][0]                \r
+                LibraryClass = infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_LIBRARY_CLASS][0]\r
+                if LibraryClass != '':\r
+                    l = LibraryClass.split(DataType.TAB_VALUE_SPLIT)\r
+                    if len(l) == 2:\r
+                        pb.LibraryClass = LibraryClassObject(l[0], l[1])\r
+                    elif len(l) == 1:\r
+                        pb.LibraryClass = LibraryClassObject(l[0], DataType.SUP_MODULE_LIST_STRING)\r
 \r
-        #Pcds\r
-        for index in range(len(infObj.Contents[key].PcdsFixedAtBuild)):\r
-          pcd = infObj.Contents[key].PcdsFixedAtBuild[index].split(DataType.TAB_VALUE_SPLIT)\r
-          pb.Pcds[(pcd[0], pcd[1])] = self.FindPcd(key, pcd[0], pcd[1], DataType.TAB_PCDS_FIXED_AT_BUILD)\r
-        for index in range(len(infObj.Contents[key].PcdsPatchableInModule)):\r
-          pcd = infObj.Contents[key].PcdsPatchableInModule[index].split(DataType.TAB_VALUE_SPLIT)\r
-          pb.Pcds[(pcd[0], pcd[1])] = self.FindPcd(key, pcd[0], pcd[1], DataType.TAB_PCDS_PATCHABLE_IN_MODULE)\r
-          #pb.Pcds[(pcd[0], pcd[1])] = PcdClassObject(pcd[0], pcd[1], DataType.TAB_PCDS_PATCHABLE_IN_MODULE, None, None, None, None)          \r
-        for index in range(len(infObj.Contents[key].PcdsFeatureFlag)):\r
-          pcd = infObj.Contents[key].PcdsFeatureFlag[index].split(DataType.TAB_VALUE_SPLIT)\r
-          pb.Pcds[(pcd[0], pcd[1])] = self.FindPcd(key, pcd[0], pcd[1], DataType.TAB_PCDS_FEATURE_FLAG)\r
-          #pb.Pcds[(pcd[0], pcd[1])] = PcdClassObject(pcd[0], pcd[1], DataType.TAB_PCDS_FEATURE_FLAG, None, None, None, None)          \r
-        for index in range(len(infObj.Contents[key].PcdsDynamic)):\r
-          pcd = infObj.Contents[key].PcdsDynamic[index].split(DataType.TAB_VALUE_SPLIT)\r
-          pb.Pcds[(pcd[0], pcd[1])] = self.FindPcd(key, pcd[0], pcd[1], DataType.TAB_PCDS_DYNAMIC)\r
-          #pb.Pcds[(pcd[0], pcd[1])] = PcdClassObject(pcd[0], pcd[1], DataType.TAB_PCDS_DYNAMIC, None, None, None, None)\r
-        for index in range(len(infObj.Contents[key].PcdsDynamicEx)):\r
-          pcd = infObj.Contents[key].PcdsDynamicEx[index].split(DataType.TAB_VALUE_SPLIT)\r
-          pb.Pcds[(pcd[0], pcd[1])] = self.FindPcd(key, pcd[0], pcd[1], DataType.TAB_PCDS_DYNAMIC_EX)\r
-          #pb.Pcds[(pcd[0], pcd[1])] = PcdClassObject(pcd[0], pcd[1], DataType.TAB_PCDS_DYNAMIC_EX, None, None, None, None)\r
+                pb.ModuleEntryPointList.extend(infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_ENTRY_POINT])\r
+                pb.ModuleUnloadImageList.extend(infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_UNLOAD_IMAGE])\r
+                pb.ConstructorList.extend(infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_CONSTRUCTOR])\r
+                pb.DestructorList.extend(infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_DESTRUCTOR])\r
+\r
+                #Sources\r
+                for index in range(len(infObj.Contents[key].Sources)):\r
+                    pb.Sources.append(ModuleSourceFilesClassObject(NormPath(infObj.Contents[key].Sources[index])))\r
+\r
+                #Protocols\r
+                for index in range(len(infObj.Contents[key].Protocols)):\r
+                    pb.Protocols.append(infObj.Contents[key].Protocols[index])\r
+            \r
+                #Ppis\r
+                for index in range(len(infObj.Contents[key].Ppis)):\r
+                    pb.Ppis.append(infObj.Contents[key].Ppis[index])\r
+                                \r
+                #Guids\r
+                for index in range(len(infObj.Contents[key].Guids)):\r
+                    pb.Guids.append(infObj.Contents[key].Guids[index])\r
+            \r
+                #Includes\r
+                for index in range(len(infObj.Contents[key].Includes)):\r
+                    pb.Includes.append(NormPath(infObj.Contents[key].Includes[index]))\r
+            \r
+                #Packages\r
+                for index in range(len(infObj.Contents[key].Packages)):\r
+                    pb.Packages.append(NormPath(infObj.Contents[key].Packages[index]))\r
                     \r
-        #Add to database\r
-        self.Build[key].ModuleDatabase[inf] = pb\r
-        pb = None  \r
-      #End of Arch List Go Through\r
-    \r
-    #End of Inf Go Through\r
-    \r
-    #End of build ModuleDatabase  \r
-  \r
-  #End of self.Init\r
-  \r
-  def AddToInfDatabase(self, infFileName):\r
-    infFileName = NormPath(infFileName)\r
-    file = self.Workspace.WorkspaceFile(infFileName)\r
-    if os.path.exists(file) and os.path.isfile(file):\r
-      if infFileName not in self.InfDatabase:\r
-        self.InfDatabase[infFileName] = Inf(file, True)\r
+                #BuildOptions\r
+                for index in range(len(infObj.Contents[key].BuildOptions)):\r
+                    b = infObj.Contents[key].BuildOptions[index]\r
+                    pb.BuildOptions[CleanString(b.split(DataType.TAB_EQUAL_SPLIT)[0])] = CleanString(b.split(DataType.TAB_EQUAL_SPLIT)[1])\r
+                self.FindBuildOptions(key, inf, pb.BuildOptions)\r
+                \r
+                #LibraryClasses\r
+                for index in range(len(infObj.Contents[key].LibraryClasses)):\r
+                    #Get LibraryClass name and default instance if existing\r
+                    list = infObj.Contents[key].LibraryClasses[index].split(DataType.TAB_VALUE_SPLIT)\r
+                    if len(list) < 2:\r
+                        v = ''\r
+                    else:\r
+                        v = list[1]\r
+                    \r
+                    if pb.LibraryClass != None:\r
+                        #For Library\r
+                        for type in pb.LibraryClass.SupModList:\r
+                            instance = self.FindLibraryClassInstanceOfLibrary(CleanString(list[0]), key, type)\r
+                            if instance != None:\r
+                                v = instance\r
+                                pb.LibraryClasses[(CleanString(list[0]), type)] = NormPath(CleanString(v))\r
+                    else:\r
+                        #For Module                        \r
+                        instance = self.FindLibraryClassInstanceOfModule(CleanString(list[0]), key, pb.ModuleType, inf) \r
+                        if instance != None:\r
+                            v = instance\r
+                            pb.LibraryClasses[(CleanString(list[0]), pb.ModuleType)] = NormPath(CleanString(v))\r
+\r
+                #Pcds\r
+                for index in range(len(infObj.Contents[key].PcdsFixedAtBuild)):\r
+                    pcd = infObj.Contents[key].PcdsFixedAtBuild[index].split(DataType.TAB_VALUE_SPLIT)\r
+                    pb.Pcds[(pcd[0], pcd[1])] = self.FindPcd(key, pcd[0], pcd[1], DataType.TAB_PCDS_FIXED_AT_BUILD)\r
+                for index in range(len(infObj.Contents[key].PcdsPatchableInModule)):\r
+                    pcd = infObj.Contents[key].PcdsPatchableInModule[index].split(DataType.TAB_VALUE_SPLIT)\r
+                    pb.Pcds[(pcd[0], pcd[1])] = self.FindPcd(key, pcd[0], pcd[1], DataType.TAB_PCDS_PATCHABLE_IN_MODULE)\r
+                    #pb.Pcds[(pcd[0], pcd[1])] = PcdClassObject(pcd[0], pcd[1], DataType.TAB_PCDS_PATCHABLE_IN_MODULE, None, None, None, None)                    \r
+                for index in range(len(infObj.Contents[key].PcdsFeatureFlag)):\r
+                    pcd = infObj.Contents[key].PcdsFeatureFlag[index].split(DataType.TAB_VALUE_SPLIT)\r
+                    pb.Pcds[(pcd[0], pcd[1])] = self.FindPcd(key, pcd[0], pcd[1], DataType.TAB_PCDS_FEATURE_FLAG)\r
+                    #pb.Pcds[(pcd[0], pcd[1])] = PcdClassObject(pcd[0], pcd[1], DataType.TAB_PCDS_FEATURE_FLAG, None, None, None, None)                    \r
+                for index in range(len(infObj.Contents[key].PcdsDynamic)):\r
+                    pcd = infObj.Contents[key].PcdsDynamic[index].split(DataType.TAB_VALUE_SPLIT)\r
+                    pb.Pcds[(pcd[0], pcd[1])] = self.FindPcd(key, pcd[0], pcd[1], DataType.TAB_PCDS_DYNAMIC)\r
+                    #pb.Pcds[(pcd[0], pcd[1])] = PcdClassObject(pcd[0], pcd[1], DataType.TAB_PCDS_DYNAMIC, None, None, None, None)\r
+                for index in range(len(infObj.Contents[key].PcdsDynamicEx)):\r
+                    pcd = infObj.Contents[key].PcdsDynamicEx[index].split(DataType.TAB_VALUE_SPLIT)\r
+                    pb.Pcds[(pcd[0], pcd[1])] = self.FindPcd(key, pcd[0], pcd[1], DataType.TAB_PCDS_DYNAMIC_EX)\r
+                    #pb.Pcds[(pcd[0], pcd[1])] = PcdClassObject(pcd[0], pcd[1], DataType.TAB_PCDS_DYNAMIC_EX, None, None, None, None)\r
+                                        \r
+                #Add to database\r
+                self.Build[key].ModuleDatabase[inf] = pb\r
+                pb = None    \r
+            #End of Arch List Go Through\r
         \r
-  def AddToDecDatabase(self, decFileName):\r
-    decFileName = NormPath(decFileName)\r
-    file = self.Workspace.WorkspaceFile(decFileName)\r
-    if os.path.exists(file) and os.path.isfile(file):\r
-      if decFileName not in self.DecDatabase:\r
-        self.DecDatabase[decFileName] = Dec(file, True)\r
+        #End of Inf Go Through\r
         \r
-  def FindLibraryClassInstanceOfModule(self, lib, arch, moduleType, moduleName):\r
-    for dsc in self.DscDatabase.keys():\r
-      #First find if exist in <LibraryClass> of <Components> from dsc file      \r
-      dscObj = self.DscDatabase[dsc]\r
-      for index in range(len(dscObj.Contents[arch].Components)):\r
-        if NormPath(dscObj.Contents[arch].Components[index][0]) == moduleName and len(dscObj.Contents[arch].Components[index][1]) > 0:\r
-          #Search each library class\r
-          LibList = dscObj.Contents[arch].Components[index][1]\r
-          for indexOfLib in range(len(LibList)):\r
-            if LibList[indexOfLib].split(DataType.TAB_VALUE_SPLIT)[0] == lib:\r
-              return LibList[indexOfLib].split(DataType.TAB_VALUE_SPLIT)[1]\r
-      \r
-      #Second find if exist in <LibraryClass> of <LibraryClasses> from dsc file      \r
-      if (lib, moduleType) in self.Build[arch].PlatformDatabase[dsc].LibraryClasses:\r
-        return self.Build[arch].PlatformDatabase[dsc].LibraryClasses[(lib, moduleType)]\r
-      elif (lib, None) in self.Build[arch].PlatformDatabase[dsc].LibraryClasses:\r
-        return self.Build[arch].PlatformDatabase[dsc].LibraryClasses[(lib, None)]\r
-      \r
-  def FindLibraryClassInstanceOfLibrary(self, lib, arch, type):\r
-    for dsc in self.DscDatabase.keys():\r
-      dscObj = self.DscDatabase[dsc]\r
-      if (lib, type) in self.Build[arch].PlatformDatabase[dsc].LibraryClasses:\r
-        return self.Build[arch].PlatformDatabase[dsc].LibraryClasses[(lib, type)]\r
-      elif (lib, None) in self.Build[arch].PlatformDatabase[dsc].LibraryClasses:\r
-        return self.Build[arch].PlatformDatabase[dsc].LibraryClasses[(lib, None)]\r
-      \r
-  def FindBuildOptions(self, arch, moduleName, BuildOptions):\r
-    for dsc in self.DscDatabase.keys():\r
-      #First find if exist in <BuildOptions> of <Components> from dsc file\r
-      dscObj = self.DscDatabase[dsc]\r
-      for index in range(len(dscObj.Contents[arch].Components)):\r
-        if NormPath(dscObj.Contents[arch].Components[index][0]) == moduleName and len(dscObj.Contents[arch].Components[index][2]) > 0:\r
-          list = dscObj.Contents[arch].Components[index][2]\r
-          for l in list:\r
-            BuildOptions[CleanString(l.split(DataType.TAB_EQUAL_SPLIT)[0])] = CleanString(l.split(DataType.TAB_EQUAL_SPLIT)[1])\r
+        #End of build ModuleDatabase    \r
+    \r
+    #End of self.Init\r
+    \r
+    def AddToInfDatabase(self, infFileName):\r
+        infFileName = NormPath(infFileName)\r
+        file = self.Workspace.WorkspaceFile(infFileName)\r
+        if os.path.exists(file) and os.path.isfile(file):\r
+            if infFileName not in self.InfDatabase:\r
+                self.InfDatabase[infFileName] = Inf(file, True)\r
+                \r
+    def AddToDecDatabase(self, decFileName):\r
+        decFileName = NormPath(decFileName)\r
+        file = self.Workspace.WorkspaceFile(decFileName)\r
+        if os.path.exists(file) and os.path.isfile(file):\r
+            if decFileName not in self.DecDatabase:\r
+                self.DecDatabase[decFileName] = Dec(file, True)\r
+                \r
+    def FindLibraryClassInstanceOfModule(self, lib, arch, moduleType, moduleName):\r
+        for dsc in self.DscDatabase.keys():\r
+            #First find if exist in <LibraryClass> of <Components> from dsc file            \r
+            dscObj = self.DscDatabase[dsc]\r
+            for index in range(len(dscObj.Contents[arch].Components)):\r
+                if NormPath(dscObj.Contents[arch].Components[index][0]) == moduleName and len(dscObj.Contents[arch].Components[index][1]) > 0:\r
+                    #Search each library class\r
+                    LibList = dscObj.Contents[arch].Components[index][1]\r
+                    for indexOfLib in range(len(LibList)):\r
+                        if LibList[indexOfLib].split(DataType.TAB_VALUE_SPLIT)[0] == lib:\r
+                            return LibList[indexOfLib].split(DataType.TAB_VALUE_SPLIT)[1]\r
+            \r
+            #Second find if exist in <LibraryClass> of <LibraryClasses> from dsc file            \r
+            if (lib, moduleType) in self.Build[arch].PlatformDatabase[dsc].LibraryClasses:\r
+                return self.Build[arch].PlatformDatabase[dsc].LibraryClasses[(lib, moduleType)]\r
+            elif (lib, None) in self.Build[arch].PlatformDatabase[dsc].LibraryClasses:\r
+                return self.Build[arch].PlatformDatabase[dsc].LibraryClasses[(lib, None)]\r
+            \r
+    def FindLibraryClassInstanceOfLibrary(self, lib, arch, type):\r
+        for dsc in self.DscDatabase.keys():\r
+            dscObj = self.DscDatabase[dsc]\r
+            if (lib, type) in self.Build[arch].PlatformDatabase[dsc].LibraryClasses:\r
+                return self.Build[arch].PlatformDatabase[dsc].LibraryClasses[(lib, type)]\r
+            elif (lib, None) in self.Build[arch].PlatformDatabase[dsc].LibraryClasses:\r
+                return self.Build[arch].PlatformDatabase[dsc].LibraryClasses[(lib, None)]\r
             \r
-  def FindPcd(self, arch, CName, GuidCName, Type):\r
-    DatumType = ''\r
-    DefaultValue = ''\r
-    TokenValue = ''\r
-    MaxDatumSize = ''\r
-    for dsc in self.Build[arch].PlatformDatabase.keys():\r
-      platform = self.Build[arch].PlatformDatabase[dsc]\r
-      pcds = platform.Pcds\r
-      if (CName, GuidCName) in pcds:\r
-        DatumType = pcds[(CName, GuidCName)].DatumType\r
-        DefaultValue = pcds[(CName, GuidCName)].DefaultValue\r
-        TokenValue = pcds[(CName, GuidCName)].TokenValue\r
-        MaxDatumSize = pcds[(CName, GuidCName)].MaxDatumSize\r
-        break\r
+    def FindBuildOptions(self, arch, moduleName, BuildOptions):\r
+        for dsc in self.DscDatabase.keys():\r
+            #First find if exist in <BuildOptions> of <Components> from dsc file\r
+            dscObj = self.DscDatabase[dsc]\r
+            for index in range(len(dscObj.Contents[arch].Components)):\r
+                if NormPath(dscObj.Contents[arch].Components[index][0]) == moduleName and len(dscObj.Contents[arch].Components[index][2]) > 0:\r
+                    list = dscObj.Contents[arch].Components[index][2]\r
+                    for l in list:\r
+                        BuildOptions[CleanString(l.split(DataType.TAB_EQUAL_SPLIT)[0])] = CleanString(l.split(DataType.TAB_EQUAL_SPLIT)[1])\r
+                        \r
+    def FindPcd(self, arch, CName, GuidCName, Type):\r
+        DatumType = ''\r
+        DefaultValue = ''\r
+        TokenValue = ''\r
+        MaxDatumSize = ''\r
+        for dsc in self.Build[arch].PlatformDatabase.keys():\r
+            platform = self.Build[arch].PlatformDatabase[dsc]\r
+            pcds = platform.Pcds\r
+            if (CName, GuidCName) in pcds:\r
+                DatumType = pcds[(CName, GuidCName)].DatumType\r
+                DefaultValue = pcds[(CName, GuidCName)].DefaultValue\r
+                TokenValue = pcds[(CName, GuidCName)].TokenValue\r
+                MaxDatumSize = pcds[(CName, GuidCName)].MaxDatumSize\r
+                break\r
 \r
-    for dec in self.Build[arch].PackageDatabase.keys():\r
-      package = self.Build[arch].PackageDatabase[dec]\r
-      pcds = package.Pcds\r
-      if (CName, GuidCName) in pcds:\r
-        DatumType = pcds[(CName, GuidCName)].DatumType\r
-        #DefaultValue = pcds[(CName, GuidCName)].DefaultValue\r
-        TokenValue = pcds[(CName, GuidCName)].TokenValue\r
-        #MaxDatumSize = pcds[(CName, GuidCName)].MaxDatumSize\r
-        break\r
-    \r
-    return PcdClassObject(CName, GuidCName, Type, DatumType, DefaultValue, TokenValue, MaxDatumSize)\r
-        \r
+        for dec in self.Build[arch].PackageDatabase.keys():\r
+            package = self.Build[arch].PackageDatabase[dec]\r
+            pcds = package.Pcds\r
+            if (CName, GuidCName) in pcds:\r
+                DatumType = pcds[(CName, GuidCName)].DatumType\r
+                #DefaultValue = pcds[(CName, GuidCName)].DefaultValue\r
+                TokenValue = pcds[(CName, GuidCName)].TokenValue\r
+                #MaxDatumSize = pcds[(CName, GuidCName)].MaxDatumSize\r
+                break\r
         \r
+        return PcdClassObject(CName, GuidCName, Type, DatumType, DefaultValue, TokenValue, MaxDatumSize)\r
+                \r
+                \r
 # This acts like the main() function for the script, unless it is 'import'ed into another\r
 # script.\r
 if __name__ == '__main__':\r
 \r
-  # Nothing to do here. Could do some unit tests.\r
-  ewb = WorkspaceBuild()\r
-  #printDict(ewb.TargetTxt.TargetTxtDictionary)\r
-  #printDict(ewb.ToolDef.ToolsDefTxtDictionary)\r
-#  print ewb.DscDatabase\r
-#  print ewb.InfDatabase\r
-#  print ewb.DecDatabase\r
-  \r
-  #\r
-  for arch in DataType.ARCH_LIST:\r
-    print arch\r
-    print 'Platform'\r
-    for platform in ewb.Build[arch].PlatformDatabase.keys():\r
-      p = ewb.Build[arch].PlatformDatabase[platform]\r
-      print p.DescFilePath   \r
-      print p.PlatformName   \r
-      print p.Guid           \r
-      print p.Version\r
-      print p.OutputDirectory        \r
-      print p.Modules        \r
-      print p.LibraryClasses \r
-      print p.Pcds           \r
-      print p.BuildOptions   \r
-    #End of Platform\r
-  \r
-    print 'package'\r
-    for package in ewb.Build[arch].PackageDatabase.keys():\r
-      p = ewb.Build[arch].PackageDatabase[package]\r
-      print p.DescFilePath  \r
-      print p.PackageName   \r
-      print p.Guid          \r
-      print p.Version       \r
-      print p.Protocols     \r
-      print p.Ppis          \r
-      print p.Guids         \r
-      print p.Includes      \r
-      print p.LibraryClasses\r
-      print p.Pcds          \r
-    #End of Package\r
+    # Nothing to do here. Could do some unit tests.\r
+    ewb = WorkspaceBuild()\r
+    #printDict(ewb.TargetTxt.TargetTxtDictionary)\r
+    #printDict(ewb.ToolDef.ToolsDefTxtDictionary)\r
+#    print ewb.DscDatabase\r
+#    print ewb.InfDatabase\r
+#    print ewb.DecDatabase\r
+    \r
+    #\r
+    for arch in DataType.ARCH_LIST:\r
+        print arch\r
+        print 'Platform'\r
+        for platform in ewb.Build[arch].PlatformDatabase.keys():\r
+            p = ewb.Build[arch].PlatformDatabase[platform]\r
+            print p.DescFilePath     \r
+            print p.PlatformName     \r
+            print p.Guid                     \r
+            print p.Version\r
+            print p.OutputDirectory                \r
+            print p.Modules                \r
+            print p.LibraryClasses \r
+            print p.Pcds                     \r
+            print p.BuildOptions     \r
+        #End of Platform\r
     \r
-    print 'module'\r
-    for module in ewb.Build[arch].ModuleDatabase.keys():\r
-      p = ewb.Build[arch].ModuleDatabase[module]\r
-      print p.DescFilePath          \r
-      print p.BaseName             \r
-      print p.ModuleType           \r
-      print p.Guid                 \r
-      print p.Version\r
-      print p.Specification\r
-      if p.LibraryClass != None:\r
-        print p.LibraryClass.LibraryClass\r
-        print p.LibraryClass.SupModList\r
-      print p.ModuleEntryPointList \r
-      print p.ModuleUnloadImageList\r
-      print p.ConstructorList      \r
-      print p.DestructorList       \r
-                                   \r
-      print p.Sources              \r
-      print p.LibraryClasses       \r
-      print p.Protocols            \r
-      print p.Ppis                 \r
-      print p.Guids                \r
-      print p.Includes             \r
-      print p.Packages             \r
-      print p.Pcds                 \r
-      print p.BuildOptions\r
-    #End of Module  \r
-      \r
-  #End of Arch List\r
+        print 'package'\r
+        for package in ewb.Build[arch].PackageDatabase.keys():\r
+            p = ewb.Build[arch].PackageDatabase[package]\r
+            print p.DescFilePath    \r
+            print p.PackageName     \r
+            print p.Guid                    \r
+            print p.Version             \r
+            print p.Protocols         \r
+            print p.Ppis                    \r
+            print p.Guids                 \r
+            print p.Includes            \r
+            print p.LibraryClasses\r
+            print p.Pcds                    \r
+        #End of Package\r
+        \r
+        print 'module'\r
+        for module in ewb.Build[arch].ModuleDatabase.keys():\r
+            p = ewb.Build[arch].ModuleDatabase[module]\r
+            print p.DescFilePath                    \r
+            print p.BaseName                         \r
+            print p.ModuleType                     \r
+            print p.Guid                                 \r
+            print p.Version\r
+            print p.Specification\r
+            if p.LibraryClass != None:\r
+                print p.LibraryClass.LibraryClass\r
+                print p.LibraryClass.SupModList\r
+            print p.ModuleEntryPointList \r
+            print p.ModuleUnloadImageList\r
+            print p.ConstructorList            \r
+            print p.DestructorList             \r
+                                                                     \r
+            print p.Sources                            \r
+            print p.LibraryClasses             \r
+            print p.Protocols                        \r
+            print p.Ppis                                 \r
+            print p.Guids                                \r
+            print p.Includes                         \r
+            print p.Packages                         \r
+            print p.Pcds                                 \r
+            print p.BuildOptions\r
+        #End of Module    \r
+            \r
+    #End of Arch List\r
index a53dc49..d27a7b1 100644 (file)
@@ -1,7 +1,7 @@
 # Copyright (c) 2007, Intel Corporation\r
 # All rights reserved. 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
+# which accompanies this 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
@@ -19,135 +19,143 @@ from Identification import *
 from Dictionary import *\r
 \r
 class InfObject(object):\r
-  def __init__(self):\r
-    object.__init__()\r
+    def __init__(self):\r
+        object.__init__()\r
 \r
 class InfDefines(InfObject):\r
-  def __init__(self):\r
-    self.DefinesDictionary = {\r
-      #Required\r
-      TAB_INF_DEFINES_BASE_NAME                    : '',\r
-      TAB_INF_DEFINES_EDK_RELEASE_VERSION          : '',\r
-      TAB_INF_DEFINES_EFI_SPECIFICATION_VERSION    : '',\r
-      #Optional\r
-      TAB_INF_DEFINES_FILE_GUID                    : '',\r
-      TAB_INF_DEFINES_MODULE_TYPE                  : '',\r
-      TAB_INF_DEFINES_BINARY_MODULE                : '',\r
-      TAB_INF_DEFINES_MAKEFILE_NAME                : '',\r
-      TAB_INF_DEFINES_VERSION_STRING               : '',\r
-      TAB_INF_DEFINES_VERSION                      : '',\r
-      TAB_INF_DEFINES_LIBRARY_CLASS                : '',\r
-      TAB_INF_DEFINES_PCD_DRIVER                   : '',\r
-      TAB_INF_DEFINES_ENTRY_POINT                  : [],\r
-      TAB_INF_DEFINES_UNLOAD_IMAGE                 : [],\r
-      TAB_INF_DEFINES_CONSTRUCTOR                  : [],\r
-      TAB_INF_DEFINES_DESTRUCTOR                   : [],\r
-      TAB_INF_DEFINES_DEFINE                       : '',\r
-      TAB_INF_DEFINES_CUSTOM_MAKEFILE              : '',\r
-      TAB_INF_DEFINES_INF_VERSION                  : ''\r
-    }\r
-    self.ToolFlags = []   #'${FAMILY}:${TARGET}_${TAGNAME}_${ARCH}_${TOOLCODE}_FLAGS'\r
-    self.MacroName = '$(MACRO_NAME)'\r
+    def __init__(self):\r
+        self.DefinesDictionary = {\r
+            #Required\r
+            TAB_INF_DEFINES_BASE_NAME                                        : [''],\r
+            TAB_INF_DEFINES_EDK_RELEASE_VERSION                              : [''],\r
+            TAB_INF_DEFINES_EFI_SPECIFICATION_VERSION                        : [''],\r
+            #Optional\r
+            TAB_INF_DEFINES_FILE_GUID                                        : [''],\r
+            TAB_INF_DEFINES_MODULE_TYPE                                      : [''],\r
+            TAB_INF_DEFINES_BINARY_MODULE                                    : [''],\r
+            TAB_INF_DEFINES_MAKEFILE_NAME                                    : [''],\r
+            TAB_INF_DEFINES_VERSION_STRING                                   : [''],\r
+            TAB_INF_DEFINES_VERSION                                          : [''],\r
+            TAB_INF_DEFINES_LIBRARY_CLASS                                    : [''],\r
+            TAB_INF_DEFINES_PCD_DRIVER                                       : [''],\r
+            TAB_INF_DEFINES_ENTRY_POINT                                      : [''],\r
+            TAB_INF_DEFINES_UNLOAD_IMAGE                                     : [''],\r
+            TAB_INF_DEFINES_CONSTRUCTOR                                      : [''],\r
+            TAB_INF_DEFINES_DESTRUCTOR                                       : [''],\r
+            TAB_INF_DEFINES_DEFINE                                           : [''],\r
+            TAB_INF_DEFINES_CUSTOM_MAKEFILE                                  : [''],\r
+            TAB_INF_DEFINES_INF_VERSION                                      : ['']\r
+        }\r
+        self.ToolFlags = []     #'${FAMILY}:${TARGET}_${TAGNAME}_${ARCH}_${TOOLCODE}_FLAGS'\r
+        self.MacroName = '$(MACRO_NAME)'\r
 \r
 class InfContents(InfObject):\r
-  def __init__(self):\r
-    self.Sources = []\r
-    self.BuildOptions = []\r
-    self.Binaries = []\r
-    self.Includes = []\r
-    self.Guids = []\r
-    self.Protocols = []\r
-    self.Ppis = []\r
-    self.LibraryClasses = []\r
-    self.Packages = []\r
-    self.PcdsFixedAtBuild = []\r
-    self.PcdsPatchableInModule = []\r
-    self.PcdsFeatureFlag = []\r
-    self.PcdsDynamic = []\r
-    self.PcdsDynamicEx = []\r
-    self.Depex = []\r
-    \r
+    def __init__(self):\r
+        self.Sources = []\r
+        self.BuildOptions = []\r
+        self.Binaries = []\r
+        self.Includes = []\r
+        self.Guids = []\r
+        self.Protocols = []\r
+        self.Ppis = []\r
+        self.LibraryClasses = []\r
+        self.Packages = []\r
+        self.PcdsFixedAtBuild = []\r
+        self.PcdsPatchableInModule = []\r
+        self.PcdsFeatureFlag = []\r
+        self.PcdsDynamic = []\r
+        self.PcdsDynamicEx = []\r
+        self.Depex = []\r
+        \r
 class Inf(InfObject):\r
-  def __init__(self, filename = None, isMergeAllArches = False):\r
-    self.identification = Identification()\r
-    self.Defines = InfDefines()\r
-    self.Contents = {}\r
-    \r
-    for key in DataType.ARCH_LIST_FULL:\r
-      self.Contents[key] = InfContents()\r
-\r
-    self.KeyList = [\r
-      TAB_BINARIES, TAB_SOURCES, TAB_INCLUDES, TAB_GUIDS, TAB_PROTOCOLS, TAB_PPIS, TAB_LIBRARY_CLASSES, TAB_PACKAGES, TAB_BUILD_OPTIONS, \\r
-      TAB_PCDS_FIXED_AT_BUILD_NULL, TAB_PCDS_PATCHABLE_IN_MODULE_NULL, TAB_PCDS_FEATURE_FLAG_NULL, \\r
-      TAB_PCDS_DYNAMIC_NULL, TAB_PCDS_DYNAMIC_EX_NULL\r
-    ]\r
+    def __init__(self, filename = None, isMergeAllArches = False):\r
+        self.identification = Identification()\r
+        self.Defines = InfDefines()\r
+        self.Contents = {}\r
         \r
-    if filename != None:\r
-      self.LoadInfFile(filename)\r
-    \r
-    if isMergeAllArches:\r
-      self.MergeAllArches()\r
-  \r
-  def MergeAllArches(self):\r
-    for key in self.KeyList:\r
-      for arch in DataType.ARCH_LIST:\r
-        Command = "self.Contents[arch]." + key + ".extend(" + "self.Contents['" + DataType.TAB_ARCH_COMMON + "']." + key + ")"\r
-        eval(Command)   \r
-      \r
-  def ParseInf(self, Lines, Key, KeyField):\r
-      GetMultipleValuesOfKeyFromLines(Lines, Key, KeyField, TAB_COMMENT_SPLIT)\r
+        for key in DataType.ARCH_LIST_FULL:\r
+            self.Contents[key] = InfContents()\r
 \r
-  def LoadInfFile(self, filename):   \r
-    (filepath, name) = os.path.split(filename)\r
-    self.identification.FileName = name\r
-    self.identification.FileFullPath = filename\r
-    self.identification.FileRelativePath = filepath\r
+        self.KeyList = [\r
+            TAB_BINARIES, TAB_SOURCES, TAB_INCLUDES, TAB_GUIDS, TAB_PROTOCOLS, TAB_PPIS, TAB_LIBRARY_CLASSES, TAB_PACKAGES, TAB_BUILD_OPTIONS, \\r
+            TAB_PCDS_FIXED_AT_BUILD_NULL, TAB_PCDS_PATCHABLE_IN_MODULE_NULL, TAB_PCDS_FEATURE_FLAG_NULL, \\r
+            TAB_PCDS_DYNAMIC_NULL, TAB_PCDS_DYNAMIC_EX_NULL\r
+        ]\r
+                \r
+        if filename != None:\r
+            self.LoadInfFile(filename)\r
+        \r
+        if isMergeAllArches:\r
+            self.MergeAllArches()\r
     \r
-    f = open(filename, 'r').read()\r
-    sects = f.split('[')\r
-    for sect in sects:\r
-      tab = (sect.split(TAB_SECTION_END, 1)[0]).upper()\r
-      if tab == TAB_INF_DEFINES.upper():\r
-        GetSingleValueOfKeyFromLines(sect, self.Defines.DefinesDictionary, TAB_COMMENT_SPLIT, TAB_EQUAL_SPLIT, False, None)\r
-        continue\r
-      for arch in DataType.ARCH_LIST_FULL + [DataType.TAB_ARCH_NULL]:\r
+    def MergeAllArches(self):\r
         for key in self.KeyList:\r
-          if arch != DataType.TAB_ARCH_NULL:\r
-            target = (key + DataType.TAB_SPLIT + arch).upper()\r
-          else:\r
-            target = key.upper()\r
-          if tab == target:\r
-            if arch != DataType.TAB_ARCH_NULL:\r
-              Command = 'self.ParseInf(sect, tab, self.Contents[arch].' + key + ')'\r
-              eval(Command)\r
-              continue\r
-            else:\r
-              Command = "self.ParseInf(sect, tab, self.Contents['" + DataType.TAB_ARCH_COMMON + "']." + key + ')'\r
-              eval(Command)\r
-              continue\r
-    #EndFor\r
+            for arch in DataType.ARCH_LIST:\r
+                Command = "self.Contents[arch]." + key + ".extend(" + "self.Contents['" + DataType.TAB_ARCH_COMMON + "']." + key + ")"\r
+                eval(Command)     \r
+            \r
+    def ParseInf(self, Lines, Key, KeyField):\r
+            GetMultipleValuesOfKeyFromLines(Lines, Key, KeyField, TAB_COMMENT_SPLIT)\r
 \r
-  def showInf(self):\r
-    print TAB_SECTION_START + TAB_INF_DEFINES + TAB_SECTION_END\r
-    printDict(self.Defines.DefinesDictionary)\r
+    def LoadInfFile(self, filename):     \r
+        (filepath, name) = os.path.split(filename)\r
+        self.identification.FileName = name\r
+        self.identification.FileFullPath = filename\r
+        self.identification.FileRelativePath = filepath\r
+        \r
+        f = open(filename, 'r').read()\r
+        sects = f.split('[')\r
+        for sect in sects:\r
+            tab = (sect.split(TAB_SECTION_END, 1)[0]).upper()\r
+            if tab == TAB_INF_DEFINES.upper():\r
+                GetSingleValueOfKeyFromLines(sect, self.Defines.DefinesDictionary, TAB_COMMENT_SPLIT, TAB_EQUAL_SPLIT, False, None)\r
+                if self.Defines.DefinesDictionary[TAB_INF_DEFINES_ENTRY_POINT][0] == '':\r
+                    self.Defines.DefinesDictionary[TAB_INF_DEFINES_ENTRY_POINT] = []\r
+                if self.Defines.DefinesDictionary[TAB_INF_DEFINES_UNLOAD_IMAGE][0] == '':\r
+                    self.Defines.DefinesDictionary[TAB_INF_DEFINES_UNLOAD_IMAGE] = []\r
+                if self.Defines.DefinesDictionary[TAB_INF_DEFINES_CONSTRUCTOR][0] == '':\r
+                    self.Defines.DefinesDictionary[TAB_INF_DEFINES_CONSTRUCTOR] = []\r
+                if self.Defines.DefinesDictionary[TAB_INF_DEFINES_DESTRUCTOR][0] == '':\r
+                    self.Defines.DefinesDictionary[TAB_INF_DEFINES_DESTRUCTOR] = []\r
+                continue\r
+            for arch in DataType.ARCH_LIST_FULL + [DataType.TAB_ARCH_NULL]:\r
+                for key in self.KeyList:\r
+                    if arch != DataType.TAB_ARCH_NULL:\r
+                        target = (key + DataType.TAB_SPLIT + arch).upper()\r
+                    else:\r
+                        target = key.upper()\r
+                    if tab == target:\r
+                        if arch != DataType.TAB_ARCH_NULL:\r
+                            Command = 'self.ParseInf(sect, tab, self.Contents[arch].' + key + ')'\r
+                            eval(Command)\r
+                            continue\r
+                        else:\r
+                            Command = "self.ParseInf(sect, tab, self.Contents['" + DataType.TAB_ARCH_COMMON + "']." + key + ')'\r
+                            eval(Command)\r
+                            continue\r
+        #EndFor\r
 \r
-    for key in self.KeyList:\r
-      for arch in DataType.ARCH_LIST_FULL:\r
-        Command = "printList(TAB_SECTION_START + '" + \\r
-                  key + DataType.TAB_SPLIT + arch + \\r
-                  "' + TAB_SECTION_END, self.Contents[arch]." + key + ')'\r
-        eval(Command)\r
-    print ""\r
-    \r
+    def showInf(self):\r
+        print TAB_SECTION_START + TAB_INF_DEFINES + TAB_SECTION_END\r
+        printDict(self.Defines.DefinesDictionary)\r
+\r
+        for key in self.KeyList:\r
+            for arch in DataType.ARCH_LIST_FULL:\r
+                Command = "printList(TAB_SECTION_START + '" + \\r
+                                    key + DataType.TAB_SPLIT + arch + \\r
+                                    "' + TAB_SECTION_END, self.Contents[arch]." + key + ')'\r
+                eval(Command)\r
+        print ""\r
+        \r
 if __name__ == '__main__':\r
-  m = Inf()\r
-  directory = 'C:\Documents and Settings\\hchen30\\Desktop\\prototype\\inf'\r
-  fileList = []\r
-  \r
-  for f in os.listdir(directory):\r
-    if os.path.splitext(os.path.normcase(f))[1] == '.inf':\r
-      fileList.append(os.path.join(directory, os.path.normcase(f)))\r
-      \r
-  for f in fileList:\r
-    m = Inf(f)\r
-    m.showInf()\r
+    m = Inf()\r
+    directory = 'C:\Documents and Settings\\hchen30\\Desktop\\prototype\\inf'\r
+    fileList = []\r
+    \r
+    for f in os.listdir(directory):\r
+        if os.path.splitext(os.path.normcase(f))[1] == '.inf':\r
+            fileList.append(os.path.join(directory, os.path.normcase(f)))\r
+            \r
+    for f in fileList:\r
+        m = Inf(f)\r
+        m.showInf()\r
index d79dc03..11ce8d2 100644 (file)
@@ -1,7 +1,7 @@
 # Copyright (c) 2007, Intel Corporation\r
 # All rights reserved. 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
+# which accompanies this 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
@@ -15,222 +15,214 @@ import DataType
 import os.path\r
 \r
 def MergeModulePcds(pcds, pcdsFixedAtBuild, pcdsPatchableInModule, pcdsFeatureFlag, pcdsDynamic):\r
-  #[ ['PcdName|PcdGuid|PcdType', 'IA32|X64|IPF|EBC'], ...]\r
-  \r
-  Item = pcdsFixedAtBuild\r
-  for index in range(len(Item)):\r
-    pcds.append([(Item[index][0].split(DataType.TAB_VALUE_SPLIT))[1] + DataType.TAB_VALUE_SPLIT + DataType.TAB_PCDS_FIXED_AT_BUILD, Item[index][1]])\r
-\r
-  Item = pcdsPatchableInModule\r
-  for index in range(len(Item)):\r
-    pcds.append([(Item[index][0].split(DataType.TAB_VALUE_SPLIT))[1] + DataType.TAB_VALUE_SPLIT + DataType.TAB_PCDS_PATCHABLE_IN_MODULE, Item[index][1]])\r
-                 \r
-  Item = pcdsFeatureFlag\r
-  for index in range(len(Item)):\r
-    pcds.append([(Item[index][0].split(DataType.TAB_VALUE_SPLIT))[1] + DataType.TAB_VALUE_SPLIT + DataType.TAB_PCDS_FEATURE_FLAG, Item[index][1]])\r
-                 \r
-  Item = pcdsDynamic\r
-  for index in range(len(Item)):\r
-    pcds.append([(Item[index][0].split(DataType.TAB_VALUE_SPLIT))[1] + DataType.TAB_VALUE_SPLIT + DataType.TAB_PCDS_DYNAMIC, Item[index][1]])\r
+    #[ ['PcdName|PcdGuid|PcdType', 'IA32|X64|IPF|EBC'], ...]\r
+    \r
+    Item = pcdsFixedAtBuild\r
+    for index in range(len(Item)):\r
+        pcds.append([(Item[index][0].split(DataType.TAB_VALUE_SPLIT))[1] + DataType.TAB_VALUE_SPLIT + DataType.TAB_PCDS_FIXED_AT_BUILD, Item[index][1]])\r
+\r
+    Item = pcdsPatchableInModule\r
+    for index in range(len(Item)):\r
+        pcds.append([(Item[index][0].split(DataType.TAB_VALUE_SPLIT))[1] + DataType.TAB_VALUE_SPLIT + DataType.TAB_PCDS_PATCHABLE_IN_MODULE, Item[index][1]])\r
+                                 \r
+    Item = pcdsFeatureFlag\r
+    for index in range(len(Item)):\r
+        pcds.append([(Item[index][0].split(DataType.TAB_VALUE_SPLIT))[1] + DataType.TAB_VALUE_SPLIT + DataType.TAB_PCDS_FEATURE_FLAG, Item[index][1]])\r
+                                 \r
+    Item = pcdsDynamic\r
+    for index in range(len(Item)):\r
+        pcds.append([(Item[index][0].split(DataType.TAB_VALUE_SPLIT))[1] + DataType.TAB_VALUE_SPLIT + DataType.TAB_PCDS_DYNAMIC, Item[index][1]])\r
 \r
 def MergeAllArch(list1, listCommon, listIa32, listX64, listIpf, listEbc):\r
-  isFound = False\r
-  for j in range(len(list1)):\r
-    list1[j] = [list1[j], '']\r
-  \r
-  for i in listCommon:\r
-    if i not in list1:\r
-      list1.append([i, ''])\r
-  for i in listIa32:\r
-    for j in range(len(list1)):\r
-      if i == list1[j][0]:\r
-        isFound = True\r
-        list1[j] = [list1[j][0], 'IA32|']\r
-        break\r
-    if not isFound:\r
-      list1.append([i, 'IA32|'])\r
-    isFound = False\r
-  \r
-  for i in listX64:\r
-    for j in range(len(list1)):\r
-      if i == list1[j][0]:\r
-        isFound = True\r
-        list1[j] = [list1[j][0], list1[j][1] + 'X64|']\r
-        break\r
-    if not isFound:\r
-      list1.append([i, 'X64|'])\r
     isFound = False\r
-  \r
-  for i in listIpf:\r
     for j in range(len(list1)):\r
-      if i == list1[j][0]:\r
-        isFound = True\r
-        list1[j] = [list1[j][0], list1[j][1] + 'Ipf|']\r
-        break\r
-    if not isFound:\r
-      list1.append([i, 'Ipf|'])\r
-    isFound = False\r
+        list1[j] = [list1[j], '']\r
     \r
-  for i in listEbc:\r
-    for j in range(len(list1)):\r
-      if i == list1[j][0]:\r
-        isFound = True\r
-        list1[j] = [list1[j][0], list1[j][1] + 'Ebc|']\r
-        break\r
-    if not isFound:\r
-      list1.append([i, 'Ebc|'])\r
-    isFound = False\r
+    for i in listCommon:\r
+        if i not in list1:\r
+            list1.append([i, ''])\r
+    for i in listIa32:\r
+        for j in range(len(list1)):\r
+            if i == list1[j][0]:\r
+                isFound = True\r
+                list1[j] = [list1[j][0], 'IA32|']\r
+                break\r
+        if not isFound:\r
+            list1.append([i, 'IA32|'])\r
+        isFound = False\r
+    \r
+    for i in listX64:\r
+        for j in range(len(list1)):\r
+            if i == list1[j][0]:\r
+                isFound = True\r
+                list1[j] = [list1[j][0], list1[j][1] + 'X64|']\r
+                break\r
+        if not isFound:\r
+            list1.append([i, 'X64|'])\r
+        isFound = False\r
     \r
-  #Remove DataType.TAB_VALUE_SPLIT\r
-  for i in range(len(list1)):\r
-    if list1[i][1].endswith(DataType.TAB_VALUE_SPLIT):\r
-      list1[i][1] = list1[i][1].rsplit(DataType.TAB_VALUE_SPLIT, 1)[0]\r
+    for i in listIpf:\r
+        for j in range(len(list1)):\r
+            if i == list1[j][0]:\r
+                isFound = True\r
+                list1[j] = [list1[j][0], list1[j][1] + 'Ipf|']\r
+                break\r
+        if not isFound:\r
+            list1.append([i, 'Ipf|'])\r
+        isFound = False\r
+        \r
+    for i in listEbc:\r
+        for j in range(len(list1)):\r
+            if i == list1[j][0]:\r
+                isFound = True\r
+                list1[j] = [list1[j][0], list1[j][1] + 'Ebc|']\r
+                break\r
+        if not isFound:\r
+            list1.append([i, 'Ebc|'])\r
+        isFound = False\r
+        \r
+    #Remove DataType.TAB_VALUE_SPLIT\r
+    for i in range(len(list1)):\r
+        if list1[i][1].endswith(DataType.TAB_VALUE_SPLIT):\r
+            list1[i][1] = list1[i][1].rsplit(DataType.TAB_VALUE_SPLIT, 1)[0]\r
 \r
-  #print list1\r
+    #print list1\r
 \r
 def GetComponents(Lines, Key, KeyValues, CommentCharacter):\r
-  #KeyValues [ ['component name', [lib1, lib2, lib3], [bo1, bo2, bo3]], ...]\r
-  Lines = Lines.split(DataType.TAB_SECTION_END, 1)[1]\r
-  findBlock = False\r
-  findLibraryClass = False\r
-  findBuildOption = False\r
-  ListItem = None\r
-  LibraryClassItem = []\r
-  BuildOption = []\r
-  \r
-  LineList = Lines.split('\n')\r
-  for Line in LineList:\r
-    Line = CleanString(Line, CommentCharacter)\r
-    if Line == None or Line == '':\r
-      continue\r
-    \r
-    if findBlock == False:\r
-      ListItem = Line\r
-      #find '{' at line tail\r
-      if Line.endswith('{'):\r
-        findBlock = True\r
-        ListItem = CleanString(Line.rsplit('{', 1)[0], CommentCharacter)\r
-\r
-    if findBlock:  \r
-      if Line.find('<LibraryClass>') != -1:\r
-        findLibraryClass = True\r
-        continue\r
-      if Line.find('<BuildOptions>') != -1:\r
-        findBuildOption = True\r
-        continue\r
-      if Line.endswith('}'):\r
-        #find '}' at line tail\r
-        KeyValues.append([ListItem, LibraryClassItem, BuildOption])\r
-        findBlock = False\r
-        findLibraryClass = False\r
-        findBuildOption = False\r
-        LibraryClassItem = []\r
-        BuildOption = []\r
-        continue\r
-\r
-    if findBlock:\r
-      if findLibraryClass:\r
-        LibraryClassItem.append(Line)\r
-      elif findBuildOption:\r
-        BuildOption.append(Line)\r
-    else:\r
-      KeyValues.append([ListItem, [], []])\r
+    #KeyValues [ ['component name', [lib1, lib2, lib3], [bo1, bo2, bo3]], ...]\r
+    Lines = Lines.split(DataType.TAB_SECTION_END, 1)[1]\r
+    findBlock = False\r
+    findLibraryClass = False\r
+    findBuildOption = False\r
+    ListItem = None\r
+    LibraryClassItem = []\r
+    BuildOption = []\r
     \r
-  return True\r
+    LineList = Lines.split('\n')\r
+    for Line in LineList:\r
+        Line = CleanString(Line, CommentCharacter)\r
+        if Line == None or Line == '':\r
+            continue\r
+        \r
+        if findBlock == False:\r
+            ListItem = Line\r
+            #find '{' at line tail\r
+            if Line.endswith('{'):\r
+                findBlock = True\r
+                ListItem = CleanString(Line.rsplit('{', 1)[0], CommentCharacter)\r
+\r
+        if findBlock:    \r
+            if Line.find('<LibraryClass>') != -1:\r
+                findLibraryClass = True\r
+                continue\r
+            if Line.find('<BuildOptions>') != -1:\r
+                findBuildOption = True\r
+                continue\r
+            if Line.endswith('}'):\r
+                #find '}' at line tail\r
+                KeyValues.append([ListItem, LibraryClassItem, BuildOption])\r
+                findBlock = False\r
+                findLibraryClass = False\r
+                findBuildOption = False\r
+                LibraryClassItem = []\r
+                BuildOption = []\r
+                continue\r
+\r
+        if findBlock:\r
+            if findLibraryClass:\r
+                LibraryClassItem.append(Line)\r
+            elif findBuildOption:\r
+                BuildOption.append(Line)\r
+        else:\r
+            KeyValues.append([ListItem, [], []])\r
+        \r
+    return True\r
 \r
 def GetLibraryClassesWithModuleType(Lines, Key, KeyValues, CommentCharacter):\r
-  newKey = SplitModuleType(Key)\r
-  Lines = Lines.split(DataType.TAB_SECTION_END, 1)[1]\r
-  LineList = Lines.splitlines()\r
-  for Line in LineList:\r
-    if Line != '' and Line[0] != CommentCharacter:\r
-      KeyValues.append([CleanString(Line, CommentCharacter), newKey[1]])\r
+    newKey = SplitModuleType(Key)\r
+    Lines = Lines.split(DataType.TAB_SECTION_END, 1)[1]\r
+    LineList = Lines.splitlines()\r
+    for Line in LineList:\r
+        if Line != '' and Line[0] != CommentCharacter:\r
+            KeyValues.append([CleanString(Line, CommentCharacter), newKey[1]])\r
 \r
-  return True\r
+    return True\r
 \r
 def SplitModuleType(Key):\r
-  #from DataType import *\r
-  KeyList = Key.split(DataType.TAB_SPLIT)\r
-  rtv = []\r
-  if len(KeyList) == 3:\r
-    rtv.append(KeyList[0] + DataType.TAB_SPLIT + KeyList[1])\r
-    rtv.append(KeyList[2])\r
-    return rtv\r
-  else:\r
-    rtv.append(Key)\r
-    rtv.append(None)\r
-    return rtv\r
-  \r
+    #from DataType import *\r
+    KeyList = Key.split(DataType.TAB_SPLIT)\r
+    rtv = []\r
+    if len(KeyList) == 3:\r
+        rtv.append(KeyList[0] + DataType.TAB_SPLIT + KeyList[1])\r
+        rtv.append(KeyList[2])\r
+        return rtv\r
+    else:\r
+        rtv.append(Key)\r
+        rtv.append(None)\r
+        return rtv\r
+    \r
 def NormPath(path):\r
-  if path != '':\r
-    return os.path.normpath(path)\r
-  else:\r
-    return path\r
+    if path != '':\r
+        return os.path.normpath(path)\r
+    else:\r
+        return path\r
 \r
 def CleanString(Line, CommentCharacter = DataType.TAB_COMMENT_SPLIT):\r
-  #remove comments\r
-  Line = Line.split(CommentCharacter, 1)[0];\r
-  #remove whitespace\r
-  Line = Line.strip();\r
-  #replace '\\', '\' with '/'\r
-  Line = Line.replace('\\', '/')\r
-  Line = Line.replace('//', '/')\r
-  #remove ${WORKSPACE}\r
-  Line = Line.replace(DataType.TAB_WORKSPACE1, '')\r
-  Line = Line.replace(DataType.TAB_WORKSPACE2, '')\r
-  #remove '/' at the beginning\r
-  if Line.startswith('/'):\r
-    Line = Line.replace('/', '')\r
-  #Change path\r
-  #Line = os.path.normpath(Line)\r
-  \r
-  return Line\r
+    #remove comments\r
+    Line = Line.split(CommentCharacter, 1)[0];\r
+    #remove whitespace\r
+    Line = Line.strip();\r
+    #replace '\\', '\' with '/'\r
+    Line = Line.replace('\\', '/')\r
+    Line = Line.replace('//', '/')\r
+    #remove ${WORKSPACE}\r
+    Line = Line.replace(DataType.TAB_WORKSPACE1, '')\r
+    Line = Line.replace(DataType.TAB_WORKSPACE2, '')\r
+    #remove '/' at the beginning\r
+    if Line.startswith('/'):\r
+        Line = Line.replace('/', '')\r
+    #Change path\r
+    #Line = os.path.normpath(Line)\r
+    \r
+    return Line\r
 \r
 def GetMultipleValuesOfKeyFromLines(Lines, Key, KeyValues, CommentCharacter):\r
-  Lines = Lines.split(DataType.TAB_SECTION_END, 1)[1]\r
-  LineList = Lines.split('\n')\r
-  for Line in LineList:\r
-    Line = CleanString(Line, CommentCharacter)\r
-    if Line != '' and Line[0] != CommentCharacter:\r
-      KeyValues += [Line]\r
+    Lines = Lines.split(DataType.TAB_SECTION_END, 1)[1]\r
+    LineList = Lines.split('\n')\r
+    for Line in LineList:\r
+        Line = CleanString(Line, CommentCharacter)\r
+        if Line != '' and Line[0] != CommentCharacter:\r
+            KeyValues += [Line]\r
 \r
-  return True\r
+    return True\r
 \r
 def GetSingleValueOfKeyFromLines(Lines, Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter):\r
-  Lines = Lines.split('\n')\r
-  Keys = []\r
-  Value = ''\r
-  for Line in Lines:\r
-    LineList = Line.split(KeySplitCharacter, 1)\r
-    if len(LineList) >= 2:\r
-      Key = LineList[0].split()\r
-      if len(Key) == 1 and Key[0][0] != CommentCharacter:\r
-        #Remove comments and white spaces\r
-        LineList[1] = CleanString(LineList[1], CommentCharacter)\r
-        if ValueSplitFlag:\r
-          ValueList = LineList[1].replace('\\','/').split(ValueSplitCharacter)\r
-          if len(ValueList) == 1:\r
-            Value = ValueList[0]\r
-        else:\r
-          Value = CleanString(LineList[1], CommentCharacter)\r
-            \r
-        if Key[0] not in Keys:\r
-          Keys += [Key[0]]\r
-          Dictionary[Key[0]] = Value\r
-        else:\r
-          tmp = []\r
-          old = Dictionary[Key[0]]\r
-          if type(old) != type([]):\r
-            tmp.extend(old.split())\r
-          else:\r
-            tmp.extend(old)\r
-          tmp.extend(Value.split())\r
-          Dictionary[Key[0]] = tmp\r
-        \r
-  return True\r
+    Lines = Lines.split('\n')\r
+    Keys = []\r
+    Value = ''\r
+    for Line in Lines:\r
+        LineList = Line.split(KeySplitCharacter, 1)\r
+        if len(LineList) >= 2:\r
+            Key = LineList[0].split()\r
+            if len(Key) == 1 and Key[0][0] != CommentCharacter:\r
+                #Remove comments and white spaces\r
+                LineList[1] = CleanString(LineList[1], CommentCharacter)\r
+                if ValueSplitFlag:\r
+                    ValueList = LineList[1].replace('\\','/').split(ValueSplitCharacter)\r
+                    if len(ValueList) == 1:\r
+                        Value = ValueList[0]\r
+                else:\r
+                    Value = CleanString(LineList[1], CommentCharacter)\r
+                \r
+                if Key[0] not in Keys:\r
+                    Dictionary[Key[0]] = Value.split()\r
+                    Keys.append(Key[0])\r
+                else:\r
+                    Dictionary[Key[0]].extend(Value.split())                \r
+    return True\r
 \r
 \r
 if __name__ == '__main__':\r
-  print SplitModuleType('LibraryClasses.common.DXE_RUNTIME_DRIVER')\r
-  print SplitModuleType('Library.common')\r
-  print SplitModuleType('Librarsdsfwe')
\ No newline at end of file
+    print SplitModuleType('LibraryClasses.common.DXE_RUNTIME_DRIVER')\r
+    print SplitModuleType('Library.common')\r
+    print SplitModuleType('Librarsdsfwe')
\ No newline at end of file