]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenFds/CompressSection.py
BaseTools: Use absolute import in GenFds
[mirror_edk2.git] / BaseTools / Source / Python / GenFds / CompressSection.py
index 56e71a35453b92edf1b77d62dc0e1e28d7a15904..aaaabf84dca8268dea68246aefcc2e1a3692b8d0 100644 (file)
 ##\r
 # Import Modules\r
 #\r
-from Ffs import Ffs\r
-import Section\r
+from __future__ import absolute_import\r
+from .Ffs import Ffs\r
+from . import Section\r
 import subprocess\r
 import Common.LongFilePathOs as os\r
-from GenFdsGlobalVariable import GenFdsGlobalVariable\r
+from .GenFdsGlobalVariable import GenFdsGlobalVariable\r
 from CommonDataClass.FdfClass import CompressSectionClassObject\r
+from Common.DataType import *\r
 \r
 ## generate compress section\r
 #\r
@@ -55,7 +57,7 @@ class CompressSection (CompressSectionClassObject) :
     #\r
     def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, FfsInf = None, Dict = {}, IsMakefile = False):\r
 \r
-        if FfsInf != None:\r
+        if FfsInf is not None:\r
             self.CompType = FfsInf.__ExtendMacro__(self.CompType)\r
             self.Alignment = FfsInf.__ExtendMacro__(self.Alignment)\r
 \r
@@ -67,13 +69,13 @@ class CompressSection (CompressSectionClassObject) :
             Index = Index + 1\r
             SecIndex = '%s.%d' %(SecNum, Index)\r
             ReturnSectList, AlignValue = Sect.GenSection(OutputPath, ModuleName, SecIndex, KeyStringList, FfsInf, Dict, IsMakefile=IsMakefile)\r
-            if AlignValue != None:\r
-                if MaxAlign == None:\r
+            if AlignValue is not None:\r
+                if MaxAlign is None:\r
                     MaxAlign = AlignValue\r
                 if GenFdsGlobalVariable.GetAlignment (AlignValue) > GenFdsGlobalVariable.GetAlignment (MaxAlign):\r
                     MaxAlign = AlignValue\r
             if ReturnSectList != []:\r
-                if AlignValue == None:\r
+                if AlignValue is None:\r
                     AlignValue = "1"\r
                 for FileData in ReturnSectList:\r
                     SectFiles += (FileData,)\r
@@ -82,7 +84,7 @@ class CompressSection (CompressSectionClassObject) :
         OutputFile = OutputPath + \\r
                      os.sep     + \\r
                      ModuleName + \\r
-                     'SEC'      + \\r
+                     SUP_MODULE_SEC      + \\r
                      SecNum     + \\r
                      Ffs.SectionSuffix['COMPRESS']\r
         OutputFile = os.path.normpath(OutputFile)\r