Update GenFds related file for Python source tree structure change.
authorqouyang <qouyang@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 19 Jul 2007 06:22:30 +0000 (06:22 +0000)
committerqouyang <qouyang@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 19 Jul 2007 06:22:30 +0000 (06:22 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@361 7335b38e-4728-0410-8992-fb3ffe349368

19 files changed:
Source/Python/Common/EdkIIWorkspaceBuild.py
Source/Python/FdfParser.py
Source/Python/FfsInfStatement.py
Source/Python/GenFds.py
Source/Python/GenFds/DataSection.py
Source/Python/GenFds/EfiSection.py
Source/Python/GenFds/Fd.py
Source/Python/GenFds/FdfParser.py
Source/Python/GenFds/FfsFileStatement.py
Source/Python/GenFds/FfsInfStatement.py
Source/Python/GenFds/Fv.py
Source/Python/GenFds/GenFds.py
Source/Python/GenFds/GenFdsGlobalVariable.py
Source/Python/GenFds/GuidSection.py
Source/Python/GenFds/Region.py
Source/Python/GenFds/Vtf.py
Source/Python/GuidSection.py
Source/Python/Region.py
Source/Python/Vtf.py

index 50d713e..35f1a04 100644 (file)
@@ -25,9 +25,9 @@ from DecClassObject import *
 from DscClassObject import *\r
 from String import *\r
 from ClassObjects.CommonClassObject import *\r
-from GenFds.FdfParser import *\r
+#from FdfParser import *\r
 from BuildToolError import *\r
-from GenFds.Region import *\r
+#from Region import *\r
 \r
 class ModuleSourceFilesClassObject(object):\r
     def __init__(self, SourceFile = '', PcdFeatureFlag = '', TagName = '', ToolCode = '', ToolChainFamily = '', String = ''):\r
index 8c7afa0..db550c1 100644 (file)
@@ -1714,7 +1714,7 @@ class FdfParser:
 \r
         compStatement.CompLoc = ""\r
         if self.__GetNextWord():\r
-        compStatement.CompLoc = self.__Token\r
+            compStatement.CompLoc = self.__Token\r
             if self.__IsToken('|'):\r
                 if not self.__GetNextWord():\r
                     raise Warning("Expected Region Name At Line %d" % self.CurrentLineNumber)\r
index 638d918..6c75323 100644 (file)
@@ -7,7 +7,7 @@ import sys
 import Section\r
 import RuleSimpleFile\r
 import RuleComplexFile\r
-from String import *\r
+#from String import *\r
 \r
 class FfsInfStatement(Ffs.Ffs):\r
     def __init__(self):\r
index 7fb28a8..f2b4b80 100644 (file)
@@ -3,7 +3,7 @@ import sys
 import os\r
 import FdfParser\r
 from GenFdsGlobalVariable import GenFdsGlobalVariable\r
-import EdkIIWorkspaceBuild\r
+import Common.EdkIIWorkspaceBuild\r
 import RuleComplexFile\r
 from EfiSection import EfiSection\r
 import StringIO\r
@@ -60,7 +60,7 @@ def main():
     \r
     """call workspace build create database"""\r
     os.environ["WORKSPACE"] = workspace\r
-    buildWorkSpace = EdkIIWorkspaceBuild.WorkspaceBuild(activePlatform)\r
+    buildWorkSpace = Common.EdkIIWorkspaceBuild.WorkspaceBuild(activePlatform)\r
     \r
     """Call GenFds"""\r
     GenFds.GenFd(outputDir, fdfParser, buildWorkSpace, archList)\r
index 6f5c072..8551016 100644 (file)
@@ -6,7 +6,7 @@ import os
 \r
 class DataSection (Section.Section):\r
     def __init__(self):\r
-        self.Alignemnt = None\r
+        self.Alignment = None\r
         self.SecType = None\r
         self.SectFileName = None\r
         self.SectionList = []\r
@@ -48,4 +48,4 @@ class DataSection (Section.Section):
         \r
         print GenSectionCmd\r
         GenFdsGlobalVariable.CallExternalTool(GenSectionCmd, "GenSection Failed!")\r
-        return OutputFile, self.Alignemnt\r
+        return OutputFile, self.Alignment\r
index 4d555f0..bf713f3 100644 (file)
@@ -123,9 +123,4 @@ class EfiSection (Section.Section):
         #\r
         print GenSectionCmd\r
         GenFdsGlobalVariable.CallExternalTool(GenSectionCmd, "GenSection Failed !")\r
-##        if self.Alignment == None:\r
-##             print "#####################################"\r
-##             print "Align is none"\r
-        \r
-        \r
         return OutputFile , self.Alignment\r
index 129113a..f478c50 100644 (file)
@@ -21,7 +21,7 @@ class FD:
         # SetVarDict[var] = value\r
         self.SetVarDict = {}\r
         self.RegionList = []\r
-        \r
+        self.vtfRawDict = {}\r
         \r
 ##\r
 #  Create Fd file\r
@@ -34,12 +34,14 @@ class FD:
         for item in GenFdsGlobalVariable.FdfParser.profile.FvDict:\r
             print item\r
             \r
+        self.GenVtfFile()\r
+        \r
         FdBuffer = StringIO.StringIO('')\r
         for Regions in self.RegionList :\r
             #\r
             # Call each region's AddToBuffer function \r
             #\r
-            Regions.AddToBuffer (FdBuffer, self.BaseAddress, self.BlockSizeList, self.ErasePolarity, FvBinDict)\r
+            Regions.AddToBuffer (FdBuffer, self.BaseAddress, self.BlockSizeList, self.ErasePolarity, FvBinDict, self.vtfRawDict)\r
         #\r
         # Create a empty Fd file\r
         #\r
@@ -60,3 +62,35 @@ class FD:
 ##\r
     def GenFlashMap ():\r
         pass\r
+    \r
+    def GenVtfFile (self) :\r
+        #\r
+        # Get this Fd's all Fv name\r
+        #\r
+        fvAddDict ={}\r
+        fvList = []\r
+        for region in self.RegionList:\r
+            if region.RegionType == 'FV':\r
+                fvList.append(region.RegionData.upper())\r
+                fvAddDict[region.RegionData.upper()] = (int(self.BaseAddress,16) + \\r
+                                                region.Offset, region.Size)\r
+        #\r
+        # Check whether this Fd need VTF\r
+        #\r
+        flag = False\r
+        for vtf in GenFdsGlobalVariable.FdfParser.profile.VtfList:\r
+            compLocList = vtf.GetFvList()\r
+            if set(compLocList).issubset(fvList):\r
+                flag = True\r
+                break\r
+        if flag == True:\r
+            self.vtfRawDict = vtf.GenVtf(fvAddDict)\r
+\r
+        \r
+\r
+               \r
+\r
+\r
+                \r
+                \r
+            \r
index 5f22cfb..db550c1 100644 (file)
@@ -286,7 +286,9 @@ class FdfParser:
         StartPos = self.CurrentOffsetWithinLine\r
         while not self.__EndOfLine():\r
                 TempChar = self.__CurrentChar()\r
-                if not str(TempChar).isspace() and TempChar not in ('=', '|', ',', '}'):\r
+                if not str(TempChar).isspace() and TempChar not in ('=', '|', ',', '{', '}'):\r
+                    self.__GetOneChar()\r
+                elif StartPos == self.CurrentOffsetWithinLine and TempChar in ('=', '|', ',', '{', '}'):\r
                     self.__GetOneChar()\r
                 else:\r
                     break\r
@@ -1710,11 +1712,20 @@ class FdfParser:
         if not self.__IsToken("="):\r
             raise Warning("expected '=' At Line %d" % self.CurrentLineNumber)\r
 \r
-        if not self.__GetNextWord():\r
-            raise Warning("expected Component location At Line %d" % self.CurrentLineNumber)\r
-        if self.__Token not in ("F", "N", "S", "H", "L", "PH", "PL"):\r
-            raise Warning("Unknown location type At line %d" % self.CurrentLineNumber)\r
-        compStatement.CompLoc = self.__Token\r
+        compStatement.CompLoc = ""\r
+        if self.__GetNextWord():\r
+            compStatement.CompLoc = self.__Token\r
+            if self.__IsToken('|'):\r
+                if not self.__GetNextWord():\r
+                    raise Warning("Expected Region Name At Line %d" % self.CurrentLineNumber)\r
+                \r
+                if self.__Token not in ("F", "N", "S", "H", "L", "PH", "PL"):\r
+                    raise Warning("Unknown location type At line %d" % self.CurrentLineNumber)\r
+                compStatement.CompLoc += "|"\r
+                compStatement.CompLoc += self.__Token\r
+        else:\r
+            self.CurrentLineNumber += 1\r
+            self.CurrentOffsetWithinLine = 0\r
         \r
         if not self.__IsKeyword("COMP_TYPE"):\r
             raise Warning("expected COMP_TYPE At Line %d" % self.CurrentLineNumber)\r
index 06fd904..4743727 100644 (file)
@@ -33,7 +33,7 @@ class FileStatements (Ffs.Ffs) :
                                    sect\r
                     if align != None:\r
                         SectionFiles = SectionFiles  + \\r
-                                       ' -o '        + \\r
+                                       ' -n '        + \\r
                                        align\r
                                \r
         #\r
index 0deb481..691f581 100644 (file)
@@ -7,7 +7,7 @@ import sys
 import Section\r
 import RuleSimpleFile\r
 import RuleComplexFile\r
-from Common.String import *\r
+#from String import *\r
 \r
 class FfsInfStatement(Ffs.Ffs):\r
     def __init__(self):\r
@@ -45,7 +45,6 @@ class FfsInfStatement(Ffs.Ffs):
 \r
         self.OutputPath = os.path.join(GenFdsGlobalVariable.FfsDir, \\r
                                        self.ModuleGuid + self.BaseName)\r
-        self.OutputPath = os.path.normcase(self.OutputPath)\r
         if not os.path.exists(self.OutputPath) :\r
             os.makedirs(self.OutputPath)\r
             \r
@@ -114,7 +113,6 @@ class FfsInfStatement(Ffs.Ffs):
                    '.'         + \\r
                    self.ModuleType.upper()\r
         \r
-\r
         Rule = GenFdsGlobalVariable.FdfParser.profile.RuleDict.get(RuleName)\r
         if Rule == None :\r
             RuleName = 'RULE'      + \\r
@@ -122,7 +120,7 @@ class FfsInfStatement(Ffs.Ffs):
                        'COMMON'    + \\r
                        '.'         + \\r
                        self.ModuleType.upper()\r
-                       \r
+            print "Want To Find Rule Name is : " + RuleName\r
             Rule = GenFdsGlobalVariable.FdfParser.profile.RuleDict.get(RuleName)\r
             if Rule == None :\r
                 print 'Dont Find Related Rule, Using Default Rule !!!'\r
@@ -229,7 +227,7 @@ class FfsInfStatement(Ffs.Ffs):
     def __GenComplexFileSection__(self, Rule):\r
         SectFiles = ''\r
         for Sect in Rule.SectionList:\r
-           print 'GenSection: %s %s :' %(self.OutputPath ,self.ModuleGuid)\r
+           #print 'GenSection: %s %s :' %(self.OutputPath ,self.ModuleGuid)\r
            secName = ''\r
            secName, Align = Sect.GenSection(self.OutputPath , self.ModuleGuid, self.KeyStringList, self)\r
            if secName != '':\r
@@ -280,4 +278,4 @@ class FfsInfStatement(Ffs.Ffs):
         else :\r
             Alignment = ''\r
             \r
-        return FileType, Fixed, CheckSum, Alignment\r
+        return FileType, Fixed, CheckSum, Alignment
\ No newline at end of file
index 6a5c8fa..096ca38 100644 (file)
@@ -30,8 +30,8 @@ class FV:
     #\r
     #  Generate Fv and add it to the Buffer\r
     #\r
-    def AddToBuffer (self, Buffer, BaseAddress= None, BlockSize= None, BlockNum=None, ErasePloarity='1') :\r
-        self.__InitialInf__(BaseAddress, BlockSize, BlockNum)\r
+    def AddToBuffer (self, Buffer, BaseAddress=None, BlockSize= None, BlockNum=None, ErasePloarity='1', VtfDict=None) :\r
+        self.__InitialInf__(BaseAddress, BlockSize, BlockNum, ErasePloarity, VtfDict)\r
         #\r
         # First Process the Apriori section\r
         #\r
@@ -80,10 +80,11 @@ class FV:
         fv.close\r
         return FvOutputFile\r
     \r
-    def __InitialInf__ (self, BaseAddress = None, BlockSize= None, BlockNum = None, ErasePloarity='1') :\r
+    def __InitialInf__ (self, BaseAddress = None, BlockSize= None, BlockNum = None, ErasePloarity='1', VtfDict=None) :\r
         self.InfFileName = os.path.join(GenFdsGlobalVariable.FvDir,\r
                                    self.UiFvName + '.inf')\r
         self.FvInfFile = open (self.InfFileName, 'w+')\r
+        \r
         #\r
         # Add [Options]\r
         #\r
@@ -136,6 +137,11 @@ class FV:
         #\r
             \r
         self.FvInfFile.writelines("[files]" + T_CHAR_LF)\r
+        if VtfDict != None and self.UiFvName in VtfDict.keys():\r
+            self.FvInfFile.writelines("EFI_FILE_NAME = "                   + \\r
+                                       VtfDict.get(self.UiFvName)          + \\r
+                                       T_CHAR_LF)\r
+        \r
 \r
 \r
 \r
index 4755589..f2b4b80 100644 (file)
@@ -60,7 +60,7 @@ def main():
     \r
     """call workspace build create database"""\r
     os.environ["WORKSPACE"] = workspace\r
-    buildWorkSpace = EdkIIWorkspaceBuild.WorkspaceBuild(activePlatform)\r
+    buildWorkSpace = Common.EdkIIWorkspaceBuild.WorkspaceBuild(activePlatform)\r
     \r
     """Call GenFds"""\r
     GenFds.GenFd(outputDir, fdfParser, buildWorkSpace, archList)\r
@@ -124,14 +124,21 @@ class GenFds :
                 fv = GenFdsGlobalVariable.FdfParser.profile.FvDict[FvName]\r
                 fv.AddToBuffer(Buffer)\r
                 Buffer.close()\r
+                \r
+        #print "#########   Gen Capsule              ####################"\r
         for capsule in GenFdsGlobalVariable.FdfParser.profile.CapsuleList:\r
             capsule.GenCapsule()\r
 \r
-        for vtf in GenFdsGlobalVariable.FdfParser.profile.VtfList:\r
-            vtf.GenVtf()\r
+##        for vtf in GenFdsGlobalVariable.FdfParser.profile.VtfList:\r
+##            vtf.GenVtf()\r
 \r
     #Finish GenFd()\r
-            \r
+    def GenVTFList() :\r
+        for item in GenFdsGlobalVariable.FdfParser.profile.VtfList:\r
+            for comp in item.ComponentStatementList:\r
+                if comp.CompLoc != None :\r
+                    compList.append(comp.Loc)\r
+            GenFdsGlobalVariable.VtfDict[item.UiName] = compList\r
     #\r
     # Define GenFd as static function\r
     #\r
index e450a59..c0ff562 100644 (file)
@@ -12,6 +12,7 @@ class GenFdsGlobalVariable:
     RuleDict = {}\r
     DefaultRule = None\r
     ArchList = None\r
+    VtfDict = {}\r
     \r
     def ExtendMarco (String):\r
         return String\r
@@ -26,7 +27,10 @@ class GenFdsGlobalVariable:
         GenFdsGlobalVariable.WorkSpaceDir = GenFdsGlobalVariable.WorkSpace.Workspace.WorkspaceDir\r
         if ArchList != None:\r
             GenFdsGlobalVariable.ArchList = ArchList\r
-        \r
+            \r
+        if not os.path.exists(GenFdsGlobalVariable.FvDir) :\r
+            os.makedirs(GenFdsGlobalVariable.FvDir)\r
+            \r
     def SetDefaultRule (Rule) :\r
         GenFdsGlobalVariable.DefaultRule = Rule\r
 \r
@@ -37,7 +41,11 @@ class GenFdsGlobalVariable:
     def CallExternalTool (cmd, errorMess):\r
         PopenObject = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr= subprocess.PIPE)\r
         (out, error) = PopenObject.communicate()\r
+\r
+        while PopenObject.returncode == None :\r
+            PopenObject.wait()\r
         if PopenObject.returncode != 0:\r
+            print "Return Value = %d" %PopenObject.returncode\r
             print out\r
             print error\r
             raise Exception(errorMess)\r
index e1f669a..dd53e1e 100644 (file)
@@ -76,6 +76,7 @@ class GuidSection(Section.Section) :
             TempFile = os.path.normpath(TempFile)\r
             \r
             ExternalToolCmd = ExternalTool                             + \\r
+                              ' -e '                                   + \\r
                               ' -o '                                   + \\r
                               TempFile                                 + \\r
                               ' '                                      + \\r
index a71f865..6e21c9d 100644 (file)
@@ -1,4 +1,3 @@
-import GenFds\r
 from struct import *\r
 from GenFdsGlobalVariable import GenFdsGlobalVariable\r
 import StringIO\r
@@ -19,7 +18,7 @@ class region:
 ##\r
 #  Add RegionData to Fd file\r
 ##\r
-    def AddToBuffer(self, Buffer, BaseAddress, BlockSizeList, ErasePolarity, FvBinDict):\r
+    def AddToBuffer(self, Buffer, BaseAddress, BlockSizeList, ErasePolarity, FvBinDict, vtfDict = None):\r
         Size = self.Size\r
         print "Fv Size = %d" %Size\r
         \r
@@ -41,7 +40,7 @@ class region:
                 BlockSize = self.__BlockSizeOfRegion__(BlockSizeList)\r
                 BlockNum = self.__BlockNumOfRegion__(BlockSize)\r
                 FvBaseAddress = '0x%x' %self.FvAddress\r
-                FileName = fv.AddToBuffer(Buffer, FvBaseAddress, BlockSize, BlockNum, ErasePolarity)\r
+                FileName = fv.AddToBuffer(Buffer, FvBaseAddress, BlockSize, BlockNum, ErasePolarity, vtfDict)\r
                 FvBinDict[self.RegionData.upper()] = FileName\r
 \r
         if self.RegionType == 'FILE':\r
index b371a71..18e9d02 100644 (file)
@@ -11,30 +11,26 @@ class Vtf:
         self.ResetBin = None\r
         self.ComponentStatementList = []\r
         \r
-        \r
 \r
-    def GenVtf(self) :\r
+    def GenVtf(self, fdAddDict) :\r
         self.GenBsfInf()\r
-        OutputFile = os.path.join(GenFdsGlobalVariabel.FvDir, self.UiName + '.Vtf')\r
-        BaseAddArg = ''\r
-        for item in self.BaseAddressList :\r
-            BaseAddArg = BaseAddArg   + \\r
-                         ' -a '       + \\r
-                         item[0]      + \\r
-                         ' -s '       + \\r
-                         item[1]\r
-        cmd = "GenVtf -i "     + \\r
-               ' -o '          + \\r
-               OutputFile      + \\r
+        OutputFile = os.path.join(GenFdsGlobalVariable.FvDir, self.UiName + '.Vtf')\r
+        BaseAddArg = self.GetBaseAddArg(fdAddDict)\r
+        outputArg, VtfRawDict = self.GenOutputArg()\r
+        \r
+        cmd = "GenVtf "        + \\r
+               outputArg       + \\r
+               ' -f '          + \\r
                self.BsfInfName + \\r
-               BaseAddArg\r
+               ' '             + \\r
+               BaseAddArg      \r
                \r
         print cmd\r
         GenFdsGlobalVariable.CallExternalTool(cmd, "GenFv -Vtf Failed!")\r
-        \r
+        return VtfRawDict\r
         \r
     def GenBsfInf (self):\r
-        self.BaseAddressList = []\r
+        fvList = self.GetFvList()\r
         self.BsfInfName = os.path.join(GenFdsGlobalVariable.FvDir, self.UiName + '.inf')\r
         BsfInf = open (self.BsfInfName, 'w+')\r
         BsfInf.writelines ("[COMPONENTS]" + T_CHAR_LF)\r
@@ -44,10 +40,24 @@ class Vtf:
                                " = "              + \\r
                                component.CompName + \\r
                                T_CHAR_LF )\r
-            BsfInf.writelines ("COMP_LOC"        + \\r
-                               " = "             + \\r
-                               component.CompLoc + \\r
-                               T_CHAR_LF )\r
+            if component.CompLoc.supper() == 'NONE' :\r
+                BsfInf.writelines ("COMP_LOC"        + \\r
+                                   " = "             + \\r
+                                   'N'               + \\r
+                                   T_CHAR_LF )\r
+            else:\r
+                index = fvList.index(component.CompLoc.upper())\r
+                if index == 0:\r
+                    BsfInf.writelines ("COMP_LOC"        + \\r
+                                       " = "             + \\r
+                                       'F'               + \\r
+                                       T_CHAR_LF )\r
+                elif index == 1:\r
+                    BsfInf.writelines ("COMP_LOC"        + \\r
+                                       " = "             + \\r
+                                       S                 + \\r
+                                       T_CHAR_LF )\r
+                \r
             BsfInf.writelines ("COMP_TYPE"        + \\r
                                " = "              + \\r
                                component.CompType + \\r
@@ -62,11 +72,11 @@ class Vtf:
                                T_CHAR_LF )\r
             BsfInf.writelines ("COMP_BIN"        + \\r
                                " = "             + \\r
-                               component.CompBin + \\r
+                               GenFdsGlobalVariable.ReplaceWorkspaceMarco(component.CompBin) + \\r
                                T_CHAR_LF )\r
             BsfInf.writelines ("COMP_SYM"        + \\r
                                " = "             + \\r
-                               component.CompSym + \\r
+                               GenFdsGlobalVariable.ReplaceWorkspaceMarco(component.CompSym) + \\r
                                T_CHAR_LF )\r
             BsfInf.writelines ("COMP_SIZE"        + \\r
                                " = "              + \\r
@@ -74,13 +84,40 @@ class Vtf:
                                T_CHAR_LF )\r
             BsfInf.writelines (T_CHAR_LF )\r
             \r
-            if component[1] == 'F' :\r
-                for fd in GenFdsGlobalVariable.FdfParser.profile.FdDict :\r
-                    BaseAddress = fd.RegionList[0].Offset\r
-                    Size = fd.RegionList[0].Size\r
-            elif component[1] == 'S':\r
-                for fd in GenFdsGlobalVariable.FdfParser.profile.FdDict :\r
-                    BaseAddress = fd.RegionList[1].Offset\r
-                    Size = fd.RegionList[1].Size\r
-            self.BaseAddressList.append(BaseAddress, Size)\r
         BsfInf.close()\r
+\r
+    def GetFvList(self):\r
+        fvList = []\r
+        for component in self.ComponentStatementList :\r
+            if component.CompLoc != None and not (component.CompLoc in fvList):\r
+                fvList.append(component.CompLoc.upper())\r
+                \r
+        return fvList\r
+\r
+    def GetBaseAddArg(self, fdAddDict):\r
+        fvList = self.GetFvList()\r
+        cmdStr = ''\r
+        for i in fvList:\r
+            (baseAdd, size) = fdAddDict.get(i)\r
+            cmdStr = cmdStr               + \\r
+                     ' -r 0x%x' %baseAdd  + \\r
+                     ' -s 0x%x' %size\r
+        return cmdStr\r
+                     \r
+    def GenOutputArg(self):\r
+        fvVtfDict = {}\r
+        outPutFileName = ''\r
+        fvList = self.GetFvList()\r
+        index = 0\r
+        arg = ''\r
+        for fv in fvList:\r
+            index = index +1\r
+            outputFileName = 'Vtf%d.raw' %index\r
+            outPutFileName = os.path.join(GenFdsGlobalVariable.FvDir, outputFileName)\r
+            arg = arg    + \\r
+                  ' -o ' + \\r
+                  outPutFileName\r
+            fvVtfDict[fv.upper()] = outPutFileName\r
+            \r
+        return arg, fvVtfDict\r
+                \r
index e1f669a..dd53e1e 100644 (file)
@@ -76,6 +76,7 @@ class GuidSection(Section.Section) :
             TempFile = os.path.normpath(TempFile)\r
             \r
             ExternalToolCmd = ExternalTool                             + \\r
+                              ' -e '                                   + \\r
                               ' -o '                                   + \\r
                               TempFile                                 + \\r
                               ' '                                      + \\r
index 267e3d0..6e21c9d 100644 (file)
@@ -1,4 +1,3 @@
-import GenFds\r
 from struct import *\r
 from GenFdsGlobalVariable import GenFdsGlobalVariable\r
 import StringIO\r
index ccbafb9..18e9d02 100644 (file)
@@ -40,7 +40,7 @@ class Vtf:
                                " = "              + \\r
                                component.CompName + \\r
                                T_CHAR_LF )\r
-            if component.CompLoc == None or component.CompLoc == '' :\r
+            if component.CompLoc.supper() == 'NONE' :\r
                 BsfInf.writelines ("COMP_LOC"        + \\r
                                    " = "             + \\r
                                    'N'               + \\r