X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FScripts%2FPackageDocumentTools%2Fplugins%2FEdkPlugins%2Fedk2%2Fmodel%2Fdoxygengen.py;fp=BaseTools%2FScripts%2FPackageDocumentTools%2Fplugins%2FEdkPlugins%2Fedk2%2Fmodel%2Fdoxygengen.py;h=94b6588c0ddf43ca2e29546919e1e8ee99c1938c;hp=268ba5c3bdd05ff54fd9cb6e761e9d60007a1619;hb=4231a8193ec0d52df7e0a101d96c51b1a2b7a996;hpb=05a32984ab799a564e2eeb7dff128fe0992910d8 diff --git a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/doxygengen.py b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/doxygengen.py index 268ba5c3bd..94b6588c0d 100644 --- a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/doxygengen.py +++ b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/doxygengen.py @@ -69,7 +69,7 @@ class DoxygenAction: self._chmCallback = None def Log(self, message, level='info'): - if self._log != None: + if self._log is not None: self._log(message, level) def IsVerbose(self): @@ -94,7 +94,7 @@ class DoxygenAction: self.Log(" >>>>>> Generate doxygen index page file...Zzz...\n") indexPagePath = self.GenerateIndexPage() - if indexPagePath == None: + if indexPagePath is None: self.Log("Fail to generate index page!\n", 'error') return False else: @@ -109,7 +109,7 @@ class DoxygenAction: self.Log(" <<<<<< Success Save doxygen config file to %s...\n" % configFilePath) # launch doxygen tool to generate document - if self._doxygenCallback != None: + if self._doxygenCallback is not None: self.Log(" >>>>>> Start doxygen process...Zzz...\n") if not self._doxygenCallback(self._doxPath, configFilePath): return False @@ -166,9 +166,9 @@ class PackageDocumentAction(DoxygenAction): self._configFile.AddPreDefined('MDE_CPU_ARM') namestr = self._pObj.GetName() - if self._arch != None: + if self._arch is not None: namestr += '[%s]' % self._arch - if self._tooltag != None: + if self._tooltag is not None: namestr += '[%s]' % self._tooltag self._configFile.SetProjectName(namestr) self._configFile.SetStripPath(self._pObj.GetWorkspace()) @@ -314,7 +314,7 @@ class PackageDocumentAction(DoxygenAction): objs = pObj.GetFileObj().GetSectionObjectsByName('libraryclass', self._arch) if len(objs) == 0: return [] - if self._arch != None: + if self._arch is not None: for obj in objs: classPage = doxygen.Page(obj.GetClassName(), "lc_%s" % obj.GetClassName()) @@ -399,7 +399,7 @@ class PackageDocumentAction(DoxygenAction): mo = re.match(r"^[#\w\s]+[<\"]([\\/\w.]+)[>\"]$", lines[no].strip()) filePath = mo.groups()[0] - if filePath == None or len(filePath) == 0: + if filePath is None or len(filePath) == 0: continue # find header file in module's path firstly. @@ -417,7 +417,7 @@ class PackageDocumentAction(DoxygenAction): if os.path.exists(incPath): fullPath = incPath break - if infObj != None: + if infObj is not None: pkgInfObjs = infObj.GetSectionObjectsByName('packages') for obj in pkgInfObjs: decObj = dec.DECFile(os.path.join(pObj.GetWorkspace(), obj.GetPath())) @@ -433,10 +433,10 @@ class PackageDocumentAction(DoxygenAction): if os.path.exists(os.path.join(incPath, filePath)): fullPath = os.path.join(os.path.join(incPath, filePath)) break - if fullPath != None: + if fullPath is not None: break - if fullPath == None and self.IsVerbose(): + if fullPath is None and self.IsVerbose(): self.Log('Can not resolve header file %s for file %s in package %s\n' % (filePath, path, pObj.GetFileObj().GetFilename()), 'error') return else: @@ -477,7 +477,7 @@ class PackageDocumentAction(DoxygenAction): typeRootPageDict[obj.GetPcdType()] = doxygen.Page(obj.GetPcdType(), 'pcd_%s_root_page' % obj.GetPcdType()) pcdRootPage.AddPage(typeRootPageDict[obj.GetPcdType()]) typeRoot = typeRootPageDict[obj.GetPcdType()] - if self._arch != None: + if self._arch is not None: pcdPage = doxygen.Page('%s' % obj.GetPcdName(), 'pcd_%s_%s_%s' % (obj.GetPcdType(), obj.GetArch(), obj.GetPcdName().split('.')[1])) pcdPage.AddDescription('
\n'.join(obj.GetComment()) + '
\n') @@ -573,7 +573,7 @@ class PackageDocumentAction(DoxygenAction): pageRoot = doxygen.Page('GUID', 'guid_root_page') objs = pObj.GetFileObj().GetSectionObjectsByName('guids', self._arch) if len(objs) == 0: return [] - if self._arch != None: + if self._arch is not None: for obj in objs: pageRoot.AddPage(self._GenerateGuidSubPage(pObj, obj, configFile)) else: @@ -626,7 +626,7 @@ class PackageDocumentAction(DoxygenAction): pageRoot = doxygen.Page('PPI', 'ppi_root_page') objs = pObj.GetFileObj().GetSectionObjectsByName('ppis', self._arch) if len(objs) == 0: return [] - if self._arch != None: + if self._arch is not None: for obj in objs: pageRoot.AddPage(self._GeneratePpiSubPage(pObj, obj, configFile)) else: @@ -680,7 +680,7 @@ class PackageDocumentAction(DoxygenAction): pageRoot = doxygen.Page('PROTOCOL', 'protocol_root_page') objs = pObj.GetFileObj().GetSectionObjectsByName('protocols', self._arch) if len(objs) == 0: return [] - if self._arch != None: + if self._arch is not None: for obj in objs: pageRoot.AddPage(self._GenerateProtocolSubPage(pObj, obj, configFile)) else: @@ -773,7 +773,7 @@ class PackageDocumentAction(DoxygenAction): if not infObj.Parse(): self.Log('Fail to load INF file %s' % inf) continue - if infObj.GetProduceLibraryClass() != None: + if infObj.GetProduceLibraryClass() is not None: libObjs.append(infObj) else: modObjs.append(infObj) @@ -951,7 +951,7 @@ class PackageDocumentAction(DoxygenAction): retarr = self.SearchLibraryClassHeaderFile(lcObj.GetClass(), workspace, refDecObjs) - if retarr != None: + if retarr is not None: pkgname, hPath = retarr else: self.Log('Fail find the library class %s definition from module %s dependent package!' % (lcObj.GetClass(), infObj.GetFilename()), 'error')