# Version and Copyright\r
__version_number__ = ("0.10" + " " + gBUILD_VERSION)\r
__version__ = "%prog Version " + __version_number__\r
-__copyright__ = "Copyright (c) 2007-2017, Intel Corporation. All rights reserved."\r
+__copyright__ = "Copyright (c) 2007-2018, Intel Corporation. All rights reserved."\r
\r
## Regular expression for matching Line Control directive like "#line xxx"\r
gLineControlDirective = re.compile('^\s*#(?:line)?\s+([0-9]+)\s+"*([^"]*)"')\r
#\r
def TrimPreprocessedVfr(Source, Target):\r
CreateDirectory(os.path.dirname(Target))\r
- \r
+\r
try:\r
f = open (Source, 'r')\r
except:\r
SearchPathList = [LocalSearchPath] + IncludePathList\r
else:\r
SearchPathList = IncludePathList\r
- \r
+\r
for IncludePath in SearchPathList:\r
IncludeFile = os.path.join(IncludePath, Source)\r
if os.path.isfile(IncludeFile):\r
except:\r
EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Source)\r
\r
- \r
+\r
# avoid A "include" B and B "include" A\r
IncludeFile = os.path.abspath(os.path.normpath(IncludeFile))\r
if IncludeFile in gIncludedAslFile:\r
ExtraData= "%s -> %s" % (" -> ".join(gIncludedAslFile), IncludeFile))\r
return []\r
gIncludedAslFile.append(IncludeFile)\r
- \r
+\r
for Line in F:\r
LocalSearchPath = None\r
Result = gAslIncludePattern.findall(Line)\r
NewFileContent.append("%s%s" % (Indent, Line))\r
continue\r
#\r
- # We should first search the local directory if current file are using pattern #include "XXX" \r
+ # We should first search the local directory if current file are using pattern #include "XXX"\r
#\r
if Result[0][2] == '"':\r
LocalSearchPath = os.path.dirname(IncludeFile)\r
#\r
# @param Source File to be trimmed\r
# @param Target File to store the trimmed content\r
-# @param IncludePathFile The file to log the external include path \r
+# @param IncludePathFile The file to log the external include path\r
#\r
def TrimAslFile(Source, Target, IncludePathFile):\r
CreateDirectory(os.path.dirname(Target))\r
- \r
+\r
SourceDir = os.path.dirname(Source)\r
if SourceDir == '':\r
SourceDir = '.'\r
- \r
+\r
#\r
# Add source directory as the first search directory\r
#\r
IncludePathList = [SourceDir]\r
- \r
+\r
#\r
# If additional include path file is specified, append them all\r
# to the search directory list.\r
EdkLogger.SetLevel(CommandOptions.LogLevel)\r
except FatalError as X:\r
return 1\r
- \r
+\r
try:\r
if CommandOptions.FileType == "Vfr":\r
if CommandOptions.OutputFile is None:\r