# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
\r
+from __future__ import print_function\r
import os, sys, logging, traceback, subprocess\r
from optparse import OptionParser\r
\r
default = "C:\\Program Files\\doxygen\\bin\\doxygen.exe"\r
if options.DoxygenPath is None:\r
if os.path.exists(default):\r
- print "Warning: Assume doxygen tool is installed at %s. If not, please specify via -x" % default\r
+ print("Warning: Assume doxygen tool is installed at %s. If not, please specify via -x" % default)\r
options.DoxygenPath = default\r
else:\r
errors.append('- Please specify the path of doxygen tool installation via option -x! or install it in default path %s' % default)\r
if options.PackagePath is not None and os.path.exists(options.PackagePath):\r
dirpath = os.path.dirname(options.PackagePath)\r
default = os.path.join (dirpath, "Document")\r
- print 'Warning: Assume document output at %s. If not, please specify via option -o' % default\r
+ print('Warning: Assume document output at %s. If not, please specify via option -o' % default)\r
options.OutputPath = default\r
if not os.path.exists(default):\r
try:\r
\r
if options.Arch is None:\r
options.Arch = 'ALL'\r
- print "Warning: Assume arch is \"ALL\". If not, specify via -a"\r
+ print("Warning: Assume arch is \"ALL\". If not, specify via -a")\r
\r
if options.DocumentMode is None:\r
options.DocumentMode = "HTML"\r
- print "Warning: Assume document mode is \"HTML\". If not, specify via -m"\r
+ print("Warning: Assume document mode is \"HTML\". If not, specify via -m")\r
\r
if options.IncludeOnly is None:\r
options.IncludeOnly = False\r
- print "Warning: Assume generate package document for all package\'s source including publich interfaces and implementation libraries and modules."\r
+ print("Warning: Assume generate package document for all package\'s source including publich interfaces and implementation libraries and modules.")\r
\r
if options.DocumentMode.lower() == 'chm':\r
default = "C:\\Program Files\\HTML Help Workshop\\hhc.exe"\r
if options.HtmlWorkshopPath is None:\r
if os.path.exists(default):\r
- print 'Warning: Assume the installation path of Microsoft HTML Workshop is %s. If not, specify via option -c.' % default\r
+ print('Warning: Assume the installation path of Microsoft HTML Workshop is %s. If not, specify via option -c.' % default)\r
options.HtmlWorkshopPath = default\r
else:\r
errors.append('- Please specify the installation path of Microsoft HTML Workshop via option -c!')\r
errors.append('- The installation path of Microsoft HTML Workshop %s does not exists. ' % options.HtmlWorkshopPath)\r
\r
if len(errors) != 0:\r
- print '\n'\r
+ print('\n')\r
parser.error('Fail to start due to following reasons: \n%s' %'\n'.join(errors))\r
return (options.WorkspacePath, options.PackagePath, options.DoxygenPath, options.OutputPath,\r
options.Arch, options.DocumentMode, options.IncludeOnly, options.HtmlWorkshopPath)\r
return pkgObj\r
\r
def callbackLogMessage(msg, level):\r
- print msg.strip()\r
+ print(msg.strip())\r
\r
def callbackCreateDoxygenProcess(doxPath, configPath):\r
if sys.platform == 'win32':\r
cmd = '"%s" %s' % (doxPath, configPath)\r
else:\r
cmd = '%s %s' % (doxPath, configPath)\r
- print cmd\r
+ print(cmd)\r
subprocess.call(cmd, shell=True)\r
\r
\r
def DocumentFixup(outPath, arch):\r
# find BASE_LIBRARY_JUMP_BUFFER structure reference page\r
\r
- print '\n >>> Start fixup document \n'\r
+ print('\n >>> Start fixup document \n')\r
\r
for root, dirs, files in os.walk(outPath):\r
for dir in dirs:\r
if text.find('MdePkg/Include/Library/UefiApplicationEntryPoint.h File Reference') != -1:\r
FixPageUefiApplicationEntryPoint(fullpath, text)\r
\r
- print ' >>> Finish all document fixing up! \n'\r
+ print(' >>> Finish all document fixing up! \n')\r
\r
def FixPageBaseLib(path, text):\r
- print ' >>> Fixup BaseLib file page at file %s \n' % path\r
+ print(' >>> Fixup BaseLib file page at file %s \n' % path)\r
lines = text.split('\n')\r
lastBaseJumpIndex = -1\r
lastIdtGateDescriptor = -1\r
except:\r
logging.getLogger().error(" <<< Fail to fixup file %s\n" % path)\r
return\r
- print " <<< Finish to fixup file %s\n" % path\r
+ print(" <<< Finish to fixup file %s\n" % path)\r
\r
def FixPageIA32_IDT_GATE_DESCRIPTOR(path, text):\r
- print ' >>> Fixup structure reference IA32_IDT_GATE_DESCRIPTOR at file %s \n' % path\r
+ print(' >>> Fixup structure reference IA32_IDT_GATE_DESCRIPTOR at file %s \n' % path)\r
lines = text.split('\n')\r
for index in range(len(lines) - 1, -1, -1):\r
line = lines[index].strip()\r
except:\r
logging.getLogger().error(" <<< Fail to fixup file %s\n" % path)\r
return\r
- print " <<< Finish to fixup file %s\n" % path\r
+ print(" <<< Finish to fixup file %s\n" % path)\r
\r
def FixPageBASE_LIBRARY_JUMP_BUFFER(path, text):\r
- print ' >>> Fixup structure reference BASE_LIBRARY_JUMP_BUFFER at file %s \n' % path\r
+ print(' >>> Fixup structure reference BASE_LIBRARY_JUMP_BUFFER at file %s \n' % path)\r
lines = text.split('\n')\r
bInDetail = True\r
bNeedRemove = False\r
except:\r
logging.getLogger().error(" <<< Fail to fixup file %s" % path)\r
return\r
- print " <<< Finish to fixup file %s\n" % path\r
+ print(" <<< Finish to fixup file %s\n" % path)\r
\r
def FixPageUefiDriverEntryPoint(path, text):\r
- print ' >>> Fixup file reference MdePkg/Include/Library/UefiDriverEntryPoint.h at file %s \n' % path\r
+ print(' >>> Fixup file reference MdePkg/Include/Library/UefiDriverEntryPoint.h at file %s \n' % path)\r
lines = text.split('\n')\r
bInModuleEntry = False\r
bInEfiMain = False\r
except:\r
logging.getLogger().error(" <<< Fail to fixup file %s" % path)\r
return\r
- print " <<< Finish to fixup file %s\n" % path\r
+ print(" <<< Finish to fixup file %s\n" % path)\r
\r
\r
def FixPageUefiApplicationEntryPoint(path, text):\r
- print ' >>> Fixup file reference MdePkg/Include/Library/UefiApplicationEntryPoint.h at file %s \n' % path\r
+ print(' >>> Fixup file reference MdePkg/Include/Library/UefiApplicationEntryPoint.h at file %s \n' % path)\r
lines = text.split('\n')\r
bInModuleEntry = False\r
bInEfiMain = False\r
except:\r
logging.getLogger().error(" <<< Fail to fixup file %s" % path)\r
return\r
- print " <<< Finish to fixup file %s\n" % path\r
+ print(" <<< Finish to fixup file %s\n" % path)\r
\r
if __name__ == '__main__':\r
wspath, pkgpath, doxpath, outpath, archtag, docmode, isinc, hwpath = parseCmdArgs()\r
else:\r
cmd = '%s %s' % (hwpath, indexpath)\r
subprocess.call(cmd)\r
- print '\nFinish to generate package document! Please open %s for review' % os.path.join(outpath, 'html', 'index.chm')\r
+ print('\nFinish to generate package document! Please open %s for review' % os.path.join(outpath, 'html', 'index.chm'))\r
else:\r
- print '\nFinish to generate package document! Please open %s for review' % os.path.join(outpath, 'html', 'index.html')\r
+ print('\nFinish to generate package document! Please open %s for review' % os.path.join(outpath, 'html', 'index.html'))\r