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:
Yunhua Feng
2018-08-28 17:00:24 +08:00
committed by Yonghong Zhu
parent c9486c8c9d
commit 9d7e1e56a7
12 changed files with 62 additions and 67 deletions

View File

@ -16,7 +16,7 @@
"""This file produce action class to generate doxygen document for edk2 codebase.
The action classes are shared by GUI and command line tools.
"""
import plugins.EdkPlugins.basemodel.doxygen as doxygen
from ...basemodel import doxygen
import os
try:
import wx
@ -24,9 +24,9 @@ try:
except:
gInGui = False
import re
import plugins.EdkPlugins.edk2.model.inf as inf
import plugins.EdkPlugins.edk2.model.dec as dec
from plugins.EdkPlugins.basemodel.message import *
from ..model import inf
from ..model import dec
from ...basemodel.message import *
_ignore_dir = ['.svn', '_svn', 'cvs']
_inf_key_description_mapping_table = {
@ -386,7 +386,7 @@ class PackageDocumentAction(DoxygenAction):
configFile.AddFile(path)
no = 0
for no in xrange(len(lines)):
for no in range(len(lines)):
if len(lines[no].strip()) == 0:
continue
if lines[no].strip()[:2] in ['##', '//', '/*', '*/']:
@ -1000,7 +1000,7 @@ class PackageDocumentAction(DoxygenAction):
#file = textfile.TextFile(path)
try:
file = open(path, 'rb')
file = open(path, 'r')
except (IOError, OSError) as msg:
return None