]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Trim/Trim.py
BaseTools: Clean up source files
[mirror_edk2.git] / BaseTools / Source / Python / Trim / Trim.py
index b46d507b4e55e503712ecf0a205cb3d940f206b4..4b3091bec3df2372d4b6f3a46e4529f01e964784 100644 (file)
@@ -31,7 +31,7 @@ from Common.LongFilePathSupport import OpenLongFilePath as open
 # 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
@@ -261,7 +261,7 @@ def TrimPreprocessedFile(Source, Target, ConvertHex, TrimLong):
 #\r
 def TrimPreprocessedVfr(Source, Target):\r
     CreateDirectory(os.path.dirname(Target))\r
-    \r
+\r
     try:\r
         f = open (Source, 'r')\r
     except:\r
@@ -338,7 +338,7 @@ def DoInclude(Source, Indent='', IncludePathList=[], LocalSearchPath=None):
             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
@@ -349,7 +349,7 @@ def DoInclude(Source, Indent='', IncludePathList=[], LocalSearchPath=None):
     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
@@ -357,7 +357,7 @@ def DoInclude(Source, Indent='', IncludePathList=[], LocalSearchPath=None):
                        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
@@ -367,7 +367,7 @@ def DoInclude(Source, Indent='', IncludePathList=[], LocalSearchPath=None):
                 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
@@ -388,20 +388,20 @@ def DoInclude(Source, Indent='', IncludePathList=[], LocalSearchPath=None):
 #\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
@@ -672,7 +672,7 @@ def Main():
             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