git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@302 7335b...
authorhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Wed, 11 Jul 2007 08:01:48 +0000 (08:01 +0000)
committerhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Wed, 11 Jul 2007 08:01:48 +0000 (08:01 +0000)
Source/Python/StrGather.py

index 6a3bc46..b93582a 100644 (file)
@@ -77,7 +77,7 @@ def CreateHFileContent(BaseName, UniObjectClass):
             Str = WriteLine(Str, Line)\r
     \r
     Str =  WriteLine(Str, '')\r
-    Str = WriteLine(Str, 'extern unsigned char ' + BaseName + 'Strings;')\r
+    Str = WriteLine(Str, 'extern unsigned char ' + BaseName + 'Strings[];')\r
     return Str\r
 \r
 def CreateHFile(BaseName, UniObjectClass):\r
@@ -224,9 +224,13 @@ def SearchString(UniObjectClass, FileList):
         if os.path.isfile(File):\r
             Lines = open(File, 'r')\r
             for Line in Lines:\r
-                if Line.find(STRING_TOKEN) >= 0:\r
-                    StrName = Line[Line.find('(', Line.find(STRING_TOKEN)) + len('(') : Line.find(')', Line.find(STRING_TOKEN))].strip()\r
-                    UniObjectClass.SetStringReferenced(StrName)\r
+                if Line.find(STRING_TOKEN) > 0:\r
+                    Line = Line[Line.find(STRING_TOKEN) : ]\r
+                    StringList = Line.split(STRING_TOKEN)\r
+                    for Line in StringList:\r
+                        Line = Line.strip()\r
+                        StrName = Line[Line.find('(') + len('(') : Line.find(')')].strip()\r
+                        UniObjectClass.SetStringReferenced(StrName)\r
      \r
     UniObjectClass.ReToken()\r
 \r
@@ -259,7 +263,7 @@ def WriteLine(Target, Item):
 # This acts like the main() function for the script, unless it is 'import'ed into another\r
 # script.\r
 if __name__ == '__main__':\r
-    print 'start'\r
+    EdkLogger.info('start')\r
     \r
     UniFileList = ['C:\\Tiano\\Edk\\Sample\\Universal\\UserInterface\\SetupBrowser\\Dxe\\DriverSample\\inventorystrings.uni', 'C:\\Tiano\\Edk\\Sample\\Universal\\UserInterface\\SetupBrowser\\Dxe\\DriverSample\\VfrStrings.uni']\r
     IncludeList = ['C:\\Tiano\\Edk\\Sample\\Universal\\UserInterface\\SetupBrowser\\Dxe\\DriverSample']\r
@@ -283,4 +287,4 @@ if __name__ == '__main__':
     hfile.write(h)\r
     cfile.write(c)\r
     \r
-    print 'end'\r
+    EdkLogger.info('end')\r