# Import Modules\r
#\r
from struct import *\r
-import Section\r
-from GenFdsGlobalVariable import GenFdsGlobalVariable\r
+from . import Section\r
+from .GenFdsGlobalVariable import GenFdsGlobalVariable\r
import subprocess\r
-from Ffs import Ffs\r
+from .Ffs import Ffs\r
import Common.LongFilePathOs as os\r
from CommonDataClass.FdfClass import EfiSectionClassObject\r
from Common import EdkLogger\r
# @retval tuple (Generated file name list, section alignment)\r
#\r
def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, FfsInf = None, Dict = {}, IsMakefile = False) :\r
- \r
+\r
if self.FileName is not None and self.FileName.startswith('PCD('):\r
self.FileName = GenFdsGlobalVariable.GetPcdValue(self.FileName)\r
"""Prepare the parameter of GenSection"""\r
elif FileList != []:\r
for File in FileList:\r
Index = Index + 1\r
- Num = '%s.%d' %(SecNum , Index)\r
+ Num = '%s.%d' %(SecNum, Index)\r
OutputFile = os.path.join(OutputPath, ModuleName + SUP_MODULE_SEC + Num + Ffs.SectionSuffix.get(SectionType))\r
f = open(File, 'r')\r
VerString = f.read()\r
BuildNumTuple = tuple()\r
BuildNumString = ' ' + ' '.join(BuildNumTuple)\r
\r
- #if VerString == '' and \r
+ #if VerString == '' and\r
if BuildNumString == '':\r
if self.Optional == True :\r
GenFdsGlobalVariable.VerboseLogger( "Optional Section don't exist!")\r
elif FileList != []:\r
for File in FileList:\r
Index = Index + 1\r
- Num = '%s.%d' %(SecNum , Index)\r
+ Num = '%s.%d' %(SecNum, Index)\r
OutputFile = os.path.join(OutputPath, ModuleName + SUP_MODULE_SEC + Num + Ffs.SectionSuffix.get(SectionType))\r
f = open(File, 'r')\r
UiString = f.read()\r
for File in FileList:\r
""" Copy Map file to FFS output path """\r
Index = Index + 1\r
- Num = '%s.%d' %(SecNum , Index)\r
+ Num = '%s.%d' %(SecNum, Index)\r
OutputFile = os.path.join( OutputPath, ModuleName + SUP_MODULE_SEC + Num + Ffs.SectionSuffix.get(SectionType))\r
File = GenFdsGlobalVariable.MacroExtend(File, Dict)\r
- \r
+\r
#Get PE Section alignment when align is set to AUTO\r
if self.Alignment == 'Auto' and (SectionType == BINARY_FILE_TYPE_PE32 or SectionType == BINARY_FILE_TYPE_TE):\r
ImageObj = PeImageClass (File)\r
if ImageObj.SectionAlignment < 0x400:\r
Align = str (ImageObj.SectionAlignment)\r
elif ImageObj.SectionAlignment < 0x100000:\r
- Align = str (ImageObj.SectionAlignment / 0x400) + 'K'\r
+ Align = str (ImageObj.SectionAlignment // 0x400) + 'K'\r
else:\r
- Align = str (ImageObj.SectionAlignment / 0x100000) + 'M'\r
+ Align = str (ImageObj.SectionAlignment // 0x100000) + 'M'\r
\r
if File[(len(File)-4):] == '.efi':\r
MapFile = File.replace('.efi', '.map')\r
IsMakefile = IsMakefile\r
)\r
File = StrippedFile\r
- \r
+\r
"""For TE Section call GenFw to generate TE image"""\r
\r
if SectionType == BINARY_FILE_TYPE_TE:\r