]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Eot/CodeFragmentCollector.py
BaseTools: Refactor python print statements
[mirror_edk2.git] / BaseTools / Source / Python / Eot / CodeFragmentCollector.py
index 87f179206d846b575b836a05876cfe837ed6052d..1e30e2ce62e284c21f12e48474ea20d09e2a2314 100644 (file)
@@ -15,6 +15,7 @@
 ##\r
 # Import Modules\r
 #\r
+from __future__ import print_function\r
 import re\r
 import Common.LongFilePathOs as os\r
 import sys\r
@@ -379,49 +380,49 @@ class CodeFragmentCollector:
     #\r
     def PrintFragments(self):\r
 \r
-        print '################# ' + self.FileName + '#####################'\r
+        print('################# ' + self.FileName + '#####################')\r
 \r
-        print '/****************************************/'\r
-        print '/*************** ASSIGNMENTS ***************/'\r
-        print '/****************************************/'\r
+        print('/****************************************/')\r
+        print('/*************** ASSIGNMENTS ***************/')\r
+        print('/****************************************/')\r
         for asign in FileProfile.AssignmentExpressionList:\r
-            print str(asign.StartPos) + asign.Name + asign.Operator + asign.Value\r
+            print(str(asign.StartPos) + asign.Name + asign.Operator + asign.Value)\r
 \r
-        print '/****************************************/'\r
-        print '/********* PREPROCESS DIRECTIVES ********/'\r
-        print '/****************************************/'\r
+        print('/****************************************/')\r
+        print('/********* PREPROCESS DIRECTIVES ********/')\r
+        print('/****************************************/')\r
         for pp in FileProfile.PPDirectiveList:\r
-            print str(pp.StartPos) + pp.Content\r
+            print(str(pp.StartPos) + pp.Content)\r
 \r
-        print '/****************************************/'\r
-        print '/********* VARIABLE DECLARATIONS ********/'\r
-        print '/****************************************/'\r
+        print('/****************************************/')\r
+        print('/********* VARIABLE DECLARATIONS ********/')\r
+        print('/****************************************/')\r
         for var in FileProfile.VariableDeclarationList:\r
-            print str(var.StartPos) + var.Modifier + ' '+ var.Declarator\r
+            print(str(var.StartPos) + var.Modifier + ' '+ var.Declarator)\r
 \r
-        print '/****************************************/'\r
-        print '/********* FUNCTION DEFINITIONS *********/'\r
-        print '/****************************************/'\r
+        print('/****************************************/')\r
+        print('/********* FUNCTION DEFINITIONS *********/')\r
+        print('/****************************************/')\r
         for func in FileProfile.FunctionDefinitionList:\r
-            print str(func.StartPos) + func.Modifier + ' '+ func.Declarator + ' ' + str(func.NamePos)\r
+            print(str(func.StartPos) + func.Modifier + ' '+ func.Declarator + ' ' + str(func.NamePos))\r
 \r
-        print '/****************************************/'\r
-        print '/************ ENUMERATIONS **************/'\r
-        print '/****************************************/'\r
+        print('/****************************************/')\r
+        print('/************ ENUMERATIONS **************/')\r
+        print('/****************************************/')\r
         for enum in FileProfile.EnumerationDefinitionList:\r
-            print str(enum.StartPos) + enum.Content\r
+            print(str(enum.StartPos) + enum.Content)\r
 \r
-        print '/****************************************/'\r
-        print '/*********** STRUCTS/UNIONS *************/'\r
-        print '/****************************************/'\r
+        print('/****************************************/')\r
+        print('/*********** STRUCTS/UNIONS *************/')\r
+        print('/****************************************/')\r
         for su in FileProfile.StructUnionDefinitionList:\r
-            print str(su.StartPos) + su.Content\r
+            print(str(su.StartPos) + su.Content)\r
 \r
-        print '/****************************************/'\r
-        print '/************** TYPEDEFS ****************/'\r
-        print '/****************************************/'\r
+        print('/****************************************/')\r
+        print('/************** TYPEDEFS ****************/')\r
+        print('/****************************************/')\r
         for typedef in FileProfile.TypedefDefinitionList:\r
-            print str(typedef.StartPos) + typedef.ToType\r
+            print(str(typedef.StartPos) + typedef.ToType)\r
 \r
 ##\r
 #\r
@@ -430,4 +431,4 @@ class CodeFragmentCollector:
 #\r
 if __name__ == "__main__":\r
 \r
-    print "For Test."\r
+    print("For Test.")\r