BaseTools/Scripts: Porting PackageDocumentTools code to use Python3
Porting PackageDocumentTools code to support python2 and python3 Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
This commit is contained in:
@ -67,7 +67,7 @@ class Page(BaseDoxygeItem):
|
||||
|
||||
def AddSection(self, section):
|
||||
self.mSections.append(section)
|
||||
self.mSections.sort(cmp=lambda x, y: cmp(x.mName.lower(), y.mName.lower()))
|
||||
self.mSections.sort(key=lambda x: x.mName.lower())
|
||||
|
||||
def Generate(self):
|
||||
if self.mIsMainPage:
|
||||
@ -80,7 +80,7 @@ class Page(BaseDoxygeItem):
|
||||
self.mText.append(self.mDescription)
|
||||
endIndex = len(self.mText)
|
||||
|
||||
self.mSections.sort()
|
||||
self.mSections.sort(key=lambda x: x.mName.lower())
|
||||
for sect in self.mSections:
|
||||
self.mText += sect.Generate()
|
||||
|
||||
|
Reference in New Issue
Block a user