## @file\r
# This file is used to define each component of INF file\r
#\r
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\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
##\r
# Import Modules\r
#\r
-import os\r
+import Common.LongFilePathOs as os\r
import re\r
import EdkLogger\r
from CommonDataClass.CommonClass import LibraryClassClass\r
from Table.TableInf import TableInf\r
import Database\r
from Parsing import *\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
\r
#\r
# Global variable\r
# @var KeyList: To store value for KeyList, a list for all Keys used in Inf\r
#\r
class Inf(InfObject):\r
- def __init__(self, Filename = None, IsToDatabase = False, IsToModule = False, WorkspaceDir = None, Database = None, SupArchList = DataType.ARCH_LIST):\r
+ def __init__(self, Filename=None, IsToDatabase=False, IsToModule=False, WorkspaceDir=None, Database=None, SupArchList=DataType.ARCH_LIST):\r
self.Identification = Identification()\r
self.Module = ModuleClass()\r
self.UserExtensions = ''\r
# Remove comment block\r
#\r
if Line.find(TAB_COMMENT_EDK_START) > -1:\r
- ReservedLine = GetSplitValueList(Line, TAB_COMMENT_EDK_START, 1)[0]\r
+ ReservedLine = GetSplitList(Line, TAB_COMMENT_EDK_START, 1)[0]\r
IsFindBlockComment = True\r
if Line.find(TAB_COMMENT_EDK_END) > -1:\r
- Line = ReservedLine + GetSplitValueList(Line, TAB_COMMENT_EDK_END, 1)[1]\r
+ Line = ReservedLine + GetSplitList(Line, TAB_COMMENT_EDK_END, 1)[1]\r
ReservedLine = ''\r
IsFindBlockComment = False\r
if IsFindBlockComment:\r
CurrentSection = ItemList[0]\r
else:\r
if CurrentSection != ItemList[0]:\r
- EdkLogger.error("Parser", PARSER_ERROR, "Different section names '%s' and '%s' are found in one section definition, this is not allowed." % (CurrentSection, ItemList[0]), File=Filename, Line=LineNo, RaiseError = EdkLogger.IsRaiseError)\r
+ EdkLogger.error("Parser", PARSER_ERROR, "Different section names '%s' and '%s' are found in one section definition, this is not allowed." % (CurrentSection, ItemList[0]), File=Filename, Line=LineNo, RaiseError=EdkLogger.IsRaiseError)\r
if CurrentSection.upper() not in self.KeyList:\r
RaiseParserError(Line, CurrentSection, Filename, '', LineNo)\r
CurrentSection = TAB_UNKNOWN\r
RaiseParserError(Line, CurrentSection, Filename, '', LineNo)\r
else:\r
if ItemList[1] != '' and ItemList[1].upper() not in ARCH_LIST_FULL:\r
- EdkLogger.error("Parser", PARSER_ERROR, "Invalid Arch definition '%s' found" % ItemList[1], File=Filename, Line=LineNo, RaiseError = EdkLogger.IsRaiseError)\r
+ EdkLogger.error("Parser", PARSER_ERROR, "Invalid Arch definition '%s' found" % ItemList[1], File=Filename, Line=LineNo, RaiseError=EdkLogger.IsRaiseError)\r
ArchList.append(ItemList[1].upper())\r
ThirdList.append(ItemList[2])\r
\r
#\r
if CurrentSection == TAB_UNKNOWN:\r
ErrorMsg = "%s is not in any defined section" % Line\r
- EdkLogger.error("Parser", PARSER_ERROR, ErrorMsg, File=Filename, Line=LineNo, RaiseError = EdkLogger.IsRaiseError)\r
+ EdkLogger.error("Parser", PARSER_ERROR, ErrorMsg, File=Filename, Line=LineNo, RaiseError=EdkLogger.IsRaiseError)\r
\r
#\r
# Add a section item\r
print Item.Name, Item.Value, Item.SupArchList\r
print '\nPcds =', M.PcdCodes\r
for Item in M.PcdCodes:\r
- print '\tCName=',Item.CName, 'TokenSpaceGuidCName=', Item.TokenSpaceGuidCName, 'DefaultValue=', Item.DefaultValue, 'ItemType=', Item.ItemType, Item.SupArchList\r
+ print '\tCName=', Item.CName, 'TokenSpaceGuidCName=', Item.TokenSpaceGuidCName, 'DefaultValue=', Item.DefaultValue, 'ItemType=', Item.ItemType, Item.SupArchList\r
print '\nSources =', M.Sources\r
for Source in M.Sources:\r
print Source.SourceFile, 'Fam=', Source.ToolChainFamily, 'Pcd=', Source.FeatureFlag, 'Tag=', Source.TagName, 'ToolCode=', Source.ToolCode, Source.SupArchList\r
print '\nUserExtensions =', M.UserExtensions\r
for UserExtension in M.UserExtensions:\r
- print UserExtension.UserID, UserExtension.Identifier,UserExtension.Content\r
+ print UserExtension.UserID, UserExtension.Identifier, UserExtension.Content\r
print '\nGuids =', M.Guids\r
for Item in M.Guids:\r
print Item.CName, Item.SupArchList, Item.FeatureFlag\r
if ModuleHeader.ComponentType in gComponentType2ModuleType:\r
ModuleHeader.ModuleType = gComponentType2ModuleType[ModuleHeader.ComponentType]\r
elif ModuleHeader.ComponentType != '':\r
- EdkLogger.error("Parser", PARSER_ERROR, "Unsupported Edk component type [%s]" % ModuleHeader.ComponentType, ExtraData=File, RaiseError = EdkLogger.IsRaiseError)\r
+ EdkLogger.error("Parser", PARSER_ERROR, "Unsupported Edk component type [%s]" % ModuleHeader.ComponentType, ExtraData=File, RaiseError=EdkLogger.IsRaiseError)\r
\r
self.Module.Header[Arch] = ModuleHeader\r
\r