]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/doxygen.py
BaseTools/Scripts: Porting PackageDocumentTools code to use Python3
[mirror_edk2.git] / BaseTools / Scripts / PackageDocumentTools / plugins / EdkPlugins / basemodel / doxygen.py
index d1e21135cf052925745df67cf750de0cb6af6d06..4b3303c658497cf82259e825ded7e30575ef6a77 100644 (file)
@@ -11,8 +11,6 @@
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 #\r
 \r
-from __future__ import print_function\r
-from __future__ import absolute_import\r
 import os\r
 \r
 from .message import *\r
@@ -67,7 +65,7 @@ class Page(BaseDoxygeItem):
 \r
     def AddSection(self, section):\r
         self.mSections.append(section)\r
-        self.mSections.sort(cmp=lambda x, y: cmp(x.mName.lower(), y.mName.lower()))\r
+        self.mSections.sort(key=lambda x: x.mName.lower())\r
 \r
     def Generate(self):\r
         if self.mIsMainPage:\r
@@ -80,7 +78,7 @@ class Page(BaseDoxygeItem):
             self.mText.append(self.mDescription)\r
         endIndex = len(self.mText)\r
 \r
-        self.mSections.sort()\r
+        self.mSections.sort(key=lambda x: x.mName.lower())\r
         for sect in self.mSections:\r
             self.mText += sect.Generate()\r
 \r
@@ -92,7 +90,7 @@ class Page(BaseDoxygeItem):
             self.mText.insert(endIndex, '<ul>')\r
             endIndex += 1\r
             if self.mIsSort:\r
-                self.mSubPages.sort(cmp=lambda x, y: cmp(x.mName.lower(), y.mName.lower()))\r
+                self.mSubPages.sort(key=lambda x: x.mName.lower())\r
             for page in self.mSubPages:\r
                 self.mText.insert(endIndex, '<li>\subpage %s \"%s\" </li>' % (page.mTag, page.mName))\r
                 endIndex += 1\r