]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py
Revert BaseTools: PYTHON3 migration
[mirror_edk2.git] / BaseTools / Source / Python / UPT / GenMetaFile / GenInfFile.py
index 82df4c62cfaa5b27c42fefd4c25adac54dc75bd1..c2a240a88410c965715c9b6a4958abab315f432d 100644 (file)
@@ -234,22 +234,22 @@ def GenModuleUNIEncodeFile(ModuleObject, UniFileHeader='', Encoding=DT.TAB_ENCOD
     if not os.path.exists(os.path.dirname(ModuleObject.GetFullPath())):\r
         os.makedirs(os.path.dirname(ModuleObject.GetFullPath()))\r
 \r
-    Content = UniFileHeader + '\n'\r
-    Content += '\n'\r
+    Content = UniFileHeader + '\r\n'\r
+    Content += '\r\n'\r
 \r
-    Content += FormatUniEntry('#string ' + DT.TAB_INF_ABSTRACT, ModuleObject.GetAbstract(), ContainerFile) + '\n'\r
+    Content += FormatUniEntry('#string ' + DT.TAB_INF_ABSTRACT, ModuleObject.GetAbstract(), ContainerFile) + '\r\n'\r
 \r
     Content += FormatUniEntry('#string ' + DT.TAB_INF_DESCRIPTION, ModuleObject.GetDescription(), ContainerFile) \\r
-            + '\n'\r
+            + '\r\n'\r
 \r
     BinaryAbstractString = FormatUniEntry('#string ' + DT.TAB_INF_BINARY_ABSTRACT, BinaryAbstract, ContainerFile)\r
     if BinaryAbstractString:\r
-        Content += BinaryAbstractString + '\n'\r
+        Content += BinaryAbstractString + '\r\n'\r
 \r
     BinaryDescriptionString = FormatUniEntry('#string ' + DT.TAB_INF_BINARY_DESCRIPTION, BinaryDescription, \\r
                                              ContainerFile)\r
     if BinaryDescriptionString:\r
-        Content += BinaryDescriptionString + '\n'\r
+        Content += BinaryDescriptionString + '\r\n'\r
 \r
     if not os.path.exists(ContainerFile):\r
         File = codecs.open(ContainerFile, 'wb', Encoding)\r
@@ -274,7 +274,7 @@ def GenDefines(ModuleObject):
         if not DefinesDict:\r
             continue\r
         for Statement in DefinesDict:\r
-            if len(Statement.split(DT.TAB_EQUAL_SPLIT)) > 1:\r
+            if Statement.split(DT.TAB_EQUAL_SPLIT) > 1:\r
                 Statement = (u'%s ' % Statement.split(DT.TAB_EQUAL_SPLIT, 1)[0]).ljust(LeftOffset) \\r
                              + u'= %s' % Statement.split(DT.TAB_EQUAL_SPLIT, 1)[1].lstrip()\r
             SortedArch = DT.TAB_ARCH_COMMON\r
@@ -409,7 +409,7 @@ def GenLibraryClasses(ModuleObject):
                 Statement += '|' + FFE\r
             ModuleList = LibraryClass.GetSupModuleList()\r
             ArchList = LibraryClass.GetSupArchList()\r
-            for Index in range(0, len(ArchList)):\r
+            for Index in xrange(0, len(ArchList)):\r
                 ArchList[Index] = ConvertArchForInstall(ArchList[Index])\r
             ArchList.sort()\r
             SortedArch = ' '.join(ArchList)\r
@@ -572,7 +572,7 @@ def GenUserExtensions(ModuleObject):
 #         if not Statement:\r
 #             continue\r
         ArchList = UserExtension.GetSupArchList()\r
-        for Index in range(0, len(ArchList)):\r
+        for Index in xrange(0, len(ArchList)):\r
             ArchList[Index] = ConvertArchForInstall(ArchList[Index])\r
         ArchList.sort()\r
         KeyList = []\r