## @file\r
# process VTF generation\r
#\r
-# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
##\r
# Import Modules\r
#\r
-from GenFdsGlobalVariable import GenFdsGlobalVariable\r
+from __future__ import absolute_import\r
+from .GenFdsGlobalVariable import GenFdsGlobalVariable\r
import Common.LongFilePathOs as os\r
from CommonDataClass.FdfClass import VtfClassObject\r
from Common.LongFilePathSupport import OpenLongFilePath as open\r
#\r
#\r
class Vtf (VtfClassObject):\r
- \r
+\r
## The constructor\r
#\r
# @param self The object pointer\r
OutputFile = os.path.join(GenFdsGlobalVariable.FvDir, self.UiName + '.Vtf')\r
BaseAddArg = self.GetBaseAddressArg(FdAddressDict)\r
OutputArg, VtfRawDict = self.GenOutputArg()\r
- \r
+\r
Cmd = (\r
'GenVtf',\r
) + OutputArg + (\r
\r
GenFdsGlobalVariable.CallExternalTool(Cmd, "GenFv -Vtf Failed!")\r
GenFdsGlobalVariable.SharpCounter = 0\r
- \r
+\r
return VtfRawDict\r
- \r
+\r
## GenBsfInf() method\r
#\r
# Generate inf used to generate VTF\r
FvList = self.GetFvList()\r
self.BsfInfName = os.path.join(GenFdsGlobalVariable.FvDir, self.UiName + '.inf')\r
BsfInf = open(self.BsfInfName, 'w+')\r
- if self.ResetBin != None:\r
+ if self.ResetBin is not None:\r
BsfInf.writelines ("[OPTIONS]" + T_CHAR_LF)\r
BsfInf.writelines ("IA32_RST_BIN" + \\r
" = " + \\r
'N' + \\r
T_CHAR_LF)\r
\r
- elif ComponentObj.FilePos != None:\r
+ elif ComponentObj.FilePos is not None:\r
BsfInf.writelines ("COMP_LOC" + \\r
" = " + \\r
ComponentObj.FilePos + \\r
for component in self.ComponentStatementList :\r
if component.CompLoc.upper() != 'NONE' and not (component.CompLoc.upper() in FvList):\r
FvList.append(component.CompLoc.upper())\r
- \r
+\r
return FvList\r
\r
## GetBaseAddressArg() method\r
'-s', '0x%x' % Size,\r
)\r
return CmdStr\r
- \r
+\r
## GenOutputArg() method\r
#\r
# Get output arguments for GenVtf\r
#\r
# @param self The object pointer\r
- # \r
+ #\r
def GenOutputArg(self):\r
FvVtfDict = {}\r
OutputFileName = ''\r
OutputFileName = os.path.join(GenFdsGlobalVariable.FvDir, OutputFileName)\r
Arg += ('-o', OutputFileName)\r
FvVtfDict[FvObj.upper()] = OutputFileName\r
- \r
+\r
return Arg, FvVtfDict\r
- \r
+\r