]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenFds/UiSection.py
BaseTools: Replace StandardError with Expression
[mirror_edk2.git] / BaseTools / Source / Python / GenFds / UiSection.py
index e660055f9a30f3dba5df18cbe83d6c8017ec253f..280500952b63efdb09a6b37833c03a2042f49114 100644 (file)
@@ -1,9 +1,9 @@
 ## @file\r
 # process UI 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
 import Section\r
 from Ffs import Ffs\r
 import subprocess\r
-import os\r
+import Common.LongFilePathOs as os\r
 from GenFdsGlobalVariable import GenFdsGlobalVariable\r
 from CommonDataClass.FdfClass import UiSectionClassObject\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
+from Common.DataType import *\r
 \r
 ## generate UI section\r
 #\r
@@ -47,30 +49,28 @@ class UiSection (UiSectionClassObject):
     #   @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.StringData = FfsInf.__ExtendMacro__(self.StringData)\r
             self.FileName = FfsInf.__ExtendMacro__(self.FileName)\r
 \r
-        OutputFile = os.path.join(OutputPath, ModuleName + 'SEC' + SecNum + Ffs.SectionSuffix.get('UI'))\r
+        OutputFile = os.path.join(OutputPath, ModuleName + SUP_MODULE_SEC + SecNum + Ffs.SectionSuffix.get(BINARY_FILE_TYPE_UI))\r
 \r
-        if self.StringData != None :\r
+        if self.StringData is not None :\r
             NameString = self.StringData\r
-        elif self.FileName != None:\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
             NameString = FileObj.read()\r
-            NameString = '\"' + NameString + "\""\r
             FileObj.close()\r
         else:\r
             NameString = ''\r
-\r
-        GenFdsGlobalVariable.GenerateSection(OutputFile, None, 'EFI_SECTION_USER_INTERFACE', Ui=NameString)\r
+        GenFdsGlobalVariable.GenerateSection(OutputFile, None, 'EFI_SECTION_USER_INTERFACE', Ui=NameString, IsMakefile=IsMakefile)\r
 \r
         OutputFileList = []\r
         OutputFileList.append(OutputFile)\r