]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Scripts/PackageDocumentTools/packagedoc_cli.py
BaseTools: Remove equality operator with None
[mirror_edk2.git] / BaseTools / Scripts / PackageDocumentTools / packagedoc_cli.py
index 92ee6997827726728b19ea5fd0f0589fe414a296..557ffa4505e4e9fa156c7b246bae526bc12a3dcd 100644 (file)
@@ -49,18 +49,18 @@ def parseCmdArgs():
 \r
     # validate the options\r
     errors = []\r
-    if options.WorkspacePath == None:\r
+    if options.WorkspacePath is None:\r
         errors.append('- Please specify workspace path via option -w!')\r
     elif not os.path.exists(options.WorkspacePath):\r
         errors.append("- Invalid workspace path %s! The workspace path should be exist in absolute path!" % options.WorkspacePath)\r
 \r
-    if options.PackagePath == None:\r
+    if options.PackagePath is None:\r
         errors.append('- Please specify package DEC file path via option -p!')\r
     elif not os.path.exists(options.PackagePath):\r
         errors.append("- Invalid package's DEC file path %s! The DEC path should be exist in absolute path!" % options.PackagePath)\r
 \r
     default = "C:\\Program Files\\doxygen\\bin\\doxygen.exe"\r
-    if options.DoxygenPath == None:\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
             options.DoxygenPath = default\r
@@ -69,7 +69,7 @@ def parseCmdArgs():
     elif not os.path.exists(options.DoxygenPath):\r
         errors.append("- Invalid doxygen tool path %s! The doxygen tool path should be exist in absolute path!" % options.DoxygenPath)\r
 \r
-    if options.OutputPath != None:\r
+    if options.OutputPath is not None:\r
         if not os.path.exists(options.OutputPath):\r
             # create output\r
             try:\r
@@ -77,7 +77,7 @@ def parseCmdArgs():
             except:\r
                 errors.append('- Fail to create the output directory %s' % options.OutputPath)\r
     else:\r
-        if options.PackagePath != None and os.path.exists(options.PackagePath):\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
@@ -90,21 +90,21 @@ def parseCmdArgs():
         else:\r
             errors.append('- Please specify document output path via option -o!')\r
 \r
-    if options.Arch == None:\r
+    if options.Arch is None:\r
         options.Arch = 'ALL'\r
         print "Warning: Assume arch is \"ALL\". If not, specify via -a"\r
 \r
-    if options.DocumentMode == None:\r
+    if options.DocumentMode is None:\r
         options.DocumentMode = "HTML"\r
         print "Warning: Assume document mode is \"HTML\". If not, specify via -m"\r
 \r
-    if options.IncludeOnly == None:\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
 \r
     if options.DocumentMode.lower() == 'chm':\r
         default = "C:\\Program Files\\HTML Help Workshop\\hhc.exe"\r
-        if options.HtmlWorkshopPath == None:\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
                 options.HtmlWorkshopPath = default\r
@@ -382,7 +382,7 @@ if __name__ == '__main__':
 \r
     # create package model object firstly\r
     pkgObj = createPackageObject(wspath, pkgpath)\r
-    if pkgObj == None:\r
+    if pkgObj is None:\r
         sys.exit(-1)\r
 \r
     # create doxygen action model\r