Enhance Eot tool to support run standalone or invoked by other tools.
authorqhuang8 <qhuang8@c2973edb-eda0-4c78-bc6a-9341b269661f>
Thu, 28 Jan 2010 09:57:12 +0000 (09:57 +0000)
committerqhuang8 <qhuang8@c2973edb-eda0-4c78-bc6a-9341b269661f>
Thu, 28 Jan 2010 09:57:12 +0000 (09:57 +0000)
git-svn-id: https://edk2-buildtools.svn.sourceforge.net/svnroot/edk2-buildtools/trunk/BaseTools@1821 c2973edb-eda0-4c78-bc6a-9341b269661f

Source/Python/Eot/Eot.py

index 8335b30..cac9319 100644 (file)
@@ -41,24 +41,44 @@ class Eot(object):
     #\r
     #   @param  self:      The object pointer\r
     #\r
-    def __init__(self):\r
+    def __init__(self, CommandLineOption=True, IsInit=True, SourceFileList=None, \\r
+                 IncludeDirList=None, DecFileList=None, GuidList=None, LogFile=None,\r
+                 FvFileList="", MapFileList="", Report='Report.html'):\r
         # Version and Copyright\r
-        self.VersionNumber = "0.01"\r
+        self.VersionNumber = "0.02"\r
         self.Version = "%prog Version " + self.VersionNumber\r
-        self.Copyright = "Copyright (c) 2008, Intel Corporation  All rights reserved."\r
-        self.Report = 'Report.html'\r
-\r
-        self.IsInit = True\r
-\r
-        self.SourceFileList = None\r
-        self.IncludeDirList = None\r
-        self.DecFileList = None\r
-        self.GuidList = None\r
-        self.LogFile = None\r
-\r
+        self.Copyright = "Copyright (c) 2008 - 2010, Intel Corporation  All rights reserved."\r
+        self.Report = Report\r
+\r
+        self.IsInit = IsInit\r
+        self.SourceFileList = SourceFileList\r
+        self.IncludeDirList = IncludeDirList\r
+        self.DecFileList = DecFileList\r
+        self.GuidList = GuidList\r
+        self.LogFile = LogFile\r
+        self.FvFileList = FvFileList\r
+        self.MapFileList = MapFileList\r
+        \r
         # Parse the options and args\r
-        self.ParseOption()\r
+        if CommandLineOption:\r
+            self.ParseOption()\r
 \r
+        if self.FvFileList:\r
+            for FvFile in GetSplitValueList(self.FvFileList, ' '):\r
+                FvFile = os.path.normpath(FvFile)\r
+                if not os.path.isfile(FvFile):\r
+                    EdkLogger.error("Eot", EdkLogger.EOT_ERROR, "Can not find file %s " % FvFile)\r
+                EotGlobalData.gFV_FILE.append(FvFile)\r
+        else:\r
+            EdkLogger.error("Eot", EdkLogger.EOT_ERROR, "The fv file list of target platform was not specified")\r
+\r
+        if self.MapFileList:\r
+            for MapFile in GetSplitValueList(self.MapFileList, ' '):\r
+                MapFile = os.path.normpath(MapFile)\r
+                if not os.path.isfile(MapFile):\r
+                    EdkLogger.error("Eot", EdkLogger.EOT_ERROR, "Can not find file %s " % MapFile)\r
+                EotGlobalData.gMAP_FILE.append(MapFile)\r
+                \r
         # Generate source file list\r
         self.GenerateSourceFileList(self.SourceFileList, self.IncludeDirList)\r
 \r
@@ -522,20 +542,10 @@ class Eot(object):
         self.SetLogLevel(Options)\r
 \r
         if Options.FvFileList:\r
-            for FvFile in GetSplitValueList(Options.FvFileList, ' '):\r
-                FvFile = os.path.normpath(FvFile)\r
-                if not os.path.isfile(FvFile):\r
-                    EdkLogger.error("Eot", EdkLogger.EOT_ERROR, "Can not find file %s " % FvFile)\r
-                EotGlobalData.gFV_FILE.append(FvFile)\r
-        else:\r
-            EdkLogger.error("Eot", EdkLogger.EOT_ERROR, "The fv file list of target platform was not specified")\r
-\r
+            self.FvFileList = Options.FvFileList\r
\r
         if Options.MapFileList:\r
-            for MapFile in GetSplitValueList(Options.MapFileList, ' '):\r
-                MapFile = os.path.normpath(MapFile)\r
-                if not os.path.isfile(MapFile):\r
-                    EdkLogger.error("Eot", EdkLogger.EOT_ERROR, "Can not find file %s " % MapFile)\r
-                EotGlobalData.gMAP_FILE.append(MapFile)\r
+            self.MapFileList = Options.FvMapFileList\r
 \r
         if Options.SourceFileList:\r
             self.SourceFileList = Options.SourceFileList\r