BaseTools/Scripts: Porting PackageDocumentTools code to use Python3
Porting PackageDocumentTools code to Python3 DoxyGen 1.8.6 wxpython 4.0.3 Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
committed by
Yonghong Zhu
parent
c9486c8c9d
commit
9d7e1e56a7
@ -11,8 +11,6 @@
|
||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#
|
||||
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import
|
||||
import os
|
||||
|
||||
from .message import *
|
||||
@ -67,7 +65,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 +78,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()
|
||||
|
||||
@ -92,7 +90,7 @@ class Page(BaseDoxygeItem):
|
||||
self.mText.insert(endIndex, '<ul>')
|
||||
endIndex += 1
|
||||
if self.mIsSort:
|
||||
self.mSubPages.sort(cmp=lambda x, y: cmp(x.mName.lower(), y.mName.lower()))
|
||||
self.mSubPages.sort(key=lambda x: x.mName.lower())
|
||||
for page in self.mSubPages:
|
||||
self.mText.insert(endIndex, '<li>\subpage %s \"%s\" </li>' % (page.mTag, page.mName))
|
||||
endIndex += 1
|
||||
|
@ -11,7 +11,6 @@
|
||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#
|
||||
|
||||
from __future__ import print_function
|
||||
import array
|
||||
import uuid
|
||||
import re
|
||||
|
@ -11,7 +11,6 @@
|
||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#
|
||||
|
||||
from __future__ import absolute_import
|
||||
from .message import *
|
||||
import re
|
||||
import os
|
||||
@ -25,7 +24,7 @@ class BaseINIFile(object):
|
||||
@return: instance of this class
|
||||
|
||||
"""
|
||||
if len(args) == 0: return object.__new__(cls, *args, **kwargs)
|
||||
if len(args) == 0: return object.__new__(cls)
|
||||
filename = args[0]
|
||||
parent = None
|
||||
if len(args) > 1:
|
||||
@ -33,7 +32,7 @@ class BaseINIFile(object):
|
||||
|
||||
key = os.path.normpath(filename)
|
||||
if key not in cls._objs.keys():
|
||||
cls._objs[key] = object.__new__(cls, *args, **kwargs)
|
||||
cls._objs[key] = object.__new__(cls)
|
||||
|
||||
if parent is not None:
|
||||
cls._objs[key].AddParent(parent)
|
||||
|
Reference in New Issue
Block a user