]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenFds/VerSection.py
BaseTools: Remove equality operator with None
[mirror_edk2.git] / BaseTools / Source / Python / GenFds / VerSection.py
index e27d0a20f97f32bc9dd0a9ebb65f7cf413a9990d..11e974b9936e8435005d18841ba51cee480709e8 100644 (file)
@@ -1,9 +1,9 @@
 ## @file\r
 # process Version section generation\r
 #\r
-#  Copyright (c) 2007, Intel Corporation\r
+#  Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
 #\r
-#  All rights reserved. This program and the accompanying materials\r
+#  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
 #  http://opensource.org/licenses/bsd-license.php\r
 #\r
 from Ffs import Ffs\r
 import Section\r
-import os\r
+import Common.LongFilePathOs as os\r
 import subprocess\r
 from GenFdsGlobalVariable import GenFdsGlobalVariable\r
 from CommonDataClass.FdfClass import VerSectionClassObject\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 ## generate version section\r
 #\r
@@ -47,11 +48,11 @@ class VerSection (VerSectionClassObject):
     #   @param  Dict        dictionary contains macro and its value\r
     #   @retval tuple       (Generated file name, section alignment)\r
     #\r
-    def GenSection(self,OutputPath, ModuleName, SecNum, KeyStringList, FfsInf = None, Dict = {}):\r
+    def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, FfsInf=None, Dict={}, IsMakefile = False):\r
         #\r
         # Prepare the parameter of GenSection\r
         #\r
-        if FfsInf != None:\r
+        if FfsInf is not None:\r
             self.Alignment = FfsInf.__ExtendMacro__(self.Alignment)\r
             self.BuildNum = FfsInf.__ExtendMacro__(self.BuildNum)\r
             self.StringData = FfsInf.__ExtendMacro__(self.StringData)\r
@@ -63,9 +64,9 @@ class VerSection (VerSectionClassObject):
 \r
         # Get String Data\r
         StringData = ''\r
-        if self.StringData != None:\r
-             StringData = self.StringData\r
-        elif self.FileName != None:\r
+        if self.StringData is not None:\r
+            StringData = self.StringData\r
+        elif self.FileName is not None:\r
             FileNameStr = GenFdsGlobalVariable.ReplaceWorkspaceMacro(self.FileName)\r
             FileNameStr = GenFdsGlobalVariable.MacroExtend(FileNameStr, Dict)\r
             FileObj = open(FileNameStr, 'r')\r
@@ -74,9 +75,8 @@ class VerSection (VerSectionClassObject):
             FileObj.close()\r
         else:\r
             StringData = ''\r
-\r
-        GenFdsGlobalVariable.GenerateSection(OutputFile, None, 'EFI_SECTION_VERSION',\r
-                                             Ui=StringData, Ver=self.BuildNum)\r
+        GenFdsGlobalVariable.GenerateSection(OutputFile, [], 'EFI_SECTION_VERSION',\r
+                                             Ver=StringData, BuildNumber=self.BuildNum, IsMakefile=IsMakefile)\r
         OutputFileList = []\r
         OutputFileList.append(OutputFile)\r
         return OutputFileList, self.Alignment\r